Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 49 lines (41 sloc) 1.053 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#ifndef RBX_DISPATCH_HPP
#define RBX_DISPATCH_HPP

#include "builtin/object.hpp"

namespace rubinius {
  class Symbol;
  class Module;
  class Executable;
  struct CallFrame;
  class Arguments;
  struct LookupData;

  class Dispatch {
  public:
    Symbol* name;
    Module* module;
    Executable* method;
    bool method_missing;

    Dispatch()
      : name(0)
      , module(0)
      , method(0)
      , method_missing(false)
    {}

    Dispatch(Symbol* name)
      : name(name)
      , module(reinterpret_cast<Module*>(cNil))
      , method(reinterpret_cast<Executable*>(cNil))
      , method_missing(false)
    {}

    Dispatch(Symbol* name, Module* mod, Executable* meth)
      : name(name)
      , module(mod)
      , method(meth)
      , method_missing(false)
    {}

    Object* send(STATE, CallFrame* call_frame, Arguments& args,
                 MethodMissingReason reason = eNormal);
    Object* send(STATE, CallFrame* call_frame, LookupData& lookup, Arguments& args,
                 MethodMissingReason reason = eNormal);
  };
}

#endif
Something went wrong with that request. Please try again.