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. | |
Public Member Functions | |
virtual json_object * | getJson () |
Serializes this instance's data. | |
std::string | getType () const |
Returns this instance's specialized type. | |
virtual char * | getSummary ()=0 |
Outputs a summary of this instance's data, to be shown in port popovers. | |
virtual bool | operator== (const VuoSerializable &that)=0 |
Returns true if this instance is equivalent to that instance. | |
virtual bool | operator< (const VuoSerializable &that)=0 |
Returns true if this instance sorts before that instance. | |
VuoSerializable () | |
Registers an instance of a VuoSerializable subclass with VuoHeap. | |
virtual | ~VuoSerializable () |
Does nothing. | |
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. | |
static void | destroy (void *t) |
Deletes an instance of a VuoSerializable subclass. | |
static VuoSerializable * | makeFromJson (json_object *js) |
Creates an instance of a VuoSerializable subclass from JSON. | |
Static Public Attributes | |
static std::string | type = "" |
The subtype's class name. | |
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 92 of file VuoSerializable.cc.
|
virtual |
Does nothing.
Definition at line 100 of file VuoSerializable.cc.
|
static |
Deletes an instance of a VuoSerializable subclass.
To be called only by VuoHeap.
Definition at line 109 of file VuoSerializable.cc.
|
virtual |
Serializes this instance's data.
Reimplemented in VuoUiThemeButtonRounded, VuoUiThemeGroup, VuoUiThemeSliderRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeToggleRounded.
Definition at line 63 of file VuoSerializable.cc.
|
pure virtual |
Outputs a summary of this instance's data, to be shown in port popovers.
Implemented in VuoUiThemeButtonRounded, VuoUiThemeGroup, VuoUiThemeSliderRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeToggleRounded.
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 76 of file VuoSerializable.cc.
|
static |
Creates an instance of a VuoSerializable subclass from JSON.
Definition at line 46 of file VuoSerializable.cc.
|
pure virtual |
Returns true if this instance sorts before that instance.
Implemented in VuoUiThemeButtonRounded, VuoUiThemeGroup, VuoUiThemeSliderRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeToggleRounded.
|
pure virtual |
Returns true if this instance is equivalent to that instance.
Implemented in VuoUiThemeButtonRounded, VuoUiThemeGroup, VuoUiThemeSliderRounded, VuoUiThemeTextFieldRounded, and VuoUiThemeToggleRounded.
|
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 33 of file VuoSerializable.cc.
|
static |
The subtype's class name.
Definition at line 30 of file VuoSerializable.hh.