Vuo
2.0.1
|
Functions to serialize, unserialize, and summarize values of the type. Replace "MyType" with the name of your type.
Functions | |
MyType | MyType_makeFromJson (json_object *js) |
Creates a new MyType value by unserializing a JSON-C object. More... | |
json_object * | MyType_getJson (const MyType value) |
Serializes a MyType value to a JSON-C object. More... | |
struct json_object * | MyType_getInterprocessJson (const MyType value) |
Serializes a MyType value to a JSON-formatted string, in a format that will allow another process to unserialize it. More... | |
VuoList_MyType | MyType_getAllowedValues (void) |
Returns a list of values that instances of this type can have. More... | |
char * | MyType_getSummary (const MyType value) |
Returns a brief description of a value. More... | |
MyType | MyType_makeFromString (const char *str) |
Creates a new MyType value by unserializing a JSON-formatted string. More... | |
char * | MyType_getString (const MyType value) |
Serializes a MyType value to a JSON-formatted string. More... | |
char * | MyType_getInterprocessString (const MyType value) |
Serializes a MyType value to a JSON-formatted string, in a format that will allow another process to unserialize it. More... | |
void | MyType_retain (const MyType value) |
Increments the reference count of a value or its fields, if needed. More... | |
void | MyType_release (const MyType value) |
Decrements the reference count of a value or its fields, if needed. More... | |
VuoList_MyType MyType_getAllowedValues | ( | void | ) |
Returns a list of values that instances of this type can have.
The values returned by this function are shown in input editor menus, in the order specified.
The type may have other values not returned by this function (for example, if the values were allowed in older versions of the type, but are not allowed now).
This function is required for enum types, and should only be defined for types whose sizeof() = 4
(enum
, int64_t
, void *
, char *
, etc).
struct json_object* MyType_getInterprocessJson | ( | const MyType | value | ) |
Serializes a MyType
value to a JSON-formatted string, in a format that will allow another process to unserialize it.
If this function is implemented, then MyType_makeFromJson() needs to handle both the format returned by this function and the format returned by MyType_getJson().
This function is optional.
value | The value to serialize. May be null. |
char* MyType_getInterprocessString | ( | const MyType | value | ) |
Serializes a MyType
value to a JSON-formatted string, in a format that will allow another process to unserialize it.
Calls MyType_getInterprocessJson().
This function is automatically generated by the Vuo compiler (but only if MyType_getInterprocessJson() exists). Do not implement it. If this function needs to be called by MyType
or other code, then declare it in MyType
.
value | The value to serialize. |
json_object* MyType_getJson | ( | const MyType | value | ) |
Serializes a MyType
value to a JSON-C object.
This function is required.
If this function serializes the value in a format that won't allow another process to unserialize it (for example, if the serialization contains a memory address), then MyType_getInterprocessJson() needs to be implemented, too.
value | The value to serialize. May be null. |
char* MyType_getString | ( | const MyType | value | ) |
Serializes a MyType
value to a JSON-formatted string.
Calls MyType_getJson().
This function is automatically generated by the Vuo compiler. Do not implement it. If this function needs to be called by MyType
or other code, then declare it in MyType
.
value | The value to serialize. |
char* MyType_getSummary | ( | const MyType | value | ) |
Returns a brief description of a value.
This function is required.
For enum types, the string returned by this function is shown in input editor menus.
value | The value to summarize. May be null. |
MyType MyType_makeFromJson | ( | json_object * | js | ) |
Creates a new MyType
value by unserializing a JSON-C object.
This function is required.
js | A JSON-C object from MyType_getJson() (or MyType_interprocesJsonFromValue() if it exists), from a constant input port value defined in a composition, or from a default input port value defined in a node class implementation. |
MyType MyType_makeFromString | ( | const char * | str | ) |
Creates a new MyType
value by unserializing a JSON-formatted string.
Calls MyType_makeFromJson().
This function is automatically generated by the Vuo compiler. Do not implement it. If this function is called by MyType
or other code, then declare it in MyType
.
str | A JSON-formatted string. |
void MyType_release | ( | const MyType | value | ) |
Decrements the reference count of a value or its fields, if needed.
MyType
is a pointer, this function calls VuoRelease() on value.MyType
is a struct, this function calls VuoRelease() on each field of value that is a pointer.This function is automatically generated by the Vuo compiler. Do not implement it. If this function needs to be called by MyType
or other code, then declare it in MyType
.
void MyType_retain | ( | const MyType | value | ) |
Increments the reference count of a value or its fields, if needed.
MyType
is a pointer, this function calls VuoRetain() on value.MyType
is a struct, this function calls VuoRetain() on each field of value that is a pointer.This function is automatically generated by the Vuo compiler. Do not implement it. If this function needs to be called by MyType
or other code, then declare it in MyType
.