CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
PsyAPI.h
Go to the documentation of this file.
1
25#if !defined(_PSYAPI_H_)
26#define _PSYAPI_H_
27
28#include "MemoryManager.h"
29#include "PsyTime.h"
30#include "xml_parser.h"
31#include "DataMessage.h"
32#include "Subscriptions.h"
33#include "PsySpace.h"
34
38#define CRANKAPI_FAILED 1
39#define CRANKAPI_INUSE 2
40#define CRANKAPI_RUNNING 3
41#define CRANKAPI_IDLE 4
43
47#define POST_FAILED -1
48#define POST_NOSPEC -2
49#define POST_OUTOFCONTEXT -3
51
55#define QUERY_FAILED 1
56#define QUERY_TIMEOUT 2
57#define QUERY_NAME_UNKNOWN 3
58#define QUERY_COMPONENT_UNKNOWN 4
59#define QUERY_QUERYFAILED 5
60#define QUERY_SUCCESS 6
61#define QUERY_NOT_AVAILABLE 7
62#define QUERY_NOT_REACHABLE 8
64
65namespace cmlabs {
66
68#define LOG_COMPONENT 8
69
71typedef std::pair<DataMessage*, DataMessage*> TriggerAndMessage;
72
82class PsyAPI {
83 friend class PsySpace;
84public:
85
90 static struct PsyType CTRL_SYSTEM_READY;
97 static struct PsyType CTRL_TRIGGER;
99 static struct PsyType CTRL_QUERY;
100 static struct PsyType CTRL_QUERY_REPLY;
108
109 // ***************** Constructors *****************
110 // Create and destroy resources
111
121 PsyAPI(PsySpace* space);
129 ~PsyAPI();
130
138 static PsyAPI* fromPython(unsigned long long ptr);
140 static const char* fromPythonAddressOf(unsigned long long ptr);
141
145 bool setAutoDelete(bool autodel);
146
147 // ***************** System & Status *****************
148 // All system calls
149 // Get or set status info
150
154 bool isRunning();
155
178 bool shouldContinue();
185 bool getModuleName(char* name, uint32 maxSize);
190 std::string getCommandlineBasedir();
194 bool setCommandlineBasedir(const char* cmdlineBasedir);
200 std::string getModuleName();
206 std::string getOtherModuleName(uint32 id);
212 uint32 getInputQueueSize();
218 std::string typeToText(PsyType type);
224 std::string contextToText(PsyContext context);
228 bool getCurrentScriptLanguage(char* language, uint32 maxSize);
232 bool getCurrentScript(char* script, uint32 maxSize);
236 bool getCurrentScriptFilename(char* filename, uint32 maxSize);
240 std::string getCurrentScriptLanguage();
244 std::string getCurrentScript();
248 std::string getCurrentScriptFilename();
253 std::set<std::string> getCurrentPostNames();
254
259 bool hasCurrentSignalName(const char* name);
260
265 bool hasCurrentQueryName(const char* name);
266
271 bool hasCurrentRetrieveName(const char* name);
272
277 bool hasCurrentPostName(const char* name);
278
279 // ***************** Subscription *****************
280 // Get or delete current subscriptions
281 // Create new subscription
282 // *** Not implemented yet
283
284
285
286 // ***************** Tags *****************
287 // Create, destroy or get info about tags
288 // *** Not implemented yet
289
290
291
292
293 // ***************** Messaging *****************
337 DataMessage* waitForNewMessage(uint32 ms);
338
349 std::map<std::string, DataMessage*> waitForNewMessageGroup(uint32 ms, std::string& groupName);
350
351
357 std::string getCurrentTriggerName();
358
364
365
381 DataMessage* waitForNewMessage(uint32 ms, const char* &triggerName);
394
396
397 // Post output messages
435 int32 postOutputMessage(const char* postName = NULL, DataMessage* msg = NULL);
436
437 // Post output messages
452 int32 postOutputMessage(PsyType msgType, DataMessage* msg = NULL);
453
454
455 // ***************** Signals *****************
474 bool emitSignal(const char* name, DataMessage* msg = NULL);
500 DataMessage* waitForSignal(const char* name, uint32 timeout, uint64 lastReceivedTime = 0);
501
502
509 return space->manager->retrieveAllSystemIDs();
510 }
511
512
520 bool addSubscription(const char* xml);
521
522
523 // ***************** PsyProbe plugins *****************
533 bool addPsyProbeCustomView(const char* name, const char* templateURL);
542 bool removePsyProbeCustomView(const char* name) {
543 return addPsyProbeCustomView(name, "");
544 }
545
546 // ***************** Own Data *****************
547 // Load, save or delete own persistent data
575
576 bool setPrivateData(const char* name, const char* data, uint64 size, const char* mimetype = NULL) {
577 return space->manager->componentMemory->setPrivateData(currentCompID, name, data, size, mimetype);
578 }
579
587 uint64 getPrivateDataSize(const char* name) {
588 return space->manager->componentMemory->getPrivateDataSize(currentCompID, name);
589 }
590
597 char* getPrivateDataCopy(const char* name, uint64 &size) {
598 return space->manager->componentMemory->getPrivateDataCopy(currentCompID, name, size);
599 }
600
610 bool getPrivateData(const char* name, char* data, uint64 maxSize) {
611 return space->manager->componentMemory->getPrivateData(currentCompID, name, data, maxSize);
612 }
613
621 bool deletePrivateData(const char* name) {
622 return space->manager->componentMemory->deletePrivateData(currentCompID, name);
623 }
624
625 // ***************** Own Parameters *****************
626 // Get, set, reset, create or destroy own parameters
649 bool createParameter(const char* name, const char* val, const char* defaultValue = NULL) {
650 return space->manager->componentMemory->createParameter(currentCompID, name, val, defaultValue);
651 }
652
663 bool createParameter(const char* name, const char* val, uint32 count, uint32 defaultIndex) {
664 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
665 }
666
676 bool createParameter(const char* name, std::vector<std::string> values, const char* defaultValue = NULL) {
677 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
678 }
679
690 bool createParameter(const char* name, int64* val, uint32 count, uint32 defaultIndex) {
691 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
692 }
693
703 bool createParameter(const char* name, std::vector<std::string> values, int64 defaultValue) {
704 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
705 }
706
716 bool createParameter(const char* name, std::vector<int64> values, int64 defaultValue = 0) {
717 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
718 }
719
730 bool createParameter(const char* name, float64* val, uint32 count, uint32 defaultIndex) {
731 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
732 }
733
743 bool createParameter(const char* name, std::vector<std::string> values, float64 defaultValue) {
744 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
745 }
746
756 bool createParameter(const char* name, std::vector<float64> values, float64 defaultValue = 0) {
757 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
758 }
759
771 bool createParameter(const char* name, int64 val, int64 min = 0, int64 max = 0, int64 interval = 0) {
772 return space->manager->componentMemory->createParameter(currentCompID, name, val, min, max, interval);
773 }
774
786 bool createParameter(const char* name, float64 val, float64 min = 0, float64 max = 0, float64 interval = 0) {
787 return space->manager->componentMemory->createParameter(currentCompID, name, val, min, max, interval);
788 }
789
797 bool hasParameter(const char* name) {
798 return space->manager->componentMemory->hasParameter(currentCompID, name);
799 }
800
808 bool deleteParameter(const char* name) {
809 return space->manager->componentMemory->deleteParameter(currentCompID, name);
810 }
811
833 uint8 getParameterDataType(const char* name) {
834 return space->manager->componentMemory->getParameterDataType(currentCompID, name);
835 }
836
844 uint32 getParameterValueSize(const char* name) {
845 return space->manager->componentMemory->getParameterValueSize(currentCompID, name);
846 }
847
857 bool getParameter(const char* name, char* val, uint32 maxSize) {
858 return space->manager->componentMemory->getParameter(currentCompID, name, val, maxSize);
859 }
860
868 std::string getParameterString(const char* name) {
869 return space->manager->componentMemory->getParameterString(currentCompID, name);
870 }
871
881 bool getParameterAsBool(const char* name) {
882 return space->manager->componentMemory->getParameterAsBool(currentCompID, name);
883 }
884
892 int64 getParameterInt(const char* name) {
893 return space->manager->componentMemory->getParameterInt(currentCompID, name);
894 }
895
903 float64 getParameterFloat(const char* name) {
904 return space->manager->componentMemory->getParameterFloat(currentCompID, name);
905 }
906
915 bool getParameter(const char* name, int64& val) {
916 return space->manager->componentMemory->getParameter(currentCompID, name, val);
917 }
918
927 bool getParameter(const char* name, float64& val) {
928 return space->manager->componentMemory->getParameter(currentCompID, name, val);
929 }
930
939 bool setParameter(const char* name, const char* val) {
940 return space->manager->componentMemory->setParameter(currentCompID, name, val);
941 }
942
951 bool setParameter(const char* name, int64 val) {
952 return space->manager->componentMemory->setParameter(currentCompID, name, val);
953 }
954
963 bool setParameter(const char* name, float64 val) {
964 return space->manager->componentMemory->setParameter(currentCompID, name, val);
965 }
966
974 bool resetParameter(const char* name) {
975 return space->manager->componentMemory->resetParameter(currentCompID, name);
976 }
977
987 bool tweakParameter(const char* name, int32 tweak) {
988 return space->manager->componentMemory->tweakParameter(currentCompID, name, tweak);
989 }
990
991 // ***************** Other Modules' Parameters *****************
992 // Get, set or reset other module's parameters
993 // *** Not implemented yet
994
995
996
997 // ***************** Queries *****************
998 // Query a Data storage devices (Whiteboard, Stream, Catalogue) for data
999 // Named queries in PsySpec may be used
1029 uint8 retrieve(std::list<DataMessage*> &result, const char* name, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1044 uint8 retrieveTimeParam(std::list<DataMessage*> &result, const char* name, uint64 startTime, uint64 endTime = 0, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1059 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);
1074 uint8 retrieveIntegerParam(std::list<DataMessage*> &result, const char* name, int64 startInteger, int64 endInteger = INT64_NOVALUE, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1089 uint8 retrieveFloatParam(std::list<DataMessage*> &result, const char* name, float64 startFloat, float64 endFloat = FLOAT64_NOVALUE, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1098 uint8 retrieve(std::list<DataMessage*> &result, RetrieveSpec* spec, uint32 timeout = 5000);
1099
1131 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);
1132
1159 uint8 queryCatalog(DataMessage** resultMsg, const char* name, DataMessage* msg, uint32 timeout = 5000);
1160
1177 uint8 queryRemoteCatalog(DataMessage** resultMsg, const char* componentName, const char* ipAddress, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1178
1191 uint8 queryRemoteCatalog(DataMessage** resultMsg, const char* componentName, uint32 ipAddress, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1192
1213 uint8 queryRemoteCatalog(DataMessage** resultMsg, uint32& chosenAddress, const char* componentName, uint32* ipAddresses, uint32 numAddresses, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1214
1244 bool queryReply(uint32 id, uint8 status, char* data, uint32 size, uint32 count);
1253 bool queryReply(uint32 id, uint8 status, DataMessage* msg = NULL);
1254
1255 // ***************** Performance *****************
1256 // For querying about performance
1257 // *** Not implemented yet
1258
1259
1260
1261 // ***************** Monitoring *****************
1262 // For providing custom data to monitoring tools
1263 // *** Not implemented yet
1264
1265
1266
1267 // ***************** Supervisor *****************
1268 // API for supervisor modules
1269 // *** Not implemented yet
1270
1271
1281 bool logPrint(int level, const char *formatstring, ... );
1282
1283private:
1284 PsySpace* space;
1285 utils::Mutex apiMutex;
1286 uint64 startedRunning;
1287 bool shouldContinueRunning;
1288 uint32 currentCrankID;
1289 uint32 currentCompID;
1290 uint32 msgReceivedCount;
1291 uint32 msgInputCount;
1292 uint32 msgSentCount;
1293 uint32 msgPostedCount;
1294 uint64 lastCPUTicks;
1295 uint64 lastWallTime;
1296 uint32 chainCPUTicks;
1297 uint32 chainWallTime;
1298 uint32 chainCount;
1299
1300 std::queue<TriggerAndMessage> inputQueue;
1301 utils::Semaphore inputQueueSemaphore;
1302
1303 bool autoDelete;
1304 DataMessage* currentTriggerMsg;
1305 DataMessage* currentMsg;
1306 std::map<std::string, DataMessage*> currentGroupMap; // T1.6: member messages of the current joined set (owned; freed on next wait)
1307 DataMessage* currentSignalMsg;
1308 TriggerSpec* currentTriggerSpec;
1309 char currentTriggerName[MAXKEYNAMELEN+1];
1310 char commandlineBasedir[MAXCOMMANDLINELEN + 1];
1311
1312 // Only called by PsySpace
1316 uint64 checkLastWaitForMessage();
1320 uint8 addInputTrigger(uint32 crankID, uint32 compID, DataMessage* trigger, DataMessage* msg);
1324 bool begin();
1328 bool finish();
1332 bool stop();
1333};
1334
1335} // namespace cmlabs
1336
1337#endif //_PSYAPI_H_
1338
The binary DataMessage container — the central data-exchange object of Psyclone/CMSDK.
Central shared-memory manager for a Psyclone node: master segment, per-subsystem shared maps and the ...
The PsySpace process/node context: the runtime container in which Psyclone components (cranks) live a...
CMSDK time: µs-resolution 64-bit timestamps and the Time Mapping Constant (TMC).
Subscription, trigger, retrieval, query, post and signal specifications — the declarative wiring of a...
#define FLOAT64_NOVALUE
Definition Types.h:81
#define INT64_NOVALUE
Definition Types.h:80
#define MAXKEYNAMELEN
Definition Utils.h:85
#define MAXCOMMANDLINELEN
Definition Utils.h:88
The central Psyclone data container: a self-contained binary message with typed, named user entries.
bool setAutoDelete(bool autodel)
Internal use only.
Definition PsyAPI.cpp:551
static struct PsyType CTRL_CONTEXT_CHANGE
Announces a system context change.
Definition PsyAPI.h:94
static struct PsyType CTRL_PROCESS_INITIALISE
Sent to a process to initialise it.
Definition PsyAPI.h:91
bool createParameter(const char *name, std::vector< std::string > values, float64 defaultValue)
Creates a new string parameter with list of float values (?).
Definition PsyAPI.h:743
static const char * fromPythonAddressOf(unsigned long long ptr)
Internal use only — debug helper returning a printable address string for a Python-held pointer.
Definition PsyAPI.cpp:76
PsyContext getCurrentTriggerContext()
Get the context of the current trigger, just retrieved using waitForNewMessage().
Definition PsyAPI.cpp:391
bool removePsyProbeCustomView(const char *name)
Remove a custom module view tab for the PsyProbe web interface.
Definition PsyAPI.h:542
bool deleteParameter(const char *name)
Deletes a named parameter.
Definition PsyAPI.h:808
PsyAPI(PsySpace *space)
Constructor from a PsySpace.
Definition PsyAPI.cpp:30
uint8 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.
Definition PsyAPI.cpp:875
bool createParameter(const char *name, const char *val, uint32 count, uint32 defaultIndex)
Creates a new string list parameter with room for count entries.
Definition PsyAPI.h:663
bool resetParameter(const char *name)
Reset parameter to its default (or initial) value.
Definition PsyAPI.h:974
bool tweakParameter(const char *name, int32 tweak)
Step up or down list or range parameter value.
Definition PsyAPI.h:987
bool isRunning()
Internal use only.
Definition PsyAPI.cpp:80
std::string getParameterString(const char *name)
Read and return value of parameter by name.
Definition PsyAPI.h:868
bool createParameter(const char *name, std::vector< std::string > values, int64 defaultValue)
Creates a new String parameter with list of integer values (?).
Definition PsyAPI.h:703
std::string contextToText(PsyContext context)
Get textual representation of the context.
Definition PsyAPI.cpp:258
static struct PsyType CTRL_PROCESS_SHUTDOWN
Orders a single process to shut down.
Definition PsyAPI.h:93
bool createParameter(const char *name, float64 *val, uint32 count, uint32 defaultIndex)
Creates a new float parameter.
Definition PsyAPI.h:730
uint8 retrieve(std::list< DataMessage * > &result, const char *name, uint32 maxcount=0, uint32 maxage=0, uint32 timeout=5000)
Retrieve stored messages from a whiteboard, by named <retrieve> spec entry.
Definition PsyAPI.cpp:778
int64 getParameterInt(const char *name)
Read and return value of parameter by name.
Definition PsyAPI.h:892
static struct PsyType CTRL_PULLCOMPONENTDATA
Requests component data from another node.
Definition PsyAPI.h:101
static struct PsyType CTRL_TRIGGER_GROUP
T1.6: wraps a <triggergroup> joined-set delivery (member map) to a component.
Definition PsyAPI.h:98
static PsyAPI * fromPython(unsigned long long ptr)
Internal use only.
Definition PsyAPI.cpp:72
bool addSubscription(const char *xml)
This function adds triggers and posts to an existing registration.
Definition PsyAPI.cpp:991
bool addPsyProbeCustomView(const char *name, const char *templateURL)
Add a custom module view tab for the PsyProbe web interface by providing a template file.
Definition PsyAPI.cpp:317
static struct PsyType CTRL_TRIGGER
Wraps a trigger delivery to a component.
Definition PsyAPI.h:97
~PsyAPI()
Destructor for the PsyAPI.
Definition PsyAPI.cpp:54
bool getParameter(const char *name, char *val, uint32 maxSize)
Read string parameter into existing data chunk val, maximum size maxSize.
Definition PsyAPI.h:857
std::string getCommandlineBasedir()
Get the base dir that Psyclone is running from.
Definition PsyAPI.cpp:106
int32 postOutputMessage(const char *postName=NULL, DataMessage *msg=NULL)
Post the crank's output according to the spec's post entries.
Definition PsyAPI.cpp:581
static struct PsyType CTRL_PROCESS_GREETING
Handshake from a newly joined process.
Definition PsyAPI.h:92
float64 getParameterFloat(const char *name)
Read and return value of parameter by name.
Definition PsyAPI.h:903
bool setPrivateData(const char *name, const char *data, uint64 size, const char *mimetype=NULL)
Store a named chunk of data centrally, in the system's shared component memory.
Definition PsyAPI.h:576
bool shouldContinue()
Check whether the crank should keep running, or exit its loop.
Definition PsyAPI.cpp:93
bool hasCurrentRetrieveName(const char *name)
Check to see if the retrieve name is currently active - i.e.
Definition PsyAPI.cpp:173
bool createParameter(const char *name, int64 val, int64 min=0, int64 max=0, int64 interval=0)
Creates a new integer parameter.
Definition PsyAPI.h:771
bool emitSignal(const char *name, DataMessage *msg=NULL)
Emit a signal by its spec name.
Definition PsyAPI.cpp:714
bool hasCurrentPostName(const char *name)
Check to see if the post name is currently active - i.e.
Definition PsyAPI.cpp:213
bool queryReply(uint32 id, uint8 status, char *data, uint32 size, uint32 count)
Used by a module to reply to an incoming query by id.
Definition PsyAPI.cpp:1210
static struct PsyType CTRL_SYSTEM_SHUTTINGDOWN
Broadcast while shutdown is in progress.
Definition PsyAPI.h:96
bool hasParameter(const char *name)
Checks if a named parameter exists.
Definition PsyAPI.h:797
std::map< std::string, DataMessage * > waitForNewMessageGroup(uint32 ms, std::string &groupName)
T1.6: Wait for the next <triggergroup> joined-set delivery from the input queue.
Definition PsyAPI.cpp:523
static struct PsyType CTRL_RETRIEVESYSTEMIDS
Requests the full id/name tables.
Definition PsyAPI.h:104
std::string getCurrentScript()
Internal use only.
Definition PsyAPI.cpp:147
static struct PsyType CTRL_QUERY_REPLY
Carries a query reply back to the asker.
Definition PsyAPI.h:100
bool setCommandlineBasedir(const char *cmdlineBasedir)
Internal use only.
Definition PsyAPI.cpp:110
std::string getOtherModuleName(uint32 id)
Get the name of another module by id.
Definition PsyAPI.cpp:124
DataMessage * waitForSignal(const char *name, uint32 timeout, uint64 lastReceivedTime=0)
Wait for a signal (latest-value broadcast) by its spec name.
Definition PsyAPI.cpp:746
bool setParameter(const char *name, int64 val)
Set integer parameter value.
Definition PsyAPI.h:951
static struct PsyType CTRL_SYSTEM_READY
Broadcast when the system has fully started.
Definition PsyAPI.h:90
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)
Send a query to another module or catalog by named <query> spec entry, receiving raw bytes back.
Definition PsyAPI.cpp:1131
uint32 getInputQueueSize()
Get the size of the input queue, i.e.
Definition PsyAPI.cpp:245
static struct PsyType CTRL_INTERSYSTEM_QUERY_REPLY
Reply from a different Psyclone system.
Definition PsyAPI.h:106
uint64 getCurrentMessageReceiveTime()
Get the time the current trigger (or, failing that, the current message) was received by the system,...
Definition PsyAPI.cpp:557
bool getParameter(const char *name, int64 &val)
Read integer parameter value.
Definition PsyAPI.h:915
bool setParameter(const char *name, float64 val)
Set float parameter value.
Definition PsyAPI.h:963
DataMessage * retrieveAllSystemIDs()
This function retrieves all names for types, contexts and components.
Definition PsyAPI.h:508
bool getPrivateData(const char *name, char *data, uint64 maxSize)
Reads a private chunk from the system into existing data space, maximum size is maxSize.
Definition PsyAPI.h:610
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)
Used by a module to retrieve messages from a whiteboard.
Definition PsyAPI.cpp:840
bool getParameterAsBool(const char *name)
Read and interpret value of parameter by name as boolean True: String 'Yes', Integer and Float non-ze...
Definition PsyAPI.h:881
DataMessage * waitForNewMessage(uint32 ms)
Wait for the next trigger message from the component's input queue.
Definition PsyAPI.cpp:382
static struct PsyType CTRL_SYSTEM_SHUTDOWN
Orders a full system shutdown.
Definition PsyAPI.h:95
uint8 queryRemoteCatalog(DataMessage **resultMsg, const char *componentName, const char *ipAddress, uint16 port, DataMessage *msg, uint32 timeout=5000)
Send a query to a component in a different Psyclone system by hostname/IP.
Definition PsyAPI.cpp:1075
bool logPrint(int level, const char *formatstring,...)
Write a printf-style entry to the component's log (and the console when level is below the logging th...
Definition PsyAPI.cpp:1231
bool createParameter(const char *name, std::vector< float64 > values, float64 defaultValue=0)
Creates a new float parameter with list of float values (?).
Definition PsyAPI.h:756
uint64 getPrivateDataSize(const char *name)
This returns the size of the private data chunk previously saved by the crank.
Definition PsyAPI.h:587
static struct PsyType CTRL_QUERY
Carries a query to a component/catalog.
Definition PsyAPI.h:99
bool setParameter(const char *name, const char *val)
Set string parameter value.
Definition PsyAPI.h:939
std::set< std::string > getCurrentPostNames()
Get a list of post names currently active - i.e.
Definition PsyAPI.cpp:226
bool createParameter(const char *name, float64 val, float64 min=0, float64 max=0, float64 interval=0)
Creates a new float parameter with min, max and interval limits for allowed values.
Definition PsyAPI.h:786
bool createParameter(const char *name, std::vector< std::string > values, const char *defaultValue=NULL)
Creates a new string parameter with a list of values.
Definition PsyAPI.h:676
static struct PsyType CTRL_ADDSUBSCRIPTION
Adds triggers/posts to a registration at runtime.
Definition PsyAPI.h:103
friend class PsySpace
Definition PsyAPI.h:83
bool createParameter(const char *name, std::vector< int64 > values, int64 defaultValue=0)
Creates a new integer parameter with list of values.
Definition PsyAPI.h:716
bool deletePrivateData(const char *name)
Deletes a private data chunk by name.
Definition PsyAPI.h:621
bool hasCurrentQueryName(const char *name)
Check to see if the query name is currently active - i.e.
Definition PsyAPI.cpp:200
std::string getCurrentTriggerName()
Get the name of the current trigger, i.e.
Definition PsyAPI.cpp:387
uint32 getParameterValueSize(const char *name)
Return the amount of memory in bytes used by the parameter.
Definition PsyAPI.h:844
std::string getCurrentScriptFilename()
Internal use only.
Definition PsyAPI.cpp:162
static struct PsyType CTRL_INTERSYSTEM_QUERY
Query crossing to a different Psyclone system.
Definition PsyAPI.h:105
std::string typeToText(PsyType type)
Get textual representation of the type.
Definition PsyAPI.cpp:254
bool createParameter(const char *name, const char *val, const char *defaultValue=NULL)
Creates a new string parameter.
Definition PsyAPI.h:649
uint8 getParameterDataType(const char *name)
Gets the parameter type.
Definition PsyAPI.h:833
char * getPrivateDataCopy(const char *name, uint64 &size)
Returns a newly allocated copy of a private data entry, with the size written into size.
Definition PsyAPI.h:597
bool createParameter(const char *name, int64 *val, uint32 count, uint32 defaultIndex)
Creates a new integer list parameter with room for count entries.
Definition PsyAPI.h:690
uint8 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.
Definition PsyAPI.cpp:910
std::string getModuleName()
Get the module name.
Definition PsyAPI.cpp:120
uint8 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.
Definition PsyAPI.cpp:806
bool hasCurrentSignalName(const char *name)
Check to see if the signal name is currently active - i.e.
Definition PsyAPI.cpp:186
static struct PsyType CTRL_CREATECUSTOMPAGE
Registers a custom PsyProbe view.
Definition PsyAPI.h:102
std::string getCurrentScriptLanguage()
Internal use only.
Definition PsyAPI.cpp:132
bool getParameter(const char *name, float64 &val)
Read float parameter value.
Definition PsyAPI.h:927
The runtime container (one OS process/node context) hosting Psyclone components.
Definition PsySpace.h:164
Recursive mutual-exclusion lock, optionally named for cross-process use.
Definition Utils.h:463
Counting semaphore, optionally named for cross-process use.
Definition Utils.h:519
std::pair< DataMessage *, DataMessage * > TriggerAndMessage
Pairing of a trigger message and its accompanying data message, as queued for a crank's input.
Definition PsyAPI.h:71
Hierarchical execution-context identifier.
Definition Types.h:284
Hierarchical message type identifier — the key used for publish/subscribe matching in Psyclone.
Definition Types.h:123
Specification of a whiteboard retrieval attached to a TriggerSpec.
A complete trigger definition: what fires a component's crank and what happens then.
Small recursive XML DOM parser (XMLNode) used by CMSDK for all PsySpec XML parsing.