1 #ifndef Rice__Data_Type_defn__hpp_
2 #define Rice__Data_Type_defn__hpp_
4 #include "Class_defn.hpp"
5 #include "Data_Type_fwd.hpp"
6 #include "detail/ruby.hpp"
20 class Abstract_Caster;
40 typedef std::map<VALUE, detail::Abstract_Caster *> Casters;
42 virtual detail::Abstract_Caster * caster()
const = 0;
44 static Casters & casters();
47 static Casters * casters_;
69 template<
typename T,
typename Base_T>
91 template<
typename T,
typename Base_T>
102 template<
typename From_T,
typename To_T>
103 void define_implicit_cast();
111 :
public Module_impl<Data_Type_Base, Data_Type<T> >
160 template<
typename Constructor_T>
162 Constructor_T constructor,
163 Arguments * arguments = 0);
165 template<
typename Constructor_T>
167 Constructor_T constructor,
191 template<
typename Director_T>
205 virtual detail::Abstract_Caster * caster()
const;
207 static std_unique_ptr<detail::Abstract_Caster> caster_;
217 template<
typename Base_T>
220 template<
typename T_>
225 template<
typename T_,
typename Base_T_>
230 template<
typename T_>
234 template<
typename T_,
typename Base_T_>
239 template<
typename T_>
242 static void check_is_bound();
246 typedef std::set<Data_Type<T> *> Instances;
248 static Instances & unbound_instances()
250 static Instances unbound_instances;
251 return unbound_instances;
258 #include "Data_Type.ipp"
Helper for defining default arguments of a method.
Definition: Arg_impl.hpp:27
The base class for all instantiations of Data_Type.
Definition: Data_Type_defn.hpp:28
virtual ~Data_Type_Base()=0
Destructor.
Data_Type_Base(VALUE v)
Constructor.
Data_Type_Base()
Default constructor.
A mechanism for binding ruby types to C++ types.
Definition: Data_Type_defn.hpp:112
virtual ~Data_Type()
Destructor.
static T * from_ruby(Object x)
Convert ruby object x to type T.
static Module klass()
Explictly return the Ruby type.
virtual Data_Type & operator=(Module const &klass)
Assignment operator which takes a Module.
Data_Type()
Default constructor which does not bind.
Data_Type(Module const &v)
Constructor which takes a Module.
friend Rice::Data_Type< T_ > define_class(char const *name)
Define a new data class in the default namespace.
Data_Type< T > & define_director()
Register a Director class for this class.
static bool is_bound()
Determine if the type is bound.
friend Rice::Data_Type< T_ > define_class_under(Object module, char const *name)
Define a new data class in the namespace given by module.
Data_Type< T > & define_constructor(Constructor_T constructor, Arguments *arguments=0)
Define a constructor for the class.
static Data_Type bind(Module const &klass)
Bind a Data_Type to a VALUE.
friend Rice::Data_Type< T_ > define_class_under(Object module, char const *name)
Define a new data class in the namespace given by module.
T Type
The C++ type being held.
Definition: Data_Type_defn.hpp:115
Definition: Module_impl.hpp:49
A helper for defining a Module and its methods.
Definition: Module_defn.hpp:27
String name() const
Return the name of the module.
The base class for all Objects.
Definition: Object_defn.hpp:25