Vuo  0.5.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions

Description

Functions to serialize, unserialize, and summarize values of the type.

Replace "MyType" with the name of your type.

Functions

MyType MyType_valueFromJson (json_object *js)
 Creates a new MyType value by unserializing a JSON-C object.
 
json_object * MyType_jsonFromValue (const MyType value)
 Serializes a MyType value to a JSON-C object.
 
struct json_object * MyType_interprocessJsonFromValue (const MyType value)
 Serializes a MyType value to a JSON-formatted string, in a format that will allow another process to unserialize it.
 
char * MyType_summaryFromValue (const MyType value)
 Returns a brief description of a value.
 
MyType MyType_valueFromString (const char *str)
 Creates a new MyType value by unserializing a JSON-formatted string.
 
char * MyType_stringFromValue (const MyType value)
 Serializes a MyType value to a JSON-formatted string.
 
char * MyType_interprocessStringFromValue (const MyType value)
 Serializes a MyType value to a JSON-formatted string, in a format that will allow another process to unserialize it.
 
void MyType_retain (const MyType value)
 Increments the reference count of a value or its fields, if needed.
 
void MyType_release (const MyType value)
 Decrements the reference count of a value or its fields, if needed.
 

Function Documentation

struct json_object* MyType_interprocessJsonFromValue ( const MyType  value)
read

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_valueFromJson() needs to handle both the format returned by this function and the format returned by MyType_jsonFromValue().

This function is optional.

Parameters
valueThe value to serialize. May be null.
Returns
A JSON-C object. It should have a format accepted by MyType_valueFromJson().
See Also
VuoImage
char* MyType_interprocessStringFromValue ( 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_interprocessJsonFromValue().

This function is automatically generated by the Vuo compiler (but only if MyType_interprocessJsonFromValue() exists). Do not implement it. If this function needs to be called by MyType or other code, then declare it in MyType.

Parameters
valueThe value to serialize.
Returns
A JSON-formatted string representation of the value. The caller is responsible for freeing the string.
json_object* MyType_jsonFromValue ( const MyType  value)

Serializes a MyType value to a JSON-C object.

This function is required.

Parameters
valueThe value to serialize. May be null.
Returns
A JSON-C object. It should have a format accepted by MyType_valueFromJson().
void MyType_release ( const MyType  value)

Decrements the reference count of a value or its fields, if needed.

  • If MyType is a pointer, this function calls VuoRelease() on value.
  • If MyType is a struct, this function calls VuoRelease() on each field of value that is a pointer.
  • Otherwise, this function does nothing.

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.

  • If MyType is a pointer, this function calls VuoRetain() on value.
  • If MyType is a struct, this function calls VuoRetain() on each field of value that is a pointer.
  • Otherwise, this function does nothing.

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.

char* MyType_stringFromValue ( const MyType  value)

Serializes a MyType value to a JSON-formatted string.

Calls MyType_jsonFromValue().

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.

Parameters
valueThe value to serialize.
Returns
A JSON-formatted string representation of the value. The caller is responsible for freeing the string.
char* MyType_summaryFromValue ( const MyType  value)

Returns a brief description of a value.

This function is required.

Parameters
valueThe value to summarize. May be null.
Returns
The summary. It should be heap-allocated; the caller is responsible for freeing it.
MyType MyType_valueFromJson ( json_object *  js)

Creates a new MyType value by unserializing a JSON-C object.

This function is required.

Parameters
jsA JSON-C object from MyType_jsonFromValue() (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.
Returns
The unserialized value. For heap-allocated types, this function should register the value with VuoRegister().
MyType MyType_valueFromString ( const char *  str)

Creates a new MyType value by unserializing a JSON-formatted string.

Calls MyType_valueFromJson().

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.

Parameters
strA JSON-formatted string.
Returns
The unserialized value, registered with the reference-counting system if needed.