CMSDK
2.0.1
|
Public Member Functions | |
PsyAPI (PsySpace *space) | |
~PsyAPI () | |
bool | setAutoDelete (bool autodel) |
bool | isRunning () |
bool | shouldContinue () |
bool | getModuleName (char *name, uint32 maxSize) |
std::string | getCommandlineBasedir () |
bool | setCommandlineBasedir (const char *cmdlineBasedir) |
std::string | getModuleName () |
std::string | getOtherModuleName (uint32 id) |
uint32 | getInputQueueSize () |
std::string | typeToText (PsyType type) |
std::string | contextToText (PsyContext context) |
bool | getCurrentScriptLanguage (char *language, uint32 maxSize) |
bool | getCurrentScript (char *script, uint32 maxSize) |
bool | getCurrentScriptFilename (char *filename, uint32 maxSize) |
std::string | getCurrentScriptLanguage () |
std::string | getCurrentScript () |
std::string | getCurrentScriptFilename () |
std::set< std::string > | getCurrentPostNames () |
bool | hasCurrentSignalName (const char *name) |
bool | hasCurrentQueryName (const char *name) |
bool | hasCurrentRetrieveName (const char *name) |
bool | hasCurrentPostName (const char *name) |
DataMessage * | waitForNewMessage (uint32 ms) |
std::string | getCurrentTriggerName () |
PsyContext | getCurrentTriggerContext () |
DataMessage * | waitForNewMessage (uint32 ms, const char *&triggerName) |
uint64 | getCurrentMessageReceiveTime () |
int32 | postOutputMessage (const char *postName=NULL, DataMessage *msg=NULL) |
int32 | postOutputMessage (PsyType msgType, DataMessage *msg=NULL) |
bool | emitSignal (const char *name, DataMessage *msg=NULL) |
DataMessage * | waitForSignal (const char *name, uint32 timeout, uint64 lastReceivedTime=0) |
DataMessage * | retrieveAllSystemIDs () |
bool | addSubscription (const char *xml) |
bool | addPsyProbeCustomView (const char *name, const char *templateURL) |
bool | removePsyProbeCustomView (const char *name) |
bool | setPrivateData (const char *name, const char *data, uint64 size, const char *mimetype=NULL) |
uint64 | getPrivateDataSize (const char *name) |
char * | getPrivateDataCopy (const char *name, uint64 &size) |
bool | getPrivateData (const char *name, char *data, uint64 maxSize) |
bool | deletePrivateData (const char *name) |
bool | createParameter (const char *name, const char *val, const char *defaultValue=NULL) |
bool | createParameter (const char *name, const char *val, uint32 count, uint32 defaultIndex) |
bool | createParameter (const char *name, std::vector< std::string > values, const char *defaultValue=NULL) |
bool | createParameter (const char *name, int64 *val, uint32 count, uint32 defaultIndex) |
bool | createParameter (const char *name, std::vector< std::string > values, int64 defaultValue) |
bool | createParameter (const char *name, std::vector< int64 > values, int64 defaultValue=0) |
bool | createParameter (const char *name, float64 *val, uint32 count, uint32 defaultIndex) |
bool | createParameter (const char *name, std::vector< std::string > values, float64 defaultValue) |
bool | createParameter (const char *name, std::vector< float64 > values, float64 defaultValue=0) |
bool | createParameter (const char *name, int64 val, int64 min=0, int64 max=0, int64 interval=0) |
bool | createParameter (const char *name, float64 val, float64 min=0, float64 max=0, float64 interval=0) |
bool | hasParameter (const char *name) |
bool | deleteParameter (const char *name) |
uint8 | getParameterDataType (const char *name) |
uint32 | getParameterValueSize (const char *name) |
bool | getParameter (const char *name, char *val, uint32 maxSize) |
std::string | getParameterString (const char *name) |
bool | getParameterAsBool (const char *name) |
int64 | getParameterInt (const char *name) |
float64 | getParameterFloat (const char *name) |
bool | getParameter (const char *name, int64 &val) |
bool | getParameter (const char *name, float64 &val) |
bool | setParameter (const char *name, const char *val) |
bool | setParameter (const char *name, int64 val) |
bool | setParameter (const char *name, float64 val) |
bool | resetParameter (const char *name) |
bool | tweakParameter (const char *name, int32 tweak) |
uint8 | retrieve (std::list< DataMessage *> &result, const char *name, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000) |
uint8 | retrieveTimeParam (std::list< DataMessage *> &result, const char *name, uint64 startTime, uint64 endTime=0, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000) |
uint8 | retrieveStringParam (std::list< DataMessage *> &result, const char *name, const char *startString, const char *endString=NULL, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000) |
uint8 | retrieveIntegerParam (std::list< DataMessage *> &result, const char *name, int64 startInteger, int64 endInteger=INT64_NOVALUE, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000) |
uint8 | retrieveFloatParam (std::list< DataMessage *> &result, const char *name, float64 startFloat, float64 endFloat=FLOAT64_NOVALUE, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000) |
uint8 | retrieve (std::list< DataMessage *> &result, RetrieveSpec *spec, uint32 timeout=5000) |
uint8 | queryCatalog (char **result, uint32 &resultsize, const char *name, const char *query, const char *operation=NULL, const char *data=NULL, uint32 datasize=0, uint32 timeout=5000) |
uint8 | queryCatalog (DataMessage **resultMsg, const char *name, DataMessage *msg, uint32 timeout=5000) |
uint8 | queryRemoteCatalog (DataMessage **resultMsg, const char *componentName, const char *ipAddress, uint16 port, DataMessage *msg, uint32 timeout=5000) |
uint8 | queryRemoteCatalog (DataMessage **resultMsg, const char *componentName, uint32 ipAddress, uint16 port, DataMessage *msg, uint32 timeout=5000) |
uint8 | queryRemoteCatalog (DataMessage **resultMsg, uint32 &chosenAddress, const char *componentName, uint32 *ipAddresses, uint32 numAddresses, uint16 port, DataMessage *msg, uint32 timeout=5000) |
bool | queryReply (uint32 id, uint8 status, char *data, uint32 size, uint32 count) |
bool | queryReply (uint32 id, uint8 status, DataMessage *msg=NULL) |
bool | logPrint (uint8 level, const char *formatstring,...) |
Static Public Member Functions | |
static PsyAPI * | fromPython (unsigned long long ptr) |
static const char * | fromPythonAddressOf (unsigned long long ptr) |
Static Public Attributes | |
static struct PsyType | CTRL_SYSTEM_READY |
static struct PsyType | CTRL_PROCESS_INITIALISE |
static struct PsyType | CTRL_PROCESS_GREETING |
static struct PsyType | CTRL_PROCESS_SHUTDOWN |
static struct PsyType | CTRL_CONTEXT_CHANGE |
static struct PsyType | CTRL_SYSTEM_SHUTDOWN |
static struct PsyType | CTRL_SYSTEM_SHUTTINGDOWN |
static struct PsyType | CTRL_TRIGGER |
static struct PsyType | CTRL_QUERY |
static struct PsyType | CTRL_QUERY_REPLY |
static struct PsyType | CTRL_PULLCOMPONENTDATA |
static struct PsyType | CTRL_CREATECUSTOMPAGE |
static struct PsyType | CTRL_ADDSUBSCRIPTION |
static struct PsyType | CTRL_RETRIEVESYSTEMIDS |
static struct PsyType | CTRL_INTERSYSTEM_QUERY |
static struct PsyType | CTRL_INTERSYSTEM_QUERY_REPLY |
Friends | |
class | PsySpace |
cmlabs::PsyAPI::PsyAPI | ( | PsySpace * | space | ) |
cmlabs::PsyAPI::~PsyAPI | ( | ) |
Destructor for the PsyAPI
bool cmlabs::PsyAPI::addPsyProbeCustomView | ( | const char * | name, |
const char * | templateURL | ||
) |
Add a custom module view tab for the PsyProbe web interface by providing a template file
name | name of the custom module view tab |
templateURL | The path to the template file |
bool cmlabs::PsyAPI::addSubscription | ( | const char * | xml | ) |
This function adds triggers and posts to an existing registration
xml | <registration name="modulename"><trigger.../>...<post.../></registration> |
std::string cmlabs::PsyAPI::contextToText | ( | PsyContext | context | ) |
Get textual representation of the context
context | context as PsyContext object |
|
inline |
Creates a new string parameter
name | name of the parameter |
val | value of the parameter |
defaultValue | default value when resetting parameter, NULL if val should be used |
|
inline |
Creates a new string list parameter with room for count entries
name | name of the parameter |
val | value array of the parameter, separed by binary \0 |
count | number of entries in the array |
defaultIndex | an int value that sets the default index in the list |
|
inline |
Creates a new string parameter with a list of values
name | name of the parameter |
values | vector of values of the parameter |
defaultValue | default value or NULL for the first entry |
|
inline |
Creates a new integer list parameter with room for count entries
name | name of the parameter |
val | array of values of the parameter |
count | number of entries in the array |
defaultIndex | an int value that sets the default index in the list |
|
inline |
Creates a new String parameter with list of integer values (?)
name | name of the parameter |
values | vector with values of the parameter |
defaultValue | default as int |
|
inline |
Creates a new integer parameter with list of values
name | name of the parameter |
values | vector of values of the parameter |
defaultValue | default is 0 |
|
inline |
Creates a new float parameter
name | name of the parameter |
val | array of value of the parameter |
defaultIndex | an int value that sets the default index in the list |
|
inline |
Creates a new string parameter with list of float values (?)
name | name of the parameter |
values | vector of values of the parameter |
defaultValue | float value as default |
|
inline |
Creates a new float parameter with list of float values (?)
name | name of the parameter |
values | vector of values of the parameter |
defaultValue | default is 0 |
|
inline |
Creates a new integer parameter
name | name of the parameter |
val | value of the parameter |
min | the minimum value |
max | the maximum value interval limit, amount to jump on every tweak |
|
inline |
Creates a new float parameter with min, max and interval limits for allowed values
name | name of the parameter |
val | value of the parameter |
min | minimum value |
max | maximum value interval limit, amount to jump on every tweak |
|
inline |
Deletes a named parameter
name | name of the parameter |
|
inline |
Deletes a private data chunk by name.
name | the name of the chunk to be deleted |
bool cmlabs::PsyAPI::emitSignal | ( | const char * | name, |
DataMessage * | msg = NULL |
||
) |
This function call triggers the sending of a signal by name. If no message is provided an empty one will be created.
name | name of the signal to be sent |
msg | message to be sent, empty message if NULL |
|
static |
Internal use only
std::string cmlabs::PsyAPI::getCommandlineBasedir | ( | ) |
Get the base dir that Psyclone is running from
uint64 cmlabs::PsyAPI::getCurrentMessageReceiveTime | ( | ) |
Get current message receive time
std::set< std::string > cmlabs::PsyAPI::getCurrentPostNames | ( | ) |
Get a list of post names currently active - i.e. the post names that can be used right now
bool cmlabs::PsyAPI::getCurrentScript | ( | char * | script, |
uint32 | maxSize | ||
) |
Internal use only
std::string cmlabs::PsyAPI::getCurrentScript | ( | ) |
Internal use only
bool cmlabs::PsyAPI::getCurrentScriptFilename | ( | char * | filename, |
uint32 | maxSize | ||
) |
Internal use only
std::string cmlabs::PsyAPI::getCurrentScriptFilename | ( | ) |
Internal use only
bool cmlabs::PsyAPI::getCurrentScriptLanguage | ( | char * | language, |
uint32 | maxSize | ||
) |
Internal use only
std::string cmlabs::PsyAPI::getCurrentScriptLanguage | ( | ) |
Internal use only
PsyContext cmlabs::PsyAPI::getCurrentTriggerContext | ( | ) |
Get the context of the current trigger, just retrieved using waitForNewMessage()
std::string cmlabs::PsyAPI::getCurrentTriggerName | ( | ) |
Get the name of the current trigger, just retrieved using waitForNewMessage()
uint32 cmlabs::PsyAPI::getInputQueueSize | ( | ) |
Get the size of the input queue, i.e. how many unprocessed trigger messages waiting to be processed
bool cmlabs::PsyAPI::getModuleName | ( | char * | name, |
uint32 | maxSize | ||
) |
Get the name of the module written into the memory of name and return size
name | the chunk of memory that the name of the module will be written into |
maxSize | the size of the memory chunk of tha name parameter |
std::string cmlabs::PsyAPI::getModuleName | ( | ) |
Get the module name
std::string cmlabs::PsyAPI::getOtherModuleName | ( | uint32 | id | ) |
Get the name of another module by id
id | the id of the other module |
|
inline |
Read string parameter into existing data chunk val, maximum size maxSize.
name | name of the parameter |
val | value of the parameter |
maxSize | maximal size of the parameter to be read |
|
inline |
Read integer parameter value
name | name of the parameter |
val | value of the parameter |
|
inline |
Read float parameter value
name | name of the parameter |
val | value of the parameter |
|
inline |
Read and interpret value of parameter by name as boolean True: String 'Yes', Integer and Float non-zero False: String not 'Yes', Integer and Float zero
name | name of the parameter |
|
inline |
Gets the parameter type
#define PARAM_STRING 1
#define PARAM_INTEGER 2
#define PARAM_FLOAT 3
#define PARAM_STRING_COLL 4
#define PARAM_INTEGER_COLL 5
#define PARAM_FLOAT_COLL 6
#define PARAM_TYPE_COLL 7
name | name of the parameter |
|
inline |
Read and return value of parameter by name
name | name of the parameter |
|
inline |
Read and return value of parameter by name
name | name of the parameter |
|
inline |
Read and return value of parameter by name
name | name of the parameter |
|
inline |
Return the amount of memory in bytes used by the parameter
name | name of the parameter |
|
inline |
Reads a private chunk from the system into existing data space, maximum size is maxSize.
name | name of the data chunk |
data | pointer to an already allocated memory chunk |
maxSize | maximum size of the already allocated memory chunk |
|
inline |
Returns a new data chunk copy of a private entry, with the size written into size.
name | name of the data chunk |
size | memory size of the data returned |
|
inline |
This returns the size of the private data chunk previously saved by the crank.
name | name of the data chunk |
bool cmlabs::PsyAPI::hasCurrentPostName | ( | const char * | name | ) |
Check to see if the post name is currently active - i.e. can this post be used right now
bool cmlabs::PsyAPI::hasCurrentQueryName | ( | const char * | name | ) |
Check to see if the query name is currently active - i.e. can this query be used right now
bool cmlabs::PsyAPI::hasCurrentRetrieveName | ( | const char * | name | ) |
Check to see if the retrieve name is currently active - i.e. can this retrieve be used right now
bool cmlabs::PsyAPI::hasCurrentSignalName | ( | const char * | name | ) |
Check to see if the signal name is currently active - i.e. can this signal be used right now
|
inline |
Checks if a named parameter exists
name | name of the parameter |
bool cmlabs::PsyAPI::isRunning | ( | ) |
Internal use only
int32 cmlabs::PsyAPI::postOutputMessage | ( | const char * | postName = NULL , |
DataMessage * | msg = NULL |
||
) |
The crank uses this function to post messages. The actual message posted will depend on the spec post entries. If no postName is provided then all active post entries will be used and one copy of the message posted per post entry. If no message is provided an empty message will be used instead. If no active posts match zero or a negative integer is returned, otherwise the number of messages sent is returned. Negative values indicate
POST_FAILED -1 Error occurred while trying to post the message
POST_NOSPEC -2 The crank tried to post a message before a trigger arrived
POST_OUTOFCONTEXT -3 The crank is no longer active because the context has changed and is no longer active
postName | name of the Post. If none is provided then all active post entries will be used and one copy of the message posted per post entry. |
msg | message. If none is provided an empty message will be used instead. |
int32 cmlabs::PsyAPI::postOutputMessage | ( | PsyType | msgType, |
DataMessage * | msg = NULL |
||
) |
The crank uses this function to post messages. The actual message posted will depend on the spec post entries. If no postName is provided then all active post entries will be used and one copy of the message posted per post entry. If no message is provided an empty message will be used instead. If no active posts match zero or a negative integer is returned, otherwise the number of messages sent is returned. Negative values indicate
POST_FAILED -1 Error occurred while trying to post the message
POST_NOSPEC -2 The crank tried to post a message before a trigger arrived
POST_OUTOFCONTEXT -3 The crank is no longer active because the context has changed and is no longer active
msgType | msg type of the Post. If none is provided then all active post entries will be used and one copy of the message posted per post entry. |
msg | message. If none is provided an empty message will be used instead. |
uint8 cmlabs::PsyAPI::queryCatalog | ( | char ** | result, |
uint32 & | resultsize, | ||
const char * | name, | ||
const char * | query, | ||
const char * | operation = NULL , |
||
const char * | data = NULL , |
||
uint32 | datasize = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to send a query to another module or catalog by name. The query details are provided in the module spec by name.
result | a bucket parameter filled by the function. |
resultsize | this value will be filled in with the output size of the answer to the query |
query | the actual query sent to the catalog |
name | name of the query defined in the PsySpec |
operation | specify the custom operation by name (example could be 'read' or 'write' for the FileCatalog) |
data | provide optional data to send to as part of the query (example could be the data to write to a file for the FileCatalog) |
datasize | size of the optional data |
timeout | if no reply is retrieved after this time, NULL is returned |
uint8 cmlabs::PsyAPI::queryCatalog | ( | DataMessage ** | resultMsg, |
const char * | name, | ||
DataMessage * | msg, | ||
uint32 | timeout = 5000 |
||
) |
Used by a module to send a query to another module or catalog by name. The query details are provided in the message parameter and will not require or use any data from the PsySpec.
result | the reply message, if one is returned. |
name | name of the query defined in the PsySpec |
msg | the msg to be sent to the catalog as the query input |
timeout | if no reply is retrieved after this time, NULL is returned |
uint8 cmlabs::PsyAPI::queryRemoteCatalog | ( | DataMessage ** | resultMsg, |
const char * | componentName, | ||
const char * | ipAddress, | ||
uint16 | port, | ||
DataMessage * | msg, | ||
uint32 | timeout = 5000 |
||
) |
Used by a module to send a query to a module or catalog by name in a different Psyclone system. Will not require or use any data from the PsySpec.
result | the reply message, if one is returned. |
componentName | name of the component to be queried in the remote system |
ipAddress | IP address of the remote system in text |
port | main Psyclone port of the remote system |
msg | the msg to be sent to the catalog as the query input |
timeout | if no reply is retrieved after this time, NULL is returned |
uint8 cmlabs::PsyAPI::queryRemoteCatalog | ( | DataMessage ** | resultMsg, |
const char * | componentName, | ||
uint32 | ipAddress, | ||
uint16 | port, | ||
DataMessage * | msg, | ||
uint32 | timeout = 5000 |
||
) |
Used by a module to send a query to a module or catalog by name in a different Psyclone system. Will not require or use any data from the PsySpec.
result | the reply message, if one is returned. |
componentName | name of the component to be queried in the remote system |
ipAddress | IP address of the remote system in UINT32 format |
port | main Psyclone port of the remote system |
msg | the msg to be sent to the catalog as the query input |
timeout | if no reply is retrieved after this time, NULL is returned |
uint8 cmlabs::PsyAPI::queryRemoteCatalog | ( | DataMessage ** | resultMsg, |
uint32 & | chosenAddress, | ||
const char * | componentName, | ||
uint32 * | ipAddresses, | ||
uint32 | numAddresses, | ||
uint16 | port, | ||
DataMessage * | msg, | ||
uint32 | timeout = 5000 |
||
) |
Used by a module to send a query to a module or catalog by name in a different Psyclone system. Will not require or use any data from the PsySpec.
result | the reply message, if one is returned. |
chosenAddress | if set >0 this address will be attempted first, will always return the index of the first working address, if successful |
componentName | name of the component to be queried in the remote system |
ipAddresses | list of IP addresses of the remote system in UINT32 format |
numAddresses | number of addresses presented |
port | main Psyclone port of the remote system |
msg | the msg to be sent to the catalog as the query input |
timeout | if no reply is retrieved after this time, NULL is returned |
bool cmlabs::PsyAPI::queryReply | ( | uint32 | id, |
uint8 | status, | ||
char * | data, | ||
uint32 | size, | ||
uint32 | count | ||
) |
Used by a module to reply to an incoming query by id. Status can be
#define QUERY_FAILED 1
#define QUERY_TIMEOUT 2
#define QUERY_NAME_UNKNOWN 3
#define QUERY_COMPONENT_UNKNOWN 4
#define QUERY_QUERYFAILED 5
#define QUERY_SUCCESS 6
#define QUERY_NOT_AVAILABLE 7
Binary reply data of size size can be added and a count can indicate the number of entries in the data chunk.
id | id of the incoming query to reply to |
status | see description |
data | optional binary data to reply with |
size | size of optional binary data |
count | optional resulting count for operation, if appropriate |
bool cmlabs::PsyAPI::queryReply | ( | uint32 | id, |
uint8 | status, | ||
DataMessage * | msg = NULL |
||
) |
Used by a module to send a message as a reply to an incoming query
id | id of the incoming query to reply to |
status | see description of queryReply(uint32 id, uint8 status, char* data, uint32 size, uint32 count); |
msg |
|
inline |
Remove a custom module view tab for the PsyProbe web interface
name | name of the custom view |
|
inline |
Reset parameter to its default (or initial) value
name | name of the parameter |
uint8 cmlabs::PsyAPI::retrieve | ( | std::list< DataMessage *> & | result, |
const char * | name, | ||
uint32 | maxcount = 0 , |
||
uint32 | maxage = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name. maxcount and maxage can be provided to add to the spec details.
result | a bucket parameter filled by the function. A list of messages. |
name | name of the messages to be retrieved |
maxcount | the maximal number of messages to be retrieved |
maxage | the maximal age of the messages to be retrieved |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
uint8 cmlabs::PsyAPI::retrieve | ( | std::list< DataMessage *> & | result, |
RetrieveSpec * | spec, | ||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name.
result | a bucket parameter filled by the function. A list of messages. |
spec | the module spec with retrieve details |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
|
inline |
This function retrieves all names for types, contexts and components
uint8 cmlabs::PsyAPI::retrieveFloatParam | ( | std::list< DataMessage *> & | result, |
const char * | name, | ||
float64 | startFloat, | ||
float64 | endFloat = FLOAT64_NOVALUE , |
||
uint32 | maxcount = 0 , |
||
uint32 | maxage = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name. maxcount and maxage can be provided to add to the spec details.
result | a bucket parameter filled by the function. A list of messages. |
name | name of the whiteboard defined in the PsySpec |
startFloat | this value marks the beginning of the selection of values that the functions shall return |
endFloat | this value marks the end of the selection of values that the functions shall return |
maxcount | the maximal number of messages to be retrieved |
maxage | the maximal age of the messages to be retrieved |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
uint8 cmlabs::PsyAPI::retrieveIntegerParam | ( | std::list< DataMessage *> & | result, |
const char * | name, | ||
int64 | startInteger, | ||
int64 | endInteger = INT64_NOVALUE , |
||
uint32 | maxcount = 0 , |
||
uint32 | maxage = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name. startInteger and endInteger can be provided to add to the spec details.
result | a bucket parameter filled by the function. A list of messages. |
name | name of the whiteboard defined in the PsySpec |
startInteger | this value marks the beginning of the selection of values that the functions shall return |
endInteger | this value marks the end of the selection of values that the functions shall return |
maxcount | the maximal number of messages to be retrieved |
maxage | the maximal age of the messages to be retrieved |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
uint8 cmlabs::PsyAPI::retrieveStringParam | ( | std::list< DataMessage *> & | result, |
const char * | name, | ||
const char * | startString, | ||
const char * | endString = NULL , |
||
uint32 | maxcount = 0 , |
||
uint32 | maxage = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name. startTime and endTime can be provided to add to the spec details.
result | a bucket parameter filled by the function. A list of messages. |
name | name of the whiteboard defined in the PsySpec |
startString | this String marks the beginning of the selection of Strings that the functions shall return |
endString | this String marks the end of the selection of Strings that the functions shall return |
maxcount | the maximal number of messages to be retrieved |
maxage | the maximal age of the messages to be retrieved |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
uint8 cmlabs::PsyAPI::retrieveTimeParam | ( | std::list< DataMessage *> & | result, |
const char * | name, | ||
uint64 | startTime, | ||
uint64 | endTime = 0 , |
||
uint32 | maxcount = 0 , |
||
uint32 | maxage = 0 , |
||
uint32 | timeout = 5000 |
||
) |
Used by a module to retrieve messages from a whiteboard. The retrieve details are provided in the module spec by name. maxcount and maxage can be provided to add to the spec details.
result | a bucket parameter filled by the function. A list of messages. |
name | name of the whiteboard defined in the PsySpec |
maxcount | the maximal number of messages to be retrieved |
maxage | the maximal age of the messages to be retrieved |
timeout | if no messages are retrieved after this time, NULL is returned (?) |
bool cmlabs::PsyAPI::setAutoDelete | ( | bool | autodel | ) |
Internal use only
bool cmlabs::PsyAPI::setCommandlineBasedir | ( | const char * | cmdlineBasedir | ) |
Internal use only
|
inline |
Set string parameter value
name | name of the parameter |
val | value of the parameter |
|
inline |
Set integer parameter value
name | name of the parameter |
val | value of the parameter |
|
inline |
Set float parameter value
name | name of the parameter |
val | value of the parameter |
|
inline |
The crank can use this function to store chunks of data centrally so it doesn't have to do it. This means that if the crank exits (or crashes) the data will still be available when it is triggered again.
name | name of the data chunk data the data to be stored |
size | memory size of the data |
bool cmlabs::PsyAPI::shouldContinue | ( | ) |
Check to see if crank should exit, needs to be checked regularly
|
inline |
Step up or down list or range parameter value. If list steps to next or previous value, if range adds or subtracts interval while staying in the min-max range.
name | name of the parameter |
tweak | number of steps to tweak, positive is upwards, negative is downwards |
std::string cmlabs::PsyAPI::typeToText | ( | PsyType | type | ) |
DataMessage * cmlabs::PsyAPI::waitForNewMessage | ( | uint32 | ms | ) |
This function waits for the next trigger message to arrive and if it did within the timeout (ms) the message is returned. The message is owned by the system and should never be deleted by the crank. If no message arrives within the timeout NULL is returned.
ms | the timeout |
DataMessage * cmlabs::PsyAPI::waitForNewMessage | ( | uint32 | ms, |
const char *& | triggerName | ||
) |
This function waits for the next trigger message to arrive and if it did within the timeout (ms) the message is returned and triggerName indicates the name of the trigger from the spec. The message is owned by the system and should never be deleted by the crank. If no message arrives within the timeout NULL is returned.
ms | the timeout |
triggerName | the name of the trigger from the spec returned |
DataMessage * cmlabs::PsyAPI::waitForSignal | ( | const char * | name, |
uint32 | timeout, | ||
uint64 | lastReceivedTime = 0 |
||
) |
This function waits for the next signal message to arrive and if it did within the timeout (ms) the message is returned and name indicates the name of the signal from the spec. The message is owned by the system and should never be deleted by the crank. If no message arrives within the timeout NULL is returned. If lastReceivedTime is set to a time value signals sent before this time are skipped, if not the next unread signal is returned.
name | name of the signal that is waited for |
timeout | time to be waited for signal to arrive |
lastReceivedTime | signals sent before this time are skipped |