Vuo 2.4.4
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.
 
#define MyType_OVERRIDES_INTERPROCESS_SERIALIZATION
 Tells the Vuo compiler that MyType_getInterprocessJson is defined, so that it can in turn define VuoList_MyType_getInterprocessJson.
 
#define MyType_SUPPORTS_COMPARISON
 Tells the Vuo compiler that MyType_areEqual and MyType_isLessThan are defined, so that it can enable functionality in VuoList_MyType that depends on those functions.
 

Functions

MyType MyType_makeFromJson (json_object *js)
 Creates a new MyType value by unserializing a JSON-C object.
 
json_object * MyType_getJson (const MyType value)
 Serializes a MyType value to a JSON-C object.
 
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.
 
VuoList_MyType MyType_getAllowedValues (void)
 Returns a list of values that instances of this type can have.
 
char * MyType_getSummary (const MyType value)
 Returns a brief description of a value.
 
bool MyType_areEqual (const MyType a, const MyType b)
 Returns true if a and b are equivalent.
 
bool MyType_isLessThan (const MyType a, const MyType b)
 Returns true if a should come before b when putting types in order from least to greatest.
 
char * MyType_getString (const MyType value)
 Serializes a MyType value to a JSON-formatted string.
 
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.
 
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.
 

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 48 of file type.h.