DUECA/DUSIME
|
ScriptCreatable templated holder class. More...
#include <ScriptCreatableDataHolder.hxx>
Public Types | |
typedef T | data_type |
Encapsulated type. | |
Public Member Functions | |
ScriptCreatableDataHolder () | |
Constructor. | |
bool | complete () |
Continued construction. | |
const char * | getTypeName () |
Type name information. | |
virtual | ~ScriptCreatableDataHolder () |
Destructor. | |
T & | data () |
Gives access to the data object contained in this DataHolder. | |
const T & | data () const |
Gives access to the data object contained in this DataHolder. | |
ScriptCreatable templated holder class.
This template can be used for scheme creatable objects (defined in a DCO file) that do not directly derive from ScriptCreatable.
Typically, use of this class is invoked by setting
in your DCO object definition.
This ensures that the object can be created from the (scheme) creation script, and all member variables are accessable and settable, with lines like:
In python this looks a little different,
To "accept" one of these variables in your module, you can add a function to the parametertable which accepts a ScriptCreatable object. This object can take a dynamic cast to a ScriptCreatableDataHolder of your object type, and with the data() function the data can be accessed.
In your table:
Then the code to accept the object (declare a matching function in your class):
|
inline |
Constructor.
Is normally called from scheme/the creation script.
|
inline |
Continued construction.
This is called after all script parameters have been read and filled in, according to the parameter table.