#include <lestes/std/objectize.hh>Go to the source code of this file.
Defines | |
| #define | specialize_objectize_for_enum(type) |
| #define | specialize_objectize_nodump(type) |
| #define | specialize_objectize_nodump_reference(type) |
| #define specialize_objectize_for_enum | ( | type | ) |
Value:
template<> \ class objectize< type > : public objectize<lint> { \ public: \ static ptr< objectize<lint> > create( type a_value ) \ { \ return objectize<lint>::create( static_cast<lint>(a_value) ); \ } \ private: \ /*! Hide the constructor */ \ objectize< type >(); \ }
The macro must be used inside lestes::std and must not be used more than once for the same type, o for a type that was passed to the other macro, specialize_objectize_nodump().
Usually, you would pass fully qualified name as the type argument.
Actually, the only thing that is implemented here is the create method. It static casts the argument and returns a pointer to objectize<lint>.
Definition at line 46 of file objectize_macros.hh.
| #define specialize_objectize_nodump | ( | type | ) |
Value:
template<> \ class objectize< type > : public object { \ public: \ static ptr< objectize< type > > create( const type & ) \ { \ /* the agument is not used at all */ \ return new objectize< type >(); \ } \ virtual void accept_dumper_visitor( ptr<dumper_visitor> v ) \ { \ return v->visit_nodump(); \ } \ protected: \ objectize< type >() \ {} \ }
The macro must be used inside lestes::std and must not be used more than once for the same type, or for a type that was passed to the other macro, specialize_objectize_for_enum().
Usually, you would pass fully qualified name as the type argument.
Note that The create method does not use its argument in any way. This, and the fact that const reference is used, ensures that no further requirements are placed on the given type. If reference was not used, the type would have to publicly support copy-construction. This has a disadvantage, though: The type argument cannot be a reference type. Other macro is provided for those.
Definition at line 75 of file objectize_macros.hh.
| #define specialize_objectize_nodump_reference | ( | type | ) |
Value:
template<> \ class objectize< type > : public object { \ public: \ static ptr< objectize< type > > create( const type ) \ { \ /* the agument is not used at all */ \ return new objectize< type >(); \ } \ virtual void accept_dumper_visitor( ptr<dumper_visitor> v ) \ { \ return v->visit_nodump(); \ } \ protected: \ objectize< type >() \ {} \ }
See documentation for specialize_objectize_nodump macro.
Definition at line 101 of file objectize_macros.hh.
1.5.1-20070107