1 #ifndef Rice__Enum__hpp_
2 #define Rice__Enum__hpp_
4 #include "to_from_ruby_defn.hpp"
5 #include "Address_Registration_Guard.hpp"
10 #include "Data_Type.hpp"
16 template<
typename Enum_T>
45 template<
typename Enum_T,
typename Enum_Traits = Default_Enum_Traits<Enum_T> >
47 :
public Module_impl<Data_Type<Enum_T>, Enum<Enum_T, Enum_Traits> >
56 Module module = rb_cObject);
76 void swap(
Enum & other);
87 Module module = rb_cObject);
110 Module module = rb_cObject);
A guard to register a given address with the GC.
Definition: Address_Registration_Guard_defn.hpp:31
A wrapper for the ruby Array class.
Definition: Array.hpp:24
A helper for defining a Class and its methods.
Definition: Class_defn.hpp:24
static Module klass()
Explictly return the Ruby type.
A wrapper for enumerated types.
Definition: Enum.hpp:48
Enum()
Default constructor.
Enum< Enum_T, Enum_Traits > & define_value(char const *name, Enum_T value)
Define a new enum value.
Enum(Enum const &other)
Copy constructor.
Enum(char const *name, Module module=rb_cObject)
Construct and initialize.
Enum & operator=(Enum const &other)
Assignment operator.
virtual ~Enum()
Destructor.
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
VALUE const volatile & value() const
Explicitly get the encapsulated VALUE.
Definition: Object_defn.hpp:56
String to_s() const
Return a string representation of an object.
String inspect() const
Inspect the object.
Default traits for the Enum class template.
Definition: Enum.hpp:18
static long as_long(Enum_T value)
Converts the enum value to a long.