Skip to content

Instantly share code, notes, and snippets.

@aristidb
Created May 5, 2009 17:22
Show Gist options
  • Select an option

  • Save aristidb/107067 to your computer and use it in GitHub Desktop.

Select an option

Save aristidb/107067 to your computer and use it in GitHub Desktop.
template < typename Class > class clazz_base
: public::flusspferd::native_object_base
{
public:
typedef clazz_base base_type;
struct class_info:::flusspferd::class_info
{
typedef
boost::mpl::bool_ < (true) > constructible;
static char const * constructor_name ()
{
return ("clazz");
}
typedef::boost::mpl::size_t < (0) > constructor_arity;
static char const * full_name ()
{
return ("full.clazz");
}
static::flusspferd::object create_prototype ()
{
::flusspferd::object obj =::flusspferd::create_object (::flusspferd::prototype< ::flusspferd::native_object_base > ());
::flusspferd::create_native_method (obj, ("x"), &Class::x);
return obj;
}
static void augment_constructor (::flusspferd::object & obj)
{
(void) obj;
}
typedef boost::mpl::bool_ < (false) > custom_enumerate;
};
clazz_base () : ::flusspferd::native_object_base ()
{
}
template < typename P0 >
clazz_base (P0 const &p0) : ::flusspferd::native_object_base (p0)
{
}
template < typename P0, typename P1 > clazz_base (P0 const &p0, P1 const &p1)
: ::flusspferd::native_object_base (p0, p1)
{
}
template < typename P0, typename P1, typename P2 >
clazz_base (P0 const &p0, P1 const &p1, P2 const &p2)
: ::flusspferd::native_object_base (p0, p1, p2)
{
}
template < typename P0, typename P1, typename P2, typename P3 >
clazz_base (P0 const &p0, P1 const &p1, P2 const &p2, P3 const &p3)
: ::flusspferd::native_object_base (p0, p1, p2, p3)
{
}
template < typename P0, typename P1, typename P2, typename P3, typename P4 >
clazz_base (P0 const &p0, P1 const &p1, P2 const &p2, P3 const &p3, P4 const &p4)
: ::flusspferd::native_object_base (p0, p1, p2, p3, p4)
{
}
};
class clazz : public clazz_base < clazz >
{
CONTENT
};
FLUSSPFERD_CLASS_DESCRIPTION(
(cpp_name, clazz)
(constructor_name, "clazz")
(full_name, "full.clazz")
(methods,
("x",bind,x)))
{
CONTENT
};
// $ echo -e 'FLUSSPFERD_CLASS_DESCRIPTION((cpp_name,clazz)(constructor_name,"clazz")(full_name,"full.clazz")(methods,("x",bind,x))) { CONTENT };'|g++ -DPREPROC_DEBUG -I /usr/local/include/boost-1_39/ -include include/flusspferd/class_description.hpp -P -E -x c++ -
template<typename Class> class clazz_base : public ::flusspferd::native_object_base { public: typedef clazz_base base_type; struct class_info : ::flusspferd::class_info { typedef boost::mpl::bool_< (true) > constructible; static char const *constructor_name() { return ("clazz"); } typedef ::boost::mpl::size_t< (0) > constructor_arity; static char const *full_name() { return ("full.clazz"); } static ::flusspferd::object create_prototype() { ::flusspferd::object obj = ::flusspferd::create_object( ::flusspferd::prototype< ::flusspferd::native_object_base >() ); ::flusspferd::create_native_method( obj, ("x"), & Class :: x); return obj; } static void augment_constructor(::flusspferd::object &obj) { (void)obj; } typedef boost::mpl::bool_< (false) > custom_enumerate; }; clazz_base ( ) : ::flusspferd::native_object_base ( ) { } template< typename P0 > clazz_base ( P0 const &p0 ) : ::flusspferd::native_object_base ( p0 ) { } template< typename P0 , typename P1 > clazz_base ( P0 const &p0 , P1 const &p1 ) : ::flusspferd::native_object_base ( p0 , p1 ) { } template< typename P0 , typename P1 , typename P2 > clazz_base ( P0 const &p0 , P1 const &p1 , P2 const &p2 ) : ::flusspferd::native_object_base ( p0 , p1 , p2 ) { } template< typename P0 , typename P1 , typename P2 , typename P3 > clazz_base ( P0 const &p0 , P1 const &p1 , P2 const &p2 , P3 const &p3 ) : ::flusspferd::native_object_base ( p0 , p1 , p2 , p3 ) { } template< typename P0 , typename P1 , typename P2 , typename P3 , typename P4 > clazz_base ( P0 const &p0 , P1 const &p1 , P2 const &p2 , P3 const &p3 , P4 const &p4 ) : ::flusspferd::native_object_base ( p0 , p1 , p2 , p3 , p4 ) { } }; class clazz : public clazz_base < clazz > { CONTENT };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment