-
Notifications
You must be signed in to change notification settings - Fork 0
Class
Peder Holt edited this page Oct 23, 2022
·
2 revisions
Use Class in order to register a type. Syntax:
Class<TypeToBeRegistered, Public<BaseClasses...>, AllocatorType,StorageType,AutoReflectorType>
- TypeToBeRegistered is mandatory.
-
Public<BaseClasses...> (optional) lists the direct baseclasses of this type.
- Defaults to Public<>
-
AllocatorType (optional) specifies the allocator used when defining constructors. Defaults to
- Defaults to std::allocator
-
StorageType (optional) Can be either a value such as TypeToBeRegistered, or a smart pointer such as std::shared_ptr
- Defaults to TypeToBeRegistered*
-
AutoReflectorType (optional) Specifies whether base classes should automatically be registered when registering this class.
- Defaults to AutoReflector. which enforces base classes to be automatically registered, and give compile time error if DoReflect for that type is not found. Only the first argument is mandatory. The order of the other optional arguments is not important.
//Class is defined like this:
//class Point {};
Class<Point> cls(typeLibrary,"Point");
The type Point is registered with the type system with the name "Point".
//Class is defined like this:
//class Point : public Shape {};
Class<Point, Public<Shape>> cls(typeLibrary,"Point");