Torque2D Reference
|
#include <consoleObject.h>
Public Member Functions | |
const AbstractClassRep::Field * | findField (StringTableEntry fieldName) const |
Get a reference to a field by name. More... | |
virtual AbstractClassRep * | getClassRep () const |
Gets the ClassRep. More... | |
bool | setField (const char *fieldName, const char *value) |
Set the value of a field. More... | |
virtual | ~ConsoleObject () |
Static Public Member Functions | |
static const char * | lookupClassName (const U32 in_classTag) |
Get the classname from a class tag. More... | |
static void | initPersistFields () |
static void | consoleInit () |
Protected Member Functions | |
ConsoleObject () | |
ConsoleObject (const ConsoleObject &) | |
Object Creation | |
static ConsoleObject * | create (const char *in_pClassName) |
static ConsoleObject * | create (const U32 groupId, const U32 typeId, const U32 in_classId) |
Fields | |
static void | addGroup (const char *in_pGroupname, const char *in_pGroupDocs=NULL) |
static void | endGroup (const char *in_pGroupname) |
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL) |
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL) |
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const char *in_pFieldDocs) |
static void | addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const char *in_pFieldDocs) |
static void | addFieldV (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, ConsoleTypeValidator *v, const char *in_pFieldDocs=NULL) |
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL) |
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL) |
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const char *in_pFieldDocs=NULL) |
static void | addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const char *in_pFieldDocs=NULL) |
static void | addDepricatedField (const char *fieldName) |
static bool | removeField (const char *in_pFieldname) |
Field List | |
const AbstractClassRep::FieldList & | getFieldList () const |
Get a list of all the fields. This information cannot be modified. More... | |
AbstractClassRep::FieldList & | getModifiableFieldList () |
bool & | getDynamicGroupExpand () |
ConsoleObject Implementation | |
These functions are implemented in every subclass of ConsoleObject by an IMPLEMENT_CONOBJECT or IMPLEMENT_CO_* macro. | |
S32 | getClassId (U32 netClassGroup) const |
const char * | getClassName () const |
static AbstractClassRep * | getStaticClassRep () |
Get the abstract class information for this class. More... | |
static AbstractClassRep * | getParentStaticClassRep () |
Get the abstract class information for this class's superclass. More... | |
Interface class to the console.
Any object which you want to work with the console system should derive from this, and access functionality through the static interface.
This class is always used with the DECLARE_CONOBJECT and IMPLEMENT_* macros.
That's all you need to do to get a class registered with the console system. At this point, you can instantiate it via script, tie methods to it using ConsoleMethod, register fields, and so forth. You can also register any global variables related to the class by creating a consoleInit() method.
You will need to use different IMPLEMENT_ macros in different cases; for instance, if you are making a NetObject (for ghosting), a DataBlock, or a NetEvent.
|
inlineprotected |
|
protected |
|
virtual |
|
staticprotected |
Add a deprecated field.
A deprecated field will always be undefined, even if you assign a value to it. This is useful when you need to make sure that a field is not being used anymore.
|
staticprotected |
Register a complex field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_elementCount | Number of elements in this field. Arrays of elements are assumed to be contiguous in memory. |
in_table | An EnumTable, if this is an enumerated field. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a complex field with a write notify.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_writeDataFn | This method will return whether the field should be written or not. |
in_elementCount | Number of elements in this field. Arrays of elements are assumed to be contiguous in memory. |
in_table | An EnumTable, if this is an enumerated field. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a simple field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a simple field with a write notify.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_writeDataFn | This method will return whether the field should be written or not. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a validated field.
A validated field is just like a normal field except that you can't have it be an array, and that you give it a pointer to a ConsoleTypeValidator subclass, which is then used to validate any value placed in it. Invalid values are ignored and an error is printed to the console.
|
staticprotected |
Mark the beginning of a group of fields.
This is used in the consoleDoc system.
|
staticprotected |
Register a complex protected field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_setDataFn | When this field gets set, it will call the callback provided. |
in_getDataFn | When this field is accessed for it's data, it will return the value of this function |
in_elementCount | Number of elements in this field. Arrays of elements are assumed to be contiguous in memory. |
in_table | An EnumTable, if this is an enumerated field. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a complex protected field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_setDataFn | When this field gets set, it will call the callback provided. |
in_getDataFn | When this field is accessed for it's data, it will return the value of this function |
in_writeDataFn | This method will return whether the field should be written or not. |
in_elementCount | Number of elements in this field. Arrays of elements are assumed to be contiguous in memory. |
in_table | An EnumTable, if this is an enumerated field. |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a simple protected field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_setDataFn | When this field gets set, it will call the callback provided. |
in_getDataFn | When this field is accessed for it's data, it will return the value of this function |
in_pFieldDocs | Usage string for this field. |
|
staticprotected |
Register a simple protected field.
in_pFieldname | Name of the field. |
in_fieldType | Type of the field. |
in_fieldOffset | Offset to the field from the start of the class; calculated using the Offset() macro. |
in_setDataFn | When this field gets set, it will call the callback provided. |
in_getDataFn | When this field is accessed for it's data, it will return the value of this function |
in_writeDataFn | This method will return whether the field should be written or not. |
in_pFieldDocs | Usage string for this field. |
|
static |
Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.
|
inlinestatic |
|
inlinestatic |
|
staticprotected |
Mark the end of a group of fields.
This is used in the consoleDoc system.
|
inline |
Get a reference to a field by name.
|
inline |
Get our network-layer class id.
netClassGroup | The net class for which we want our ID. |
|
inline |
Get our compiler and platform independent class name.
|
virtual |
Gets the ClassRep.
|
inline |
Get a handle to a boolean telling us if we expanded the dynamic group.
|
inline |
Get a list of all the fields. This information cannot be modified.
|
inline |
Get a list of all the fields, set up so we can modify them.
|
inlinestatic |
Get the abstract class information for this class's superclass.
|
inlinestatic |
Get the abstract class information for this class.
|
static |
Register dynamic fields in a subclass of ConsoleObject.
|
static |
Get the classname from a class tag.
|
staticprotected |
Remove a field.
Sometimes, you just have to remove a field!
|
inline |
Set the value of a field.