Base class for VuoTypes implemented as private polymorphic class sets.
Definition at line 24 of file VuoSerializable.hh.
Public Types | |
typedef VuoSerializable *(* | Constructor) (json_object *) |
A makeFromJson method. More... | |
Public Member Functions | |
virtual json_object * | getJson () |
Serializes this instance's data. More... | |
std::string | getType () const |
Returns this instance's specialized type. More... | |
virtual char * | getSummary ()=0 |
Outputs a summary of this instance's data, to be shown in port popovers. More... | |
virtual bool | operator== (const VuoSerializable &that)=0 |
Returns true if this instance is equivalent to that instance. More... | |
virtual bool | operator< (const VuoSerializable &that)=0 |
Returns true if this instance sorts before that instance. More... | |
VuoSerializable () | |
Registers an instance of a VuoSerializable subclass with VuoHeap. More... | |
virtual | ~VuoSerializable () |
Does nothing. More... | |
Static Public Member Functions | |
static bool | registerSubclass (std::string type, Constructor makeFromJson) |
Informs this base class of the presence of a subclass, so it can be instantiated from JSON. More... | |
static void | destroy (void *t) |
Deletes an instance of a VuoSerializable subclass. More... | |
static VuoSerializable * | makeFromJson (json_object *js) |
Creates an instance of a VuoSerializable subclass from JSON. More... | |
Static Public Attributes | |
static std::string | type = "" |
The subtype's class name. More... | |
typedef VuoSerializable*(* VuoSerializable::Constructor) (json_object *) |
A makeFromJson method.
Definition at line 27 of file VuoSerializable.hh.
VuoSerializable::VuoSerializable | ( | ) |
Registers an instance of a VuoSerializable subclass with VuoHeap.
Definition at line 89 of file VuoSerializable.cc.
|
virtual |
Does nothing.
Definition at line 97 of file VuoSerializable.cc.
|
static |
Deletes an instance of a VuoSerializable subclass.
To be called only by VuoHeap.
Definition at line 106 of file VuoSerializable.cc.
|
virtual |
Serializes this instance's data.
Reimplemented in VuoUiThemeSliderRounded, VuoUiThemeToggleRounded, VuoUiThemeButtonRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeGroup.
Definition at line 64 of file VuoSerializable.cc.
|
pure virtual |
Outputs a summary of this instance's data, to be shown in port popovers.
Implemented in VuoUiThemeSliderRounded, VuoUiThemeToggleRounded, VuoUiThemeButtonRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeGroup.
std::string VuoSerializable::getType | ( | ) | const |
Returns this instance's specialized type.
Can't simply access the type
member, since C++'s static dereferencing means it will always return the local variable's type, instead of the instance's actual specialized type.
Definition at line 77 of file VuoSerializable.cc.
|
static |
Creates an instance of a VuoSerializable subclass from JSON.
Definition at line 47 of file VuoSerializable.cc.
|
pure virtual |
Returns true if this instance sorts before that instance.
Implemented in VuoUiThemeSliderRounded, VuoUiThemeToggleRounded, VuoUiThemeButtonRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeGroup.
|
pure virtual |
Returns true if this instance is equivalent to that instance.
Implemented in VuoUiThemeSliderRounded, VuoUiThemeToggleRounded, VuoUiThemeButtonRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeGroup.
|
static |
Informs this base class of the presence of a subclass, so it can be instantiated from JSON.
Instead of calling this directly, use VuoSerializableRegister.
Definition at line 34 of file VuoSerializable.cc.
|
static |
The subtype's class name.
Definition at line 30 of file VuoSerializable.hh.