Vuo 2.4.2
Loading...
Searching...
No Matches
Macros | Functions
type.h File Reference

Description

Prototypes for type implementations.

Definition in file type.h.

Go to the source code of this file.

Macros

#define VuoMakeRetainedFromString(valueAsString, type)
 Returns a new type instance initialized with the JSON-formatted const char *valueAsString. More...
 

Functions

MyType MyType_makeFromJson (json_object *js)
 Creates a new MyType value by unserializing a JSON-C object. More...
 
json_objectMyType_getJson (const MyType value)
 Serializes a MyType value to a JSON-C object. More...
 
struct json_objectMyType_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...
 
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...
 

Macro Definition Documentation

◆ VuoMakeRetainedFromString

#define VuoMakeRetainedFromString (   valueAsString,
  type 
)
Value:
({ \
json_object *js = valueAsString ? json_tokener_parse(valueAsString) : NULL; \
type variable = type ## _makeFromJson(js); \
type ## _retain(variable); \
json_object_put(js); \
variable; \
})

Returns a new type instance initialized with the JSON-formatted const char *valueAsString.

For heap-allocated types, the returned value has a retain count of 1.

Example:

Definition at line 47 of file type.h.