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 *****************
330 DataMessage* waitForNewMessage(uint32 ms);
331
342 std::map<std::string, DataMessage*> waitForNewMessageGroup(uint32 ms, std::string& groupName);
343
344
350 std::string getCurrentTriggerName();
351
357
358
374 DataMessage* waitForNewMessage(uint32 ms, const char* &triggerName);
387
389
390 // Post output messages
428 int32 postOutputMessage(const char* postName = NULL, DataMessage* msg = NULL);
429
430 // Post output messages
445 int32 postOutputMessage(PsyType msgType, DataMessage* msg = NULL);
446
447
448 // ***************** Signals *****************
467 bool emitSignal(const char* name, DataMessage* msg = NULL);
493 DataMessage* waitForSignal(const char* name, uint32 timeout, uint64 lastReceivedTime = 0);
494
495
502 return space->manager->retrieveAllSystemIDs();
503 }
504
505
513 bool addSubscription(const char* xml);
514
515
516 // ***************** PsyProbe plugins *****************
526 bool addPsyProbeCustomView(const char* name, const char* templateURL);
535 bool removePsyProbeCustomView(const char* name) {
536 return addPsyProbeCustomView(name, "");
537 }
538
539 // ***************** Own Data *****************
540 // Load, save or delete own persistent data
568
569 bool setPrivateData(const char* name, const char* data, uint64 size, const char* mimetype = NULL) {
570 return space->manager->componentMemory->setPrivateData(currentCompID, name, data, size, mimetype);
571 }
572
580 uint64 getPrivateDataSize(const char* name) {
581 return space->manager->componentMemory->getPrivateDataSize(currentCompID, name);
582 }
583
590 char* getPrivateDataCopy(const char* name, uint64 &size) {
591 return space->manager->componentMemory->getPrivateDataCopy(currentCompID, name, size);
592 }
593
603 bool getPrivateData(const char* name, char* data, uint64 maxSize) {
604 return space->manager->componentMemory->getPrivateData(currentCompID, name, data, maxSize);
605 }
606
614 bool deletePrivateData(const char* name) {
615 return space->manager->componentMemory->deletePrivateData(currentCompID, name);
616 }
617
618 // ***************** Own Parameters *****************
619 // Get, set, reset, create or destroy own parameters
642 bool createParameter(const char* name, const char* val, const char* defaultValue = NULL) {
643 return space->manager->componentMemory->createParameter(currentCompID, name, val, defaultValue);
644 }
645
656 bool createParameter(const char* name, const char* val, uint32 count, uint32 defaultIndex) {
657 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
658 }
659
669 bool createParameter(const char* name, std::vector<std::string> values, const char* defaultValue = NULL) {
670 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
671 }
672
683 bool createParameter(const char* name, int64* val, uint32 count, uint32 defaultIndex) {
684 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
685 }
686
696 bool createParameter(const char* name, std::vector<std::string> values, int64 defaultValue) {
697 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
698 }
699
709 bool createParameter(const char* name, std::vector<int64> values, int64 defaultValue = 0) {
710 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
711 }
712
723 bool createParameter(const char* name, float64* val, uint32 count, uint32 defaultIndex) {
724 return space->manager->componentMemory->createParameter(currentCompID, name, val, count, defaultIndex);
725 }
726
736 bool createParameter(const char* name, std::vector<std::string> values, float64 defaultValue) {
737 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
738 }
739
749 bool createParameter(const char* name, std::vector<float64> values, float64 defaultValue = 0) {
750 return space->manager->componentMemory->createParameter(currentCompID, name, values, defaultValue);
751 }
752
764 bool createParameter(const char* name, int64 val, int64 min = 0, int64 max = 0, int64 interval = 0) {
765 return space->manager->componentMemory->createParameter(currentCompID, name, val, min, max, interval);
766 }
767
779 bool createParameter(const char* name, float64 val, float64 min = 0, float64 max = 0, float64 interval = 0) {
780 return space->manager->componentMemory->createParameter(currentCompID, name, val, min, max, interval);
781 }
782
790 bool hasParameter(const char* name) {
791 return space->manager->componentMemory->hasParameter(currentCompID, name);
792 }
793
801 bool deleteParameter(const char* name) {
802 return space->manager->componentMemory->deleteParameter(currentCompID, name);
803 }
804
826 uint8 getParameterDataType(const char* name) {
827 return space->manager->componentMemory->getParameterDataType(currentCompID, name);
828 }
829
837 uint32 getParameterValueSize(const char* name) {
838 return space->manager->componentMemory->getParameterValueSize(currentCompID, name);
839 }
840
850 bool getParameter(const char* name, char* val, uint32 maxSize) {
851 return space->manager->componentMemory->getParameter(currentCompID, name, val, maxSize);
852 }
853
861 std::string getParameterString(const char* name) {
862 return space->manager->componentMemory->getParameterString(currentCompID, name);
863 }
864
874 bool getParameterAsBool(const char* name) {
875 return space->manager->componentMemory->getParameterAsBool(currentCompID, name);
876 }
877
885 int64 getParameterInt(const char* name) {
886 return space->manager->componentMemory->getParameterInt(currentCompID, name);
887 }
888
896 float64 getParameterFloat(const char* name) {
897 return space->manager->componentMemory->getParameterFloat(currentCompID, name);
898 }
899
908 bool getParameter(const char* name, int64& val) {
909 return space->manager->componentMemory->getParameter(currentCompID, name, val);
910 }
911
920 bool getParameter(const char* name, float64& val) {
921 return space->manager->componentMemory->getParameter(currentCompID, name, val);
922 }
923
932 bool setParameter(const char* name, const char* val) {
933 return space->manager->componentMemory->setParameter(currentCompID, name, val);
934 }
935
944 bool setParameter(const char* name, int64 val) {
945 return space->manager->componentMemory->setParameter(currentCompID, name, val);
946 }
947
956 bool setParameter(const char* name, float64 val) {
957 return space->manager->componentMemory->setParameter(currentCompID, name, val);
958 }
959
967 bool resetParameter(const char* name) {
968 return space->manager->componentMemory->resetParameter(currentCompID, name);
969 }
970
980 bool tweakParameter(const char* name, int32 tweak) {
981 return space->manager->componentMemory->tweakParameter(currentCompID, name, tweak);
982 }
983
984 // ***************** Other Modules' Parameters *****************
985 // Get, set or reset other module's parameters
986 // *** Not implemented yet
987
988
989
990 // ***************** Queries *****************
991 // Query a Data storage devices (Whiteboard, Stream, Catalogue) for data
992 // Named queries in PsySpec may be used
1022 uint8 retrieve(std::list<DataMessage*> &result, const char* name, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1037 uint8 retrieveTimeParam(std::list<DataMessage*> &result, const char* name, uint64 startTime, uint64 endTime = 0, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1052 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);
1067 uint8 retrieveIntegerParam(std::list<DataMessage*> &result, const char* name, int64 startInteger, int64 endInteger = INT64_NOVALUE, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1082 uint8 retrieveFloatParam(std::list<DataMessage*> &result, const char* name, float64 startFloat, float64 endFloat = FLOAT64_NOVALUE, uint32 maxcount = 0, uint32 maxage = 0, uint32 timeout = 5000);
1091 uint8 retrieve(std::list<DataMessage*> &result, RetrieveSpec* spec, uint32 timeout = 5000);
1092
1124 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);
1125
1152 uint8 queryCatalog(DataMessage** resultMsg, const char* name, DataMessage* msg, uint32 timeout = 5000);
1153
1170 uint8 queryRemoteCatalog(DataMessage** resultMsg, const char* componentName, const char* ipAddress, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1171
1184 uint8 queryRemoteCatalog(DataMessage** resultMsg, const char* componentName, uint32 ipAddress, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1185
1206 uint8 queryRemoteCatalog(DataMessage** resultMsg, uint32& chosenAddress, const char* componentName, uint32* ipAddresses, uint32 numAddresses, uint16 port, DataMessage* msg, uint32 timeout = 5000);
1207
1237 bool queryReply(uint32 id, uint8 status, char* data, uint32 size, uint32 count);
1246 bool queryReply(uint32 id, uint8 status, DataMessage* msg = NULL);
1247
1248 // ***************** Performance *****************
1249 // For querying about performance
1250 // *** Not implemented yet
1251
1252
1253
1254 // ***************** Monitoring *****************
1255 // For providing custom data to monitoring tools
1256 // *** Not implemented yet
1257
1258
1259
1260 // ***************** Supervisor *****************
1261 // API for supervisor modules
1262 // *** Not implemented yet
1263
1264
1274 bool logPrint(int level, const char *formatstring, ... );
1275
1276private:
1277 PsySpace* space;
1278 utils::Mutex apiMutex;
1279 uint64 startedRunning;
1280 bool shouldContinueRunning;
1281 uint32 currentCrankID;
1282 uint32 currentCompID;
1283 uint32 msgReceivedCount;
1284 uint32 msgInputCount;
1285 uint32 msgSentCount;
1286 uint32 msgPostedCount;
1287 uint64 lastCPUTicks;
1288 uint64 lastWallTime;
1289 uint32 chainCPUTicks;
1290 uint32 chainWallTime;
1291 uint32 chainCount;
1292
1293 std::queue<TriggerAndMessage> inputQueue;
1294 utils::Semaphore inputQueueSemaphore;
1295
1296 bool autoDelete;
1297 DataMessage* currentTriggerMsg;
1298 DataMessage* currentMsg;
1299 std::map<std::string, DataMessage*> currentGroupMap; // T1.6: member messages of the current joined set (owned; freed on next wait)
1300 DataMessage* currentSignalMsg;
1301 TriggerSpec* currentTriggerSpec;
1302 char currentTriggerName[MAXKEYNAMELEN+1];
1303 char commandlineBasedir[MAXCOMMANDLINELEN + 1];
1304
1305 // Only called by PsySpace
1309 uint64 checkLastWaitForMessage();
1313 uint8 addInputTrigger(uint32 crankID, uint32 compID, DataMessage* trigger, DataMessage* msg);
1317 bool begin();
1321 bool finish();
1325 bool stop();
1326};
1327
1328} // namespace cmlabs
1329
1330#endif //_PSYAPI_H_
1331
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:530
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:736
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:380
bool removePsyProbeCustomView(const char *name)
Remove a custom module view tab for the PsyProbe web interface.
Definition PsyAPI.h:535
bool deleteParameter(const char *name)
Deletes a named parameter.
Definition PsyAPI.h:801
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:854
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:656
bool resetParameter(const char *name)
Reset parameter to its default (or initial) value.
Definition PsyAPI.h:967
bool tweakParameter(const char *name, int32 tweak)
Step up or down list or range parameter value.
Definition PsyAPI.h:980
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:861
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:696
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:723
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:757
int64 getParameterInt(const char *name)
Read and return value of parameter by name.
Definition PsyAPI.h:885
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:970
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:850
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:560
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:896
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:569
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:764
bool emitSignal(const char *name, DataMessage *msg=NULL)
Emit a signal by its spec name.
Definition PsyAPI.cpp:693
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:1189
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:790
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:502
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:725
bool setParameter(const char *name, int64 val)
Set integer parameter value.
Definition PsyAPI.h:944
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:1110
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:536
bool getParameter(const char *name, int64 &val)
Read integer parameter value.
Definition PsyAPI.h:908
bool setParameter(const char *name, float64 val)
Set float parameter value.
Definition PsyAPI.h:956
DataMessage * retrieveAllSystemIDs()
This function retrieves all names for types, contexts and components.
Definition PsyAPI.h:501
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:603
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:819
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:874
DataMessage * waitForNewMessage(uint32 ms)
Wait for the next trigger message from the component's input queue.
Definition PsyAPI.cpp:371
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:1054
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:1210
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:749
uint64 getPrivateDataSize(const char *name)
This returns the size of the private data chunk previously saved by the crank.
Definition PsyAPI.h:580
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:932
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:779
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:669
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:709
bool deletePrivateData(const char *name)
Deletes a private data chunk by name.
Definition PsyAPI.h:614
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:376
uint32 getParameterValueSize(const char *name)
Return the amount of memory in bytes used by the parameter.
Definition PsyAPI.h:837
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:642
uint8 getParameterDataType(const char *name)
Gets the parameter type.
Definition PsyAPI.h:826
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:590
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:683
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:889
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:785
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:920
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:502
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.