HelpWizard Pages ReferenceManual1 C/en
Zur Navigation springen
Zur Suche springen
Reference Manual C API (Normal Pins)[Bearbeiten]
Input
These functions will report an error, if the pin has no value.
- long longValue(inputPinName)
fetch an integer value from an integer typed input pin; reports an error, if there is no value.
- double doubleValue(inputPinName)
ditto for Float typed pins. Notice, that expecco (and other languages) represents all floating point numbers internally as double precision IEEE floats. Even though the type is called Float.
- bool_t booleanValue(inputPinName)
ditto for Boolean typed pins.
- char* stringValue(inputPinName)
ditto for String typed pins.
- jsonObject jsonValue(inputPinName)
retrieve any value which can be represented in JSON (i.e. may not have pointers in it).
- void* pointerValue(inputPinName)
fetch a pointer. This pointer MUST have been generated in a previous action (in the same bridge), and been sent to expecco viaputPointer()
.
Input with Default
These functions will return a default (zero or NULL), if the pin has no value.
- long longValueIfPresent(inputPinName)
if the input pin has a value, fetch it; otherwise returns 0
- double doubleValueIfPresent(inputPinName)
if the input pin has a value, fetch it; otherwise returns 0.0
- bool_t booleanValueIfPresent(inputPinName)
if the input pin has a value, fetch it; otherwise returns 0 (false)
- char* stringValueIfPresent(inputPinName)
if the input pin has a value, fetch it; otherwise returns NULL
- void* pointerValueIfPresent(inputPinName)
if the input pin has a value, fetch it; otherwise returns NULL
Input with Alternative
These functions will return a specific alternative value if the pin has no value.
- long longValueIfAbsent(inputPinName, long defaultValue)
if the input pin has a value, fetch it; otherwise returns defaultValue.
- long doubleValueIfAbsent(inputPinName, double defaultValue)
ditto for doubles.
- long booleanValueIfAbsent(inputPinName, bool_t defaultValue)
ditto for booleans.
- long pointerValueIfAbsent(inputPinName, void* defaultValue)
ditto for pointers.
Testing
- bool_t hasValue(inputPinName)
true if the input pin has a value; false if not
Output
- void putLong(outputPinName, long value)
send an integer (long) value to the output pin. The output pin's type must be compatible.
- void putDouble(outputPinName double value)
send a double value to the output pin
- void putBoolean(outputPinName bool_t value)
ditto for booleans
- void putString(outputPinName char* value)
ditto for strings
- void putBytes(outputPinName unsigned char* bytes, int len)
ditto for byte data. The pin's type can be ByteArray or a C-struct type.
- void putJSON(outputPinName jsonObject value)
ditto for a json object
- void putPointer(outputPinName void* pointer)
send a pointer to the output pin, which must be of type Any, Handle or a C-struct type. The pointer is treated as an opaque handle by expecco, and can be sent to an input pin of another C action (which must of course execute on the same bridge). The receiving action should fetch it via pointerValue() from its input pin.