CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs Namespace Reference

Namespaces

namespace  html
namespace  unittest
 API used by the body of a unit test.
namespace  utils

Classes

struct  tagBITMAPFILEHEADER_CM
 BMP file header (14 bytes), local packed definition so no windows.h dependency is needed. More...
struct  tagBITMAPINFOHEADER_CM
 BMP info header (40 bytes, BITMAPINFOHEADER equivalent), packed to 2-byte alignment for direct file mapping. More...
struct  tagRGBA
 One RGBA pixel value as separate byte components. More...
class  Pixel
 Reference to one pixel: coordinates plus a pointer directly into the owning Bitmap's data (no copy). More...
class  Bitmap
 32-bit RGBA raster image with drawing, compositing, scaling, BMP I/O and update-region tracking. More...
class  BitmapUpdate
 Transportable image update: either a full frame or a compressed (RLE and/or difference) delta against a previous frame. More...
struct  ComponentMapHeader
 Header of the legacy shared component map (bitfield + ComponentMapEntry array). More...
struct  ComponentMapEntry
 One component's location record in the legacy component map. More...
struct  ComponentStats
 Legacy per-component throughput counters (DataMessageHeader-based rings). More...
struct  COMPONENTDATAHEADER
 Fixed header of a legacy component data record; followed by parameter and private-data areas. More...
struct  PARAMHEADER
 Legacy size/type prefix of one parameter entry. More...
struct  PARAMINTEGERHEADER
 Legacy value block of an integer parameter. More...
struct  PARAMFLOATHEADER
 Legacy value block of a float parameter. More...
struct  PARAMCOLLHEADER
 Legacy value block of a collection parameter; followed by the packed values. More...
class  ComponentData
 Legacy accessor wrapping one component record inside a shared page. More...
struct  ComponentMemoryStruct
 Root header of the component-memory segment. More...
struct  ComponentInfoStruct
 One component's registry record in shared memory. More...
struct  PrivateHeader
 Size-prefixed private-data entry stored after a component record. More...
struct  ParamHeader
 Size- and type-prefixed parameter entry stored after a component record. More...
struct  ParamIntegerHeader
 Value block of a PARAM_INTEGER parameter. More...
struct  ParamFloatHeader
 Value block of a PARAM_FLOAT parameter. More...
struct  ParamCollectionHeader
 Value block of a PARAM_*_COLL parameter; followed by the packed collection values. More...
class  ComponentMemory
 Accessor for the shared component registry. More...
struct  ControlMessageHeader
 Wire/shared-memory header of a ControlMessage; any payload follows immediately after. More...
class  ControlMessage
 Wrapper class managing a single flat ControlMessage memory block. More...
struct  DataMapsMemoryStruct
 Root header of the data-maps segment; records capacity/size of each contained map. More...
struct  GenericMapHeader
 Common header of every map inside the data-maps segment. More...
struct  TypeMapEntry
 Type-map entry: one registered message type name/id. More...
struct  ContextMapEntry
 Context-map entry: one registered psychological/system context name/id. More...
struct  TagMapEntry
 Tag-map entry: one registered tag name/id. More...
struct  CrankMapEntry
 Crank-map entry: one registered crank (user callback/script) with its function, library and inline script. More...
struct  RequestMapEntry
 Request-map entry tracking one cross-component request/reply transaction. More...
class  DataMapsMemory
 Accessor for the shared name/id maps and the request map. More...
class  GenericMemoryMap
 Static algorithms shared by all bitfield-indexed maps in the data-maps segment. More...
struct  DataMessageEntryHeader
 Header preceding every user entry inside a DataMessage's flat memory block. More...
struct  DataMessageHeader_Old
 Legacy (pre-version-10) DataMessage wire header, kept only for format conversion. More...
struct  DataMessageHeader
 The current (version 10) DataMessage wire/shared-memory header. More...
class  DataMessage
 The central Psyclone data container: a self-contained binary message with typed, named user entries. More...
struct  dirent
class  Color
 24-bit RGB color with mixing, inversion, distance and palette-generation helpers. More...
class  Size
 2D/3D extent (width, height, optional depth) stored as doubles. More...
class  Point
 Integer 3D point with an optional attached Size; interoperates with PointFloat and vectors. More...
class  PointFloat
 Floating-point 3D point with an optional attached Size; float counterpart of Point. More...
class  Line
 Line segment between two PointFloat endpoints with a drawing width. More...
class  PolyLine
 Ordered collection of Line segments (not necessarily connected). More...
class  Box
 Axis-aligned rectangle defined by an upper-left corner and a Size, with overlap/containment math. More...
class  Vector2D
 2D vector with the usual linear algebra: dot product, determinant, projection, rotation, angles. More...
class  Vector3D
 3D vector with dot/cross products, projection and angle math. More...
class  RandomPathGenerator
 Generates a smoothly wandering 2D path: each call to generateNextPoint() advances the last point along a direction vector perturbed by a random variation, useful for simulated motion in tests/demos. More...
class  MemoryCommander
 Placeholder class for a future shared-memory command interface. More...
class  MemoryController
 Pure-virtual interface for shared-segment bookkeeping (implemented by MasterMemory). More...
struct  PsycloneIndexStruct
 Header of the machine-global Psyclone instance index shared-memory segment. More...
struct  PsycloneIndexEntry
 One slot in the machine-global Psyclone instance index. More...
class  PsycloneIndex
 Accessor for the machine-global instance index segment. More...
struct  PerfStats
 Raw per-component performance counters sampled inside shared memory. More...
struct  AveragePerfStats
 Sliding-window averages derived from successive PerfStats snapshots. More...
struct  MemoryMasterStruct
 Root header of the node's master shared-memory segment. More...
class  MasterMemory
 Handle to the node's master shared-memory segment (MemoryMasterStruct). More...
class  MemoryManager
 Top-level facade of the shared-memory subsystem for one process. More...
struct  CMRegister
 Legacy registry block listing the Psyclone system ids present on this machine. More...
struct  MemoryID
 Decomposed form of a 64-bit global memory-block id (legacy page allocator). More...
struct  MemoryBlock
 Size prefix of a raw block inside a MemoryPage (legacy allocator). More...
struct  PagePoolHeader
 Header of the page-pool structure holding reusable, currently idle pages (legacy allocator). More...
struct  PagePoolEntry
 One recyclable page recorded in the page pool (legacy allocator). More...
struct  EOLHeader
 Header of the end-of-life (EOL) time-wheel that schedules page expiry (legacy allocator). More...
struct  EOLEntry
 One page/expiry pair inside an EOL time-wheel slot (legacy allocator). More...
struct  MemoryPage
 In-segment header of one memory page holding packed data blocks (legacy allocator). More...
struct  MemoryPageEntry
 Page-table slot describing one page's identity, size and lock state (legacy allocator). More...
struct  MemoryPageCache
 Header of a process-local (non-shared) cache of mapped page addresses (legacy allocator). More...
struct  MemoryPageCacheEntry
 One process-local cached page mapping; stale when serials mismatch the page table (legacy allocator). More...
struct  MemoryPageMaster
 Root header of the legacy page-allocator segment ("PageMaster"). More...
class  MemoryManagerX
 Legacy page-based shared-memory allocator (predecessor of MemoryManager). More...
struct  TypeMapHeader
 Legacy type-map header (bitfield + TypeMapEntry array). More...
struct  ContextMapHeader
 Legacy context-map header. More...
struct  TopicMapHeader
 Legacy topic-map header. More...
struct  TopicMapEntry
 Legacy topic-map entry. More...
struct  CrankMapHeader
 Legacy crank-map header. More...
struct  QueueMapHeader
 Legacy queue-map header. More...
struct  QueueMapEntry
 Legacy queue-map entry. More...
struct  ProcessMapHeader
 Legacy process-map header. More...
struct  ProcessMapEntry
 Legacy process-map entry with the ids of the process's five queues. More...
struct  RequestMapHeader
 Legacy request-map header. More...
class  MemoryMaps
 Legacy static facade over the page-based shared maps (types, contexts, topics, cranks). More...
struct  MessageQueueHeader
 On-segment header of a circular message queue (legacy 32-bit layout). More...
class  MessageQueue
 Static facade over shared-memory message queues and a request/reply matcher. More...
struct  RequestServerHeader
 Header of a request-server segment: identity, limits and layout parameters. More...
struct  RequestConnectionHeader
 Header of one client connection area within a request-server segment. More...
class  MemoryRequestConnection
 Client endpoint connected to a named shared-memory request server. More...
struct  RequestQueueHeader
 Header of one circular request queue; followed by serialized DataMessages between startPos and endPos. More...
struct  RequestStatusHeader
 Header of the request-status table; followed by a bitfield and countTotal RequestStatusEntry records. More...
struct  RequestStatusEntry
 One request transaction's status record. More...
class  MemoryRequestQueues
 Static helpers for request queues and the request-status map (raw shared memory). More...
class  MemoryRequestServer
 Owner of a named request/reply segment; serves incoming client requests. More...
class  MessageIndex
 Multi-key in-memory index and lifetime manager for DataMessages. More...
struct  ReplayIndexEntry
 Fixed-size on-disk index record describing one recorded message. More...
class  MessagePlayer
 Records DataMessage streams to disk and replays them with original timing. More...
struct  StatEntry
 Accumulated samples of one time bin: number of samples and their value sum. More...
class  MovingAverage
 Circular-buffer moving statistics: query average, sum and per-second throughput over recent time windows. More...
class  NetworkConnectionReceiver
 Callback interface for asynchronous delivery of newly accepted connections. More...
class  NetworkDataReceiver
 Callback interface for asynchronous (push) delivery of received bytes. More...
class  TCPListener
 TCP server socket: binds a port and accepts inbound connections (plain or SSL). More...
class  NetworkConnection
 Abstract base class for all point-to-point network connections. More...
class  UDPConnection
 UDP datagram connection (bound port for input, or output-only sender). More...
class  TCPConnection
 Plain TCP stream connection (client-initiated or accepted from a listener). More...
class  SSLConnection
 SSL/TLS-encrypted TCP connection (OpenSSL) with configurable peer verification. More...
struct  NetworkEvent
 Notification of a connection lifecycle change (connect, disconnect, buffer state...). More...
class  NetworkReceiver
 Callback interface for asynchronous delivery of parsed network traffic. More...
class  HTTPTestServer
 Minimal HTTP server used by the unit tests: replies with a canned page. More...
class  WebsocketTestServer
 Minimal WebSocket echo server used by the unit tests (handles upgrade + echo). More...
class  NetworkManager
 Central owner of all channels, listeners and connections in a process. More...
class  NetworkThread
 Bookkeeping for one worker thread of a NetworkChannel (per listener or connection). More...
class  NetworkChannel
 One logical network interface: a group of listeners/connections with shared dispatch. More...
class  HTTPPostEntry
 One named entry of an HTTP POST body (form field or uploaded file part). More...
class  HTTPRequest
 A parsed or generated HTTP request (also used for WebSocket upgrade handshakes). More...
struct  JSONMEntry
 Metadata for one binary attachment chunk inside a JSONM container. More...
class  JSONM
 JSONM: a JSON document with attached binary chunks in one contiguous buffer. More...
class  WebsocketData
 One WebSocket frame/message (RFC 6455): parsing, generation and control frames. More...
class  TelnetLine
 One line of Telnet-style text traffic. More...
class  HTTPReply
 A parsed or generated HTTP response. More...
class  NetworkProtocol
 Base class for the protocol auto-detection framework. More...
class  HTTPProtocol
 Server-side HTTP/WebSocket protocol handler (static send/receive helpers). More...
class  HTTPClientProtocol
 Client-side HTTP protocol handler (mirror of HTTPProtocol for outgoing requests). More...
class  MessageProtocol
 Binary DataMessage protocol handler: size-prefixed serialised messages. More...
class  TelnetProtocol
 Telnet line protocol handler for interactive text connections. More...
struct  ObsEntry
 Declarative description of one observation source: name, observation type, trigger expression and field-name mappings. More...
struct  cmpObsEntry
 Comparator matching ObsEntry records by name only (used for de-duplication in containers). More...
struct  ObsHeader
 Fixed-size header preceding every observation payload: sizes/ids, provenance (creator, object, topic), type tag, name and confidence/consensus scores. More...
struct  ObsLocation
 6-DOF pose observation: position (x,y,z), orientation (pitch,roll,yaw), size and owning map id. More...
struct  ObsDimension
 Extent observation (w,h,d). More...
struct  ObsInteger
 Scalar integer observation. More...
struct  ObsFloat
 Scalar float observation. More...
struct  ObsTime
 Timestamp observation (ms epoch). More...
struct  ObsString
 Fixed-buffer (1023 chars + NUL) string observation; comparisons are case-insensitive lexicographic. More...
class  GenericObservation
 Header + typed payload wrapper for one observation, serializable to/from DataMessage and raw memory. More...
struct  ProcessStats
 Per-process throughput counters and recent-message rings, kept in shared memory. More...
struct  ProcessInfoStruct
 One process (space) record in the shared process table. More...
struct  ProcessMemoryStruct
 Root header of the process-memory segment: fixed process table plus queue index. More...
class  ProcessMemory
 Accessor for the shared process table and per-process queues. More...
class  PsyAPI
 The API handle a component (crank) uses to talk to the Psyclone system. More...
struct  TrackPlayerMessageEntry
 One key/value entry of a scripted TrackPlayerMessage. More...
struct  TrackPlayerMessage
 One scripted post/signal action for the message-script player (Internal_MessageScript). More...
class  TimeQueueSchedule
 One recurring (or time-bounded) activation schedule managed by a TimeQueue. More...
class  TimeQueue
 Time-binned activation queue used by a PsySpace to drive time-triggered modules. More...
struct  SignalStruct
 Per-signal bookkeeping for PsySpace signal distribution. More...
class  PsySpace
 The runtime container (one OS process/node context) hosting Psyclone components. More...
struct  PsyDateAndTime
 A PsyTime timestamp or time difference broken down into calendar fields. More...
class  RequestReply
 Future/handle for one in-flight request: holds the request message, the eventual reply, status, timing and routing references. More...
class  RequestQueue
 Priority-ordered queue of pending RequestReply objects (per executor connection). More...
struct  RequestConnection
 Gateway-side record of one connected client or executor. More...
struct  RequestGatewayConnection
 Client/executor-side record of one gateway it connects to. More...
class  RequestClient
 Application-facing client of the request system: posts DataMessage requests to one or more RequestGateways and delivers replies. More...
class  TestRequestClient
 Load-test client driving a RequestGateway with binary-protocol requests at a configurable frequency/payload (used by RequestGateway::UnitTest()). More...
class  TestWebRequestClient
 Load-test client driving a RequestGateway over plain HTTP web requests. More...
class  TestWebSocketRequestClient
 Load-test client driving a RequestGateway over WebSocket connections. More...
class  RequestExecutor
 Worker node of the request system: receives requests from gateways, queues them by class (short/long) and sends back replies. More...
class  TestRequestExecutor
 Test executor that services requests with a configurable artificial processing delay; used by RequestGateway::UnitTest(). More...
class  CallLogEntry
 One entry of the gateway's call log: who called what, how it was routed, how long each stage took, and the outcome. More...
class  RequestGateway
 The request-fabric router/load-balancer (see the file header for the full role description). More...
struct  RESTParam
 Definition of one parameter of a REST request, as declared in the API XML. More...
class  RESTRequest
 A parsed and validated REST request with typed access to its parameters. More...
class  RESTParser
 Parses and validates incoming requests against an XML REST API definition. More...
class  RESTHTTPCall
 Definition of an outbound HTTP call template from the REST API XML. More...
class  Stats
 Sliding-window sample collector with average, variance, standard deviation and median. More...
struct  FilterSpec
 One filter condition attached to a TriggerSpec: a test on a user entry of the candidate message. More...
struct  QuerySpec
 Specification of a query against a catalog/service/feed, attached to a TriggerSpec. More...
struct  RetrieveSpec
 Specification of a whiteboard retrieval attached to a TriggerSpec. More...
struct  PostSpec
 Specification of a message to post when a trigger fires (or a crank completes). More...
struct  SignalSpec
 Specification of a signal (a typed notification without payload) emitted when a trigger fires. More...
struct  TriggerSpec
 A complete trigger definition: what fires a component's crank and what happens then. More...
struct  GroupMemberSpec
 One member of a <triggergroup>, referencing a member trigger by name. More...
struct  TriggerGroupSpec
 Specification of a <triggergroup> declarative join (T1.6). More...
struct  ComponentSetup
 Complete static setup for one component, as parsed from the system specification. More...
struct  CustomView
 A custom UI view registered for a component (local configuration; never transmitted). More...
class  ComponentSpec
 In-memory aggregate of a component's setup, triggers and custom views. More...
struct  SlotEntryStruct
 Per-message slot record: which bin/blocks hold the message and until when. More...
struct  TemporalMemoryStruct
 Root header of the temporal-memory segment. More...
struct  BinHeaderStruct
 Header of one fixed-block-size bin inside the temporal segment. More...
class  TemporalMemory
 Accessor for the temporal (dynamic) message store in shared memory. More...
struct  ThreadStats
 Bookkeeping record for a single managed thread. More...
struct  ThreadDataHeader
 Header at the start of the ThreadManager's contiguous storage block. More...
class  Runnable
 Minimal cooperative-shutdown base class for objects that run a worker thread. More...
class  ThreadManager
 Singleton registry that creates, controls and profiles all CMSDK threads. More...
struct  UnitTestMetric
 One recorded performance metric of a test run. More...
struct  UnitTestRecord
 Registration and result record for a single unit test. More...
class  UnitTestRunner
 The test runner (process-wide singleton). More...
class  CleanShutdown
 RAII guard whose single static instance triggers global utility cleanup at program exit. More...
struct  LogEntry
 Wire/storage layout of one log record: fixed header immediately followed by the message text. More...
class  LogReceiver
 Callback interface for receiving log entries produced through LogSystem. More...
class  LogSystem
 Process-wide singleton logging hub with per-topic verbosity/debug levels. More...
struct  PerchPoint
 One perch: id, occupancy state, occupying entity, last-visit time, label, opaque data and overlap weights against other perches. More...
class  VantagePoints
 Registry of perch points parsed from PsySpec XML, with reserve/occupy/free bookkeeping. More...
struct  XMLResults
struct  XMLClear
struct  XMLAttribute
struct  XMLNode
struct  XMLNodeContents
struct  ToXMLStringTool
struct  XMLParserBase64Tool
struct  DIR
struct  HTTPServerTestData

Typedefs

typedef unsigned char CMBYTE
typedef unsigned int CMUINT
typedef unsigned int CMDWORD
typedef unsigned short CMWORD
typedef signed int CMLONG
typedef struct cmlabs::tagBITMAPFILEHEADER_CM BITMAPFILEHEADER_CM
 BMP file header (14 bytes), local packed definition so no windows.h dependency is needed.
typedef struct cmlabs::tagBITMAPINFOHEADER_CM BITMAPINFOHEADER_CM
 BMP info header (40 bytes, BITMAPINFOHEADER equivalent), packed to 2-byte alignment for direct file mapping.
typedef struct cmlabs::tagRGBA valRGBA
 One RGBA pixel value as separate byte components.
typedef struct DIR DIR
typedef std::pair< DataMessage *, DataMessage * > TriggerAndMessage
 Pairing of a trigger message and its accompanying data message, as queued for a crank's input.
typedef int8(* CrankFunction) (PsyAPI *api)
 Signature of a component (crank) entry function.
typedef void(* RequestCallbackFunction) (RequestReply &reply)
 Signature for asynchronous completion callbacks registered on a RequestReply.
typedef bool(* UnitTestFunc) ()
 Signature every unit test uses.
typedef enum cmlabs::XMLError XMLError
typedef enum cmlabs::XMLElementType XMLElementType
typedef struct cmlabs::XMLResults XMLResults
typedef struct cmlabs::XMLClear XMLClear
typedef struct cmlabs::XMLAttribute XMLAttribute
typedef struct XMLDLLENTRY cmlabs::XMLNode XMLNode
typedef struct cmlabs::XMLNodeContents XMLNodeContents
typedef struct XMLDLLENTRY cmlabs::ToXMLStringTool ToXMLStringTool
typedef struct XMLDLLENTRY cmlabs::XMLParserBase64Tool XMLParserBase64Tool

Enumerations

enum  RequestStatus {
  NONE = 0 , IDLE = 1 , QUEUED = 2 , PROCESSING = 3 ,
  SENT = 4 , SUCCESS = 5 , FAILED = 6 , TIMEOUT = 7 ,
  TOOBUSY = 8 , LOCALERROR = 9 , NETWORKERROR = 10 , SERVERERROR = 11
}
 Lifecycle states of a request as it moves through client, gateway and executor. More...
enum  TriggerGroupCount { TRIGGERGROUP_COUNT_ALL = 0 }
 T1.6 group completion policy: fire when ANY N members present (count), or all named. More...
enum  TriggerGroupDup { TRIGGERGROUP_DUP_LATEST = 0 , TRIGGERGROUP_DUP_KEEP = 1 }
 T1.6 duplicate-member handling before a set completes. More...
enum  TriggerGroupOrder { TRIGGERGROUP_ORDER_NONE = 0 , TRIGGERGROUP_ORDER_STRICT = 1 }
 T1.6 ordering constraint. More...
enum  TriggerGroupMode { TRIGGERGROUP_MODE_NORMAL = 0 , TRIGGERGROUP_MODE_SNAPSHOT = 1 }
 T1.6 join mode. More...
enum  TriggerGroupOnTimeout { TRIGGERGROUP_ONTIMEOUT_FIRE = 0 , TRIGGERGROUP_ONTIMEOUT_DISCARD = 1 }
 T1.6 action on window/maxage expiry with an incomplete set. More...
enum  PerchState { FREE = 0 , RESERVED = 1 , OCCUPIED = 2 , LEAVING = 3 }
 Lifecycle of a perch point: FREE, RESERVED (claimed, not yet reached), OCCUPIED, LEAVING (being vacated). More...
enum  VantageState { IDLE = 1 , INMOTION = 1 , SETTLED = 2 }
 State of the whole vantage system: IDLE, INMOTION (reconfiguring) or SETTLED. More...
enum  XMLError {
  eXMLErrorNone = 0 , eXMLErrorMissingEndTag , eXMLErrorNoXMLTagFound , eXMLErrorEmpty ,
  eXMLErrorMissingTagName , eXMLErrorMissingEndTagName , eXMLErrorUnmatchedEndTag , eXMLErrorUnmatchedEndClearTag ,
  eXMLErrorUnexpectedToken , eXMLErrorNoElements , eXMLErrorFileNotFound , eXMLErrorFirstTagNotFound ,
  eXMLErrorUnknownCharacterEntity , eXMLErrorCharConversionError , eXMLErrorCannotOpenWriteFile , eXMLErrorCannotWriteFile ,
  eXMLErrorBase64DataSizeIsNotMultipleOf4 , eXMLErrorBase64DecodeIllegalCharacter , eXMLErrorBase64DecodeTruncatedData , eXMLErrorBase64DecodeBufferTooSmall
}
enum  XMLElementType {
  eNodeChild =0 , eNodeAttribute =1 , eNodeText =2 , eNodeClear =3 ,
  eNodeNULL =4
}

Functions

bool Base64_UnitTest ()
 Base64 round-trip unit test.
char * ImageResizeDown66 (char *bytesource, uint32 &cols, uint32 &rows)
 Shrink an RGBA image to 2/3 size (3→2 pixel averaging).
char * ImageResizeDown (char *bytesource, uint32 &cols, uint32 &rows, uint32 factor)
 Shrink an RGBA image by an integer factor (box averaging).
char * ImageResizeUp66 (char *bytesource, uint32 &cols, uint32 &rows)
 Enlarge an RGBA image to 3/2 size (2→3 pixel interpolation).
char * ImageResizeUp (char *bytesource, uint32 &cols, uint32 &rows, uint32 factor)
 Enlarge an RGBA image by an integer factor (pixel replication).
bool SetDebugLevel (unsigned char level)
 Set the debug level for all subjects at once.
bool SetDebugLevel (unsigned char subject, unsigned char level)
 Set the debug level for a single subject.
bool SetVerboseLevel (unsigned char level)
 Set the verbose level for all subjects at once.
bool SetVerboseLevel (unsigned char subject, unsigned char level)
 Set the verbose level for a single subject.
bool SetErrorLevel (unsigned char level)
 Set the global error output level.
bool PrintFile (FILE *stream, const char *formatstring,...)
 Print a printf-style formatted string to an arbitrary stdio stream.
bool PrintVerbose (unsigned char subject, unsigned char level, const char *formatstring,...)
 Print a verbose (informational) message if enabled for the subject.
bool PrintError (unsigned char level, const char *formatstring,...)
 Print an error message if enabled.
bool PrintDebug (unsigned char subject, unsigned char level, const char *formatstring,...)
 Print a debug message if enabled for the subject.
DIRopendir (const char *)
int closedir (DIR *)
struct direntreaddir (DIR *)
void rewinddir (DIR *)
bool Hash_UnitTest ()
 Exercise the hash classes against known test vectors.
bool MathClasses_UnitTest ()
 Unit test for the MathClasses module (geometry / vectors / boxes).
bool TestMemoryCommander ()
 Self-test hook for the memory commander.
THREAD_RET THREAD_FUNCTION_CALL MemoryManagement (THREAD_ARG arg)
 Background maintenance thread entry point for MemoryManager / MemoryManagerX.
static THREAD_RET THREAD_FUNCTION_CALL QueueTest (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL SSLConnectionRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL TCPListenerRun (THREAD_ARG arg)
 Thread entry point for a TCPListener's internal accept loop.
THREAD_RET THREAD_FUNCTION_CALL TCPConnectionRun (THREAD_ARG arg)
 Thread entry point for a TCPConnection's push-mode reader loop.
THREAD_RET THREAD_FUNCTION_CALL UDPConnectionRun (THREAD_ARG arg)
 Thread entry point for a UDPConnection's push-mode reader loop.
bool NetworkTest_TCPServer (uint16 port, uint32 count=0)
 Loopback test server: listens on port and echoes test payloads.
bool NetworkTest_TCPClient (const char *address, uint16 port, uint32 count=0)
 Loopback test client matching NetworkTest_TCPServer().
bool NetworkTest_SendReceiveData (TCPConnection *con, char *data, uint32 dataLen, uint32 c, bool receiveFirst=false)
 Send-and-verify helper used by the TCP tests.
bool NetworkProtocols_UnitTest ()
int64 ExtractIntFromMessage (const char *name, DataMessage *msg, std::map< std::string, std::string > &mappings, bool &ok)
 Read an integer field from a message, translating name through mappings first.
float64 ExtractFloatFromMessage (const char *name, DataMessage *msg, std::map< std::string, std::string > &mappings, bool &ok)
 Float variant of ExtractIntFromMessage(); same mapping semantics.
uint64 ExtractTimeFromMessage (const char *name, DataMessage *msg, std::map< std::string, std::string > &mappings, bool &ok)
 Timestamp variant of ExtractIntFromMessage(); same mapping semantics.
std::string ExtractStringFromMessage (const char *name, DataMessage *msg, std::map< std::string, std::string > &mappings, bool &ok)
 String variant of ExtractIntFromMessage(); same mapping semantics.
uint32 GetObsTypeFromRawData (const char *data, uint32 size)
 Inspect a raw observation blob and return its OBSID_* type tag from the embedded ObsHeader.
bool Observations_UnitTest ()
 Unit test for the Observations module.
void Register_Observations_Tests ()
 Register the Observations tests with the unit test framework.
THREAD_RET THREAD_FUNCTION_CALL ProcessMemoryPerfTest (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL PsySpaceRun (THREAD_ARG arg)
 Main service-thread entry: runs PsySpace::run() for the space passed in arg.
THREAD_RET THREAD_FUNCTION_CALL PsySpacePoolRun (THREAD_ARG arg)
 Pool worker-thread entry: runs PsySpace::threadPoolDispatch() for the space passed in arg.
THREAD_RET THREAD_FUNCTION_CALL PsySpaceContinuousRun (THREAD_ARG arg)
 Continuous-component thread entry: runs PsySpace::runContinuousComponent() for the space passed in arg.
int TestSSL (int port)
 Standalone smoke test for the SSL server functionality.
uint64 GetTimeNow ()
 Return the current absolute time (µs since year 0) according to the TMC.
uint64 SyncToHardwareClock ()
 Recompute the Time Mapping Constant by anchoring the monotonic clock to the wall clock.
bool SetCurrentNetSyncDif (int64 netTimeDif)
 Set the network time difference for a slave node so its GetTimeNow() matches the master.
bool SetCurrentTimeSyncData (uint64 tmc, int64 netTimeAdjust)
 Install externally computed sync data (e.g.
bool GetCurrentTimeSyncData (uint64 &tmc, int64 &netTimeAdjust)
 Read the current sync data.
uint64 EstNextTMCWrap ()
 Estimate when the underlying hardware counter will next wrap around.
int64 GetTimeAge (uint64 t)
 Age of a timestamp relative to now.
int32 GetTimeAgeMS (uint64 t)
 Age of a timestamp relative to now, in milliseconds.
uint64 GetTimeFromString (const char *str)
 Parse a textual date/time into a PsyTime timestamp.
uint32 GetHTTPTime (uint64 time, char *buffer, uint32 size)
 Format a timestamp as an HTTP-date (RFC 7231) string, e.g.
uint64 GetTimeFromPsyDateAndTime (struct PsyDateAndTime &tad)
 Convert a broken-down PsyDateAndTime back into a µs timestamp.
uint32 GetTimeOffsetGMT ()
struct PsyDateAndTime GetDateAndTime (uint64 t, bool local=true)
 Break a timestamp into calendar fields.
struct PsyDateAndTime GetDateAndTimeUTC (uint64 t)
 Break a timestamp into calendar fields in UTC.
struct PsyDateAndTime GetTimeDifference (uint64 t1, uint64 t2)
 Express the difference t1 - t2 as calendar fields (negative flag set when t2 > t1).
struct PsyDateAndTime GetTimeDifference (int64 dif)
 Express a signed µs difference as calendar fields.
uint64 FTime2PsyTime (uint64 t)
 Convert an ftime-style value (ms since Unix epoch) to a PsyTime µs timestamp.
bool PsyTime_UnitTest ()
 Run the PsyTime unit tests.
THREAD_RET THREAD_FUNCTION_CALL RequestClientRun (THREAD_ARG arg)
 Thread entry point for the RequestClient worker loop.
THREAD_RET THREAD_FUNCTION_CALL TestRequestClientRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL TestWebRequestClientRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL TestWebSocketRequestClientRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL RequestExecutorRun (THREAD_ARG arg)
 Thread entry point for the RequestExecutor worker loop.
THREAD_RET THREAD_FUNCTION_CALL ShortExecutorRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL LongExecutorRun (THREAD_ARG arg)
THREAD_RET THREAD_FUNCTION_CALL RequestGatewayExecRun (THREAD_ARG arg)
 Thread entry point for the gateway's executor-side loop.
THREAD_RET THREAD_FUNCTION_CALL RequestGatewayClientRun (THREAD_ARG arg)
 Thread entry point for the gateway's client-side loop.
bool TestThreadManager ()
 Legacy standalone smoke test for ThreadManager (predates the UnitTestRunner framework).
static THREAD_RET THREAD_FUNCTION_CALL ThreadMonitoring (void *arg)
 Entry function of the monitoring thread; delegates to ThreadManager::threadMonitoring().
void RegisterAllCMSDKTests ()
 Register every CMSDK unit test with the framework (idempotent).
bool RunCMSDKTests (const char *name, const char *compareFile, const char *outFile, const char *outDir, bool verbose, bool listOnly, bool forkPerTest=true)
 Full configurable entry used by the Psyclone test= dispatch.
bool IsCMSDKTest (const char *name)
bool UnitTest_CMSDK ()
 Back-compatible entry: run the full suite with default settings.
bool PerfTest_CMSDK ()
 Back-compatible entry: run the performance-oriented tests (legacy alias).
bool ClearUtilsMaps ()
 Free all lazily-allocated global registries (mutex/semaphore/event/shared-memory maps).
std::string GetDataTypeName (uint32 datatype)
 Translate a CMSDK datatype id (e.g.
uint32 GetDataTypeID (const char *typeName)
 Inverse of GetDataTypeName(): look up the numeric datatype id for a type name.
XMLDLLENTRY void freeXMLString (XMLSTR t)
XMLDLLENTRY XMLSTR stringDup (XMLCSTR source, int cbData=0)
void Register_Base64_Tests ()
void Register_Bitmap_Tests ()
void Register_ComponentData_Tests ()
void Register_ComponentMemory_Tests ()
void Register_ControlMessage_Tests ()
void Register_DataMessage_Tests ()
static std::string ToLowerHex (const std::string &s)
static bool CheckHex (const char *algo, const char *input, const std::string &got, const char *expected)
void Register_Hash_Tests ()
void Register_HTML_Tests ()
void Register_MathClasses_Tests ()
void Register_MemoryManager_Tests ()
void Register_MemoryRequestServer_Tests ()
void Register_MessageIndex_Tests ()
void Register_MovingAverage_Tests ()
bool SSLCheckBufferForCompatibility (const char *buffer, uint32 length)
bool AESCheckBufferForCompatibility (const char *buffer, uint32 length)
THREAD_RET THREAD_FUNCTION_CALL HTTPServerTest (THREAD_ARG arg)
void Register_NetworkManager_Tests ()
static bool TestWebsocketRoundTrip (WebsocketData::DataType type, bool maskData, const char *payload, uint64 payloadSize)
void Register_NetworkProtocols_Tests ()
bool ObservationTest ()
static void StopProcessTestThread ()
void Register_ProcessMemory_Tests ()
void Register_PsyTime_Tests ()
static bool Test_RequestClient ()
void Register_RequestClient_Tests ()
static bool Test_RequestGateway ()
void Register_RequestGateway_Tests ()
void Register_RESTParser_Tests ()
void Register_Stats_Tests ()
void Register_Subscriptions_Tests ()
void Register_TemporalMemory_Tests ()
void Register_ThreadManager_Tests ()
void Register_Utils_Tests ()
void Register_XMLParser_Tests ()
void Register_VantagePoints_Tests ()
static void ut_clearSegmentsIn (const char *dir, const char *prefix)
static void ClearStaleTestSegments ()
static void ut_timeoutTraceHandler (int)
static void ut_installTimeoutTraceHandler (const std::string &tracePath)
static std::string ut_readProgressNote (const std::string &path)
static void ut_printTraceFile (const std::string &path)
static std::string ut_escape_field (const std::string &s)
static void ut_writeChildResult (const std::string &path, const UnitTestRecord *rec)
static void ut_readChildResult (const std::string &path, UnitTestRecord *rec)
static std::string jsonEscape (const std::string &s)
static bool Test_Utils ()
static bool Test_Timer ()
Map-entry to page-id dispatch

Overload resolution maps an entry type to the reserved system page storing its map.

uint16 TypePageID (TypeMapEntry *e)
uint16 TypePageID (TopicMapEntry *e)
uint16 TypePageID (QueueMapEntry *e)
uint16 TypePageID (ProcessMapEntry *e)
uint16 TypePageID (RequestMapEntry *e)
uint16 TypePageID (CrankMapEntry *e)
uint16 TypePageID (ContextMapEntry *e)
Built-in internal cranks

CrankFunction implementations registered by PsySpace under reserved names.

Each takes the component's PsyAPI handle and returns an int8 status.

int8 Internal_Simple (PsyAPI *api)
 Pass-through test crank: copies each incoming message to its posts.
int8 Internal_Ping (PsyAPI *api)
 Latency test: posts pings, expects pongs.
int8 Internal_Pong (PsyAPI *api)
 Latency test counterpart: answers pings.
int8 Internal_Shutdown (PsyAPI *api)
 Initiates system shutdown when triggered.
int8 Internal_Print (PsyAPI *api)
 Prints incoming messages to the console/log.
int8 Internal_Time (PsyAPI *api)
 Posts time information/timestamps.
int8 Internal_SignalPing (PsyAPI *api)
 Signal-based ping test.
int8 Internal_SignalPong (PsyAPI *api)
 Signal-based pong counterpart.
int8 Internal_RetrieveTest (PsyAPI *api)
 Exercises whiteboard retrieve calls.
int8 Internal_MessageScript (PsyAPI *api)
 Plays back scripted TrackPlayerMessage sequences.
int8 Internal_QueryTest (PsyAPI *api)
 Exercises query/queryReply round-trips.
int8 Internal_StatsLog (PsyAPI *api)
 Periodically logs system statistics.
int8 Internal_BitmapPoster (PsyAPI *api)
 Posts test bitmap/image messages.
int8 Internal_MessageToggler (PsyAPI *api)
 Alternates/toggles message output for testing.
int8 Internal_MessageTypeConverter (PsyAPI *api)
 Converts incoming messages to another type before reposting.
char* time formatters

Format timestamps into newly allocated char buffers.

Warning
Ownership: each of these allocates a fresh 1024-byte buffer with new char[] and returns it — the CALLER must delete [] the result or it leaks. Prefer the std::string variants below, which have no such footgun. Common parameters: t timestamp in µs; local = local time vs UTC; us / ms = include microseconds / milliseconds in the output.
char * PrintTime (uint64 t, bool local=true, bool us=true, bool ms=true)
 Full date + time-of-day.
char * PrintTimeOnly (uint64 t, bool local=true, bool us=true, bool ms=true)
 Time-of-day only.
char * PrintTimeDif (uint64 t, bool us=true, bool ms=true)
 Format a µs duration with scale-adaptive units: "250us", "1.500ms", "2.750s", "2m 3s", "01:02:03", "3 days 01:02:03".
char * PrintDate (uint64 t, bool local=true)
 Date only, human-readable.
char * PrintDateSortable (uint64 t, bool local=true)
 Date only, sortable (e.g.
char * PrintDateSortableDelimiter (uint64 t, const char *del, bool local=true)
 Sortable date with custom field delimiter.
char * PrintTimeSortable (uint64 t, bool local)
 Sortable date+time, second resolution.
char * PrintTimeSortableMillisec (uint64 t, bool local)
 Sortable date+time with milliseconds.
char * PrintTimeSortableMicrosec (uint64 t, bool local)
 Sortable date+time with microseconds.
std::string time formatters

Thread-safe, leak-free equivalents of the char* formatters above (they wrap the char* variants and free the buffer); same parameter conventions (t µs timestamp, local, us, ms).

Preferred in application code.

uint64 t = GetTimeNow();
std::string full = PrintTimeString(t); // "21/07/2026 15:30:02.123.456"
std::string clock = PrintTimeOnlyString(t, true, false, true); // "15:30:02.123"
std::string sortable = PrintTimeSortableMillisecString(t); // "20260721-153002.123"
std::string logname = PrintDateStringSortableDelimiter(t, "-"); // "2026-07-21"
std::string age = PrintTimeDifString(GetTimeAge(msgTime)); // e.g. "2m 3s"
std::string PrintTimeString(uint64 t, bool local=true, bool us=true, bool ms=true)
Definition PsyTime.cpp:676
std::string PrintDateStringSortableDelimiter(uint64 t, const char *del, bool local=true)
Definition PsyTime.cpp:712
std::string PrintTimeSortableMillisecString(uint64 t, bool local=true)
Sortable date+time with milliseconds.
Definition PsyTime.cpp:740
uint64 GetTimeNow()
Return the current absolute time (µs since year 0) according to the TMC.
Definition PsyTime.cpp:69
std::string PrintTimeDifString(uint64 t, bool us=true, bool ms=true)
Definition PsyTime.cpp:722
std::string PrintTimeOnlyString(uint64 t, bool local=true, bool us=true, bool ms=true)
Definition PsyTime.cpp:685
int64 GetTimeAge(uint64 t)
Age of a timestamp relative to now.
Definition PsyTime.cpp:25
std::string PrintTimeNowString (bool local=true, bool us=true, bool ms=true)
 Format GetTimeNow().
std::string PrintTimeString (uint64 t, bool local=true, bool us=true, bool ms=true)
std::string PrintTimeOnlyString (uint64 t, bool local=true, bool us=true, bool ms=true)
std::string PrintTimeDifString (uint64 t, bool us=true, bool ms=true)
std::string PrintDateString (uint64 t, bool local=true)
std::string PrintDateStringSortable (uint64 t, bool local=true)
std::string PrintDateStringSortableDelimiter (uint64 t, const char *del, bool local=true)
std::string PrintTimeSortableString (uint64 t, bool local=true)
 Sortable date+time, second resolution.
std::string PrintTimeSortableMillisecString (uint64 t, bool local=true)
 Sortable date+time with milliseconds.
std::string PrintTimeSortableMicrosecString (uint64 t, bool local=true)
 Sortable date+time with microseconds.

Variables

static const char * VerboseSubjects [] = { "verbose-system", "verbose-network", "verbose-node", "verbose-process", "verbose-component" }
 Spec attribute names for per-subject verbose levels, indexed by subject-1.
static const char * DebugSubjects [] = { "debug-system", "debug-network", "debug-node", "debug-process", "debug-component" }
 Spec attribute names for per-subject debug levels, indexed by subject-1.
static unsigned char VerboseLevel [5] = {1,1,1,1,1}
 Current verbose level per subject (index = subject-1).
static unsigned char DebugLevel [5] = {0,0,0,0,0}
 Current debug level per subject (index = subject-1).
static unsigned char ErrorLevel = 1
 Current error level threshold.
const std::map< std::string, std::array< uint8, 3 > > ColorMap
 Lookup table mapping ~200 CSS/X11 color names (with and without spaces) to 8-bit RGB triplets; used by Color(const char*).
static char HTTP_Type [][8]
 HTTP method name strings, indexed by the HTTP_* method ids (index 0 unused).
static char HTTP_Status [][128]
 Full HTTP status lines (with inline error bodies for error cases), indexed by the HTTP_* status ids above.
static char PsyDays [][5] = {"None", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}
 Abbreviated weekday names indexed 1..7 (Mon..Sun); index 0 is "None".
static char PsyDaysFull [][10] = {"None", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}
 Full weekday names indexed 1..7 (Monday..Sunday); index 0 is "None".
static char PsyMonths [][5] = {"None", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
 Abbreviated month names indexed 1..12 (Jan..Dec); index 0 is "None".
static char PsyMonthsFull [][10] = {"None", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
 Full month names indexed 1..12; index 0 is "None".
static uint64 CurrentTMC = 0
 Current Time Mapping Constant (µs offset from monotonic clock to absolute PsyTime).
static uint8 CurrentTMCMode = TMC_MASTER
 Current TMC role: TMC_MASTER or TMC_SLAVE.
static uint64 LastTMCSync = 0
 PsyTime timestamp of the last hardware-clock sync.
static int64 NetTimeAdjust = 0
 Signed network time adjustment (µs) applied when slaved to a remote master.
bool IsSSLInitialised = false
static volatile bool g_processTestStop = false
static uint32 g_processTestThreadID = 0
static bool g_registered = false
static int ut_traceFd = -1
uint32 CleanShutdownInstanceCount = 0
CleanShutdown CleanShutdownInstance
Built-in control message types

Predefined PsyType values (root level 1 = control) used by the runtime itself for self-test, log printing and ping/pong liveness checks.

static struct PsyType CTRL_TEST = { { 1,10001,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static struct PsyType CTRL_LOGPRINT = { { 1,10002,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static struct PsyType CTRL_PING = { { 1,10003,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static struct PsyType CTRL_PING_REPLY = { { 1,10004,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }

Typedef Documentation

◆ BITMAPFILEHEADER_CM

BMP file header (14 bytes), local packed definition so no windows.h dependency is needed.

◆ BITMAPINFOHEADER_CM

BMP info header (40 bytes, BITMAPINFOHEADER equivalent), packed to 2-byte alignment for direct file mapping.

◆ CMBYTE

typedef unsigned char cmlabs::CMBYTE

Definition at line 45 of file Bitmap.h.

◆ CMDWORD

typedef unsigned int cmlabs::CMDWORD

Definition at line 47 of file Bitmap.h.

◆ CMLONG

typedef signed int cmlabs::CMLONG

Definition at line 49 of file Bitmap.h.

◆ CMUINT

typedef unsigned int cmlabs::CMUINT

Definition at line 46 of file Bitmap.h.

◆ CMWORD

typedef unsigned short cmlabs::CMWORD

Definition at line 48 of file Bitmap.h.

◆ CrankFunction

typedef int8(* cmlabs::CrankFunction) (PsyAPI *api)

Signature of a component (crank) entry function.

A crank is the executable body of a Psyclone component. The space calls this function on a pool thread whenever the component is triggered; the function receives the component's PsyAPI handle and should loop on PsyAPI::shouldContinue() / PsyAPI::waitForNewMessage() to process input.

Parameters
apiThe PsyAPI handle for the component instance being run (owned by the space; do not delete).
Returns
Implementation-defined status code; non-negative for success.

Definition at line 49 of file PsySpace.h.

◆ DIR

typedef struct DIR cmlabs::DIR

Definition at line 31 of file direntwin.h.

◆ ToXMLStringTool

typedef struct XMLDLLENTRY cmlabs::ToXMLStringTool cmlabs::ToXMLStringTool

◆ TriggerAndMessage

Pairing of a trigger message and its accompanying data message, as queued for a crank's input.

Definition at line 71 of file PsyAPI.h.

◆ valRGBA

One RGBA pixel value as separate byte components.

◆ XMLAttribute

typedef struct cmlabs::XMLAttribute cmlabs::XMLAttribute

◆ XMLClear

typedef struct cmlabs::XMLClear cmlabs::XMLClear

◆ XMLElementType

◆ XMLError

◆ XMLNode

typedef struct XMLDLLENTRY cmlabs::XMLNode cmlabs::XMLNode

◆ XMLNodeContents

typedef struct cmlabs::XMLNodeContents cmlabs::XMLNodeContents

◆ XMLParserBase64Tool

typedef struct XMLDLLENTRY cmlabs::XMLParserBase64Tool cmlabs::XMLParserBase64Tool

◆ XMLResults

typedef struct cmlabs::XMLResults cmlabs::XMLResults

Enumeration Type Documentation

◆ PerchState

Lifecycle of a perch point: FREE, RESERVED (claimed, not yet reached), OCCUPIED, LEAVING (being vacated).

Enumerator
FREE 
RESERVED 
OCCUPIED 
LEAVING 

Definition at line 18 of file VantagePoints.h.

◆ TriggerGroupCount

T1.6 group completion policy: fire when ANY N members present (count), or all named.

Enumerator
TRIGGERGROUP_COUNT_ALL 

0 = "all" (every named member required).

>0 = any-N-of-M.

Definition at line 551 of file Subscriptions.h.

◆ TriggerGroupDup

T1.6 duplicate-member handling before a set completes.

Enumerator
TRIGGERGROUP_DUP_LATEST 

default: latest member value wins.

TRIGGERGROUP_DUP_KEEP 

queue all duplicate member values.

Definition at line 555 of file Subscriptions.h.

◆ TriggerGroupMode

T1.6 join mode.

Enumerator
TRIGGERGROUP_MODE_NORMAL 

default: accumulate + complete-check.

TRIGGERGROUP_MODE_SNAPSHOT 

fire on primary member; attach latest of others, no wait.

Definition at line 565 of file Subscriptions.h.

◆ TriggerGroupOnTimeout

T1.6 action on window/maxage expiry with an incomplete set.

Enumerator
TRIGGERGROUP_ONTIMEOUT_FIRE 

default: partial-fire + L1 warn.

TRIGGERGROUP_ONTIMEOUT_DISCARD 

drop the partial set silently-ish.

Definition at line 570 of file Subscriptions.h.

◆ TriggerGroupOrder

T1.6 ordering constraint.

Enumerator
TRIGGERGROUP_ORDER_NONE 

default: any arrival order.

TRIGGERGROUP_ORDER_STRICT 

only fire if members arrived in declared order.

Definition at line 560 of file Subscriptions.h.

◆ VantageState

State of the whole vantage system: IDLE, INMOTION (reconfiguring) or SETTLED.

Enumerator
IDLE 
INMOTION 
SETTLED 

Definition at line 20 of file VantagePoints.h.

◆ XMLElementType

Enumerator
eNodeChild 
eNodeAttribute 
eNodeText 
eNodeClear 
eNodeNULL 

Definition at line 156 of file xml_parser.h.

◆ XMLError

Enumerator
eXMLErrorNone 
eXMLErrorMissingEndTag 
eXMLErrorNoXMLTagFound 
eXMLErrorEmpty 
eXMLErrorMissingTagName 
eXMLErrorMissingEndTagName 
eXMLErrorUnmatchedEndTag 
eXMLErrorUnmatchedEndClearTag 
eXMLErrorUnexpectedToken 
eXMLErrorNoElements 
eXMLErrorFileNotFound 
eXMLErrorFirstTagNotFound 
eXMLErrorUnknownCharacterEntity 
eXMLErrorCharConversionError 
eXMLErrorCannotOpenWriteFile 
eXMLErrorCannotWriteFile 
eXMLErrorBase64DataSizeIsNotMultipleOf4 
eXMLErrorBase64DecodeIllegalCharacter 
eXMLErrorBase64DecodeTruncatedData 
eXMLErrorBase64DecodeBufferTooSmall 

Definition at line 129 of file xml_parser.h.

Function Documentation

◆ AESCheckBufferForCompatibility()

bool cmlabs::AESCheckBufferForCompatibility ( const char * buffer,
uint32 length )

Definition at line 47 of file NetworkConnections.cpp.

References cmlabs::utils::stristr().

◆ Base64_UnitTest()

bool cmlabs::Base64_UnitTest ( )

Base64 round-trip unit test.

Returns
true when all checks pass.

Definition at line 148 of file Base64.cpp.

References base64_decode(), base64_encode(), cmlabs::unittest::detail(), cmlabs::unittest::fail(), GetTimeNow(), cmlabs::unittest::metric(), and cmlabs::unittest::progress().

Referenced by Register_Base64_Tests().

◆ CheckHex()

bool cmlabs::CheckHex ( const char * algo,
const char * input,
const std::string & got,
const char * expected )
static

Definition at line 41 of file HashTest.cpp.

References cmlabs::unittest::detail(), cmlabs::unittest::fail(), and ToLowerHex().

Referenced by Hash_UnitTest().

◆ ClearStaleTestSegments()

void cmlabs::ClearStaleTestSegments ( )
static

Definition at line 66 of file UnitTestFramework.cpp.

References ut_clearSegmentsIn().

◆ ClearUtilsMaps()

bool cmlabs::ClearUtilsMaps ( )

Free all lazily-allocated global registries (mutex/semaphore/event/shared-memory maps).

Returns
true when the maps were cleared (idempotent; safe to call more than once).
Note
Called automatically by CleanShutdown at exit; only call manually when deliberately tearing down all utils state, e.g. before unloading a plugin.

Definition at line 49 of file Utils.cpp.

References cmlabs::utils::CommandLineInfo::CommandLineInfoSingleton, cmlabs::utils::DrumBeatMap, cmlabs::utils::SharedMemoryEventMap, cmlabs::utils::SharedMemoryEventMapMutex, cmlabs::utils::SharedMemoryFileHandleMap, cmlabs::utils::SharedMemoryMutexMap, cmlabs::utils::SharedMemoryMutexMapMutex, cmlabs::utils::SharedMemorySemaphoreMap, cmlabs::utils::SharedMemorySemaphoreMapMutex, and cmlabs::utils::Timer::timers.

Referenced by cmlabs::CleanShutdown::~CleanShutdown().

◆ closedir()

int cmlabs::closedir ( DIR * dir)

◆ ExtractFloatFromMessage()

float64 cmlabs::ExtractFloatFromMessage ( const char * name,
DataMessage * msg,
std::map< std::string, std::string > & mappings,
bool & ok )

◆ ExtractIntFromMessage()

int64 cmlabs::ExtractIntFromMessage ( const char * name,
DataMessage * msg,
std::map< std::string, std::string > & mappings,
bool & ok )

Read an integer field from a message, translating name through mappings first.

Parameters
nameLogical field name.
msgSource message.
mappingsLogical→actual field-name map.
[out]okSet false when the field is missing/not convertible.
Returns
Field value (0 when !ok).

Definition at line 22 of file Observations.cpp.

References cmlabs::DataMessage::getAsInt(), cmlabs::DataMessage::getContentType(), cmlabs::DataMessage::getInt(), and INTID.

Referenced by cmlabs::ObsInteger::extractDataFromMessage(), and cmlabs::ObsLocation::extractDataFromMessage().

◆ ExtractStringFromMessage()

std::string cmlabs::ExtractStringFromMessage ( const char * name,
DataMessage * msg,
std::map< std::string, std::string > & mappings,
bool & ok )

◆ ExtractTimeFromMessage()

uint64 cmlabs::ExtractTimeFromMessage ( const char * name,
DataMessage * msg,
std::map< std::string, std::string > & mappings,
bool & ok )

◆ freeXMLString()

XMLDLLENTRY void cmlabs::freeXMLString ( XMLSTR t)

References XMLDLLENTRY, and XMLSTR.

◆ GetDataTypeID()

uint32 cmlabs::GetDataTypeID ( const char * typeName)

Inverse of GetDataTypeName(): look up the numeric datatype id for a type name.

Parameters
typeNameNUL-terminated, case-insensitive type name.
Returns
Datatype id, or 0 when the name is not recognized.

Definition at line 142 of file Utils.cpp.

References CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, INTID, and stricmp.

◆ GetDataTypeName()

std::string cmlabs::GetDataTypeName ( uint32 datatype)

Translate a CMSDK datatype id (e.g.

from a DataMessage) into its human-readable name.

Parameters
datatypeNumeric datatype constant.
Returns
Type name such as "Message" or "Image"; an "unknown" string for unrecognized ids.

Definition at line 117 of file Utils.cpp.

References CHARDATAID, CHARDATAINFOID, CONSTCHARID, CONSTCHARINFOID, DATAMESSAGEID, DATAMESSAGEINFOID, DOUBLEID, INTID, and TIMEID.

◆ GetObsTypeFromRawData()

uint32 cmlabs::GetObsTypeFromRawData ( const char * data,
uint32 size )

Inspect a raw observation blob and return its OBSID_* type tag from the embedded ObsHeader.

Parameters
dataRaw blob.
sizeBlob size.
Returns
Type id or 0 when invalid.

Definition at line 15 of file Observations.cpp.

References OBSERVATIONID.

Referenced by Observations_UnitTest().

◆ Hash_UnitTest()

◆ HTTPServerTest()

◆ ImageResizeDown()

char * cmlabs::ImageResizeDown ( char * bytesource,
uint32 & cols,
uint32 & rows,
uint32 factor )

Shrink an RGBA image by an integer factor (box averaging).

Parameters
bytesourceSource pixels.
factorDivisor.
[in,out]cols,rowsUpdated dimensions.
Returns
Allocated buffer (caller frees).

Definition at line 3994 of file Bitmap.cpp.

References clmin.

Referenced by _wrap_ImageResizeDown(), _wrap_ImageResizeDown(), cmlabs::Bitmap::createResizedData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_ImageResizeDown().

◆ ImageResizeDown66()

char * cmlabs::ImageResizeDown66 ( char * bytesource,
uint32 & cols,
uint32 & rows )

Shrink an RGBA image to 2/3 size (3→2 pixel averaging).

Parameters
bytesourceSource pixels.
[in,out]cols,rowsDimensions, updated to the new size.
Returns
Allocated buffer (caller frees).

Definition at line 3622 of file Bitmap.cpp.

References GET_B_FROM_RGBA, GET_G_FROM_RGBA, GET_R_FROM_RGBA, and GET_RGB_FROM_RGBA.

Referenced by _wrap_ImageResizeDown66(), _wrap_ImageResizeDown66(), cmlabs::Bitmap::createResizedData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_ImageResizeDown66().

◆ ImageResizeUp()

char * cmlabs::ImageResizeUp ( char * bytesource,
uint32 & cols,
uint32 & rows,
uint32 factor )

Enlarge an RGBA image by an integer factor (pixel replication).

Parameters
bytesourceSource pixels.
factorMultiplier.
[in,out]cols,rowsUpdated dimensions.
Returns
Allocated buffer (caller frees).

Definition at line 4080 of file Bitmap.cpp.

References GET_RGB_FROM_RGBA.

Referenced by _wrap_ImageResizeUp(), _wrap_ImageResizeUp(), cmlabs::Bitmap::createResizedData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_ImageResizeUp().

◆ ImageResizeUp66()

char * cmlabs::ImageResizeUp66 ( char * bytesource,
uint32 & cols,
uint32 & rows )

Enlarge an RGBA image to 3/2 size (2→3 pixel interpolation).

Parameters
bytesourceSource pixels.
[in,out]cols,rowsUpdated dimensions.
Returns
Allocated buffer (caller frees).

Definition at line 3787 of file Bitmap.cpp.

References GET_RGB_FROM_RGBA.

Referenced by _wrap_ImageResizeUp66(), _wrap_ImageResizeUp66(), cmlabs::Bitmap::createResizedData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_ImageResizeUp66().

◆ Internal_BitmapPoster()

◆ Internal_MessageScript()

int8 cmlabs::Internal_MessageScript ( PsyAPI * api)

Plays back scripted TrackPlayerMessage sequences.

Definition at line 499 of file PsyInternal.cpp.

References cmlabs::TrackPlayerMessage::addEntry(), cmlabs::utils::Ascii2Float64(), cmlabs::utils::Ascii2Int64(), cmlabs::utils::Ascii2Uint32(), cmlabs::TrackPlayerMessage::delayMS, cmlabs::PsyAPI::emitSignal(), cmlabs::TrackPlayerMessage::entryMap, cmlabs::XMLResults::error, eXMLErrorFirstTagNotFound, eXMLErrorNone, cmlabs::TrackPlayerMessageEntry::FLOAT, cmlabs::XMLNode::getAttribute(), cmlabs::XMLNode::getChildNode(), cmlabs::PsyAPI::getParameterAsBool(), cmlabs::PsyAPI::getParameterString(), GetTimeAge(), GetTimeAgeMS(), GetTimeNow(), cmlabs::PsyAPI::hasParameter(), cmlabs::TrackPlayerMessageEntry::INT, cmlabs::TrackPlayerMessage::intervalMS, cmlabs::XMLNode::isEmpty(), cmlabs::PsyAPI::logPrint(), cmlabs::TrackPlayerMessage::MESSAGE, cmlabs::XMLResults::nColumn, cmlabs::TrackPlayerMessage::nextTime, cmlabs::XMLResults::nLine, cmlabs::TrackPlayerMessage::NONE, cmlabs::TrackPlayerMessage::postName, cmlabs::PsyAPI::postOutputMessage(), cmlabs::TrackPlayerMessage::postType, PrintTimeDifString(), cmlabs::DataMessage::setFloat(), cmlabs::DataMessage::setInt(), cmlabs::DataMessage::setString(), cmlabs::PsyAPI::shouldContinue(), cmlabs::TrackPlayerMessage::SIGNAL, stricmp, cmlabs::utils::TextStartsWith(), cmlabs::TrackPlayerMessage::TIME, cmlabs::TrackPlayerMessage::timeMS, cmlabs::TrackPlayerMessage::TRIGGER, cmlabs::TrackPlayerMessage::triggerType, and cmlabs::PsyAPI::waitForNewMessage().

Referenced by cmlabs::PsySpace::PsySpace().

◆ Internal_MessageToggler()

◆ Internal_MessageTypeConverter()

int8 cmlabs::Internal_MessageTypeConverter ( PsyAPI * api)

◆ Internal_Ping()

◆ Internal_Pong()

int8 cmlabs::Internal_Pong ( PsyAPI * api)

◆ Internal_Print()

◆ Internal_QueryTest()

◆ Internal_RetrieveTest()

◆ Internal_Shutdown()

int8 cmlabs::Internal_Shutdown ( PsyAPI * api)

◆ Internal_SignalPing()

◆ Internal_SignalPong()

◆ Internal_Simple()

int8 cmlabs::Internal_Simple ( PsyAPI * api)

◆ Internal_StatsLog()

◆ Internal_Time()

int8 cmlabs::Internal_Time ( PsyAPI * api)

◆ IsCMSDKTest()

bool cmlabs::IsCMSDKTest ( const char * name)
Returns
true if name is a registered CMSDK unit test.

Definition at line 120 of file UnitTest_CMSDK.cpp.

References cmlabs::UnitTestRunner::hasTest(), cmlabs::UnitTestRunner::instance(), and RegisterAllCMSDKTests().

◆ jsonEscape()

std::string cmlabs::jsonEscape ( const std::string & s)
static

Definition at line 673 of file UnitTestFramework.cpp.

◆ LongExecutorRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::LongExecutorRun ( THREAD_ARG arg)

Definition at line 584 of file RequestExecutor.cpp.

◆ MathClasses_UnitTest()

bool cmlabs::MathClasses_UnitTest ( )

◆ MemoryManagement()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::MemoryManagement ( THREAD_ARG arg)

Background maintenance thread entry point for MemoryManager / MemoryManagerX.

Parameters
argThe manager instance (cast internally).
Returns
Thread exit code.

Definition at line 743 of file MemoryManager.cpp.

◆ NetworkProtocols_UnitTest()

◆ Observations_UnitTest()

◆ ObservationTest()

bool cmlabs::ObservationTest ( )

Definition at line 8 of file Observations.cpp.

◆ opendir()

◆ PerfTest_CMSDK()

bool cmlabs::PerfTest_CMSDK ( )

Back-compatible entry: run the performance-oriented tests (legacy alias).

Definition at line 130 of file UnitTest_CMSDK.cpp.

References cmlabs::ProcessMemory::PerfTest().

◆ PrintDebug()

bool cmlabs::PrintDebug ( unsigned char subject,
unsigned char level,
const char * formatstring,
... )

Print a debug message if enabled for the subject.

Parameters
subjectOne of the CONSOLE_* subject ids.
levelImportance of this message; printed when <= the subject's debug level.
formatstringprintf format followed by variadic arguments.
Returns
true if the message was printed, false if filtered out or invalid.

Definition at line 71 of file ConsoleOutput.cpp.

References DebugLevel, and PrintFile().

◆ PrintError()

bool cmlabs::PrintError ( unsigned char level,
const char * formatstring,
... )

Print an error message if enabled.

Parameters
levelImportance of this error; printed when <= ::ErrorLevel.
formatstringprintf format followed by variadic arguments.
Returns
true if the message was printed, false if filtered out or invalid.

Definition at line 59 of file ConsoleOutput.cpp.

References ErrorLevel, and PrintFile().

◆ PrintFile()

bool cmlabs::PrintFile ( FILE * stream,
const char * formatstring,
... )

Print a printf-style formatted string to an arbitrary stdio stream.

Parameters
streamDestination stream (e.g. stdout, stderr or an open file).
formatstringprintf format followed by variadic arguments.
Returns
true on success, false if stream or formatstring is NULL.
Note
Not gated by any level; always prints. Thread-safety is that of the underlying stdio stream (individual fprintf calls are atomic on most platforms, but interleaving between calls can occur).

Definition at line 38 of file ConsoleOutput.cpp.

Referenced by PrintDebug(), PrintError(), and PrintVerbose().

◆ PrintVerbose()

bool cmlabs::PrintVerbose ( unsigned char subject,
unsigned char level,
const char * formatstring,
... )

Print a verbose (informational) message if enabled for the subject.

Parameters
subjectOne of the CONSOLE_* subject ids.
levelImportance of this message; printed when <= the subject's verbose level.
formatstringprintf format followed by variadic arguments.
Returns
true if the message was printed, false if filtered out or invalid.

Definition at line 47 of file ConsoleOutput.cpp.

References PrintFile(), and VerboseLevel.

◆ ProcessMemoryPerfTest()

◆ PsySpaceContinuousRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::PsySpaceContinuousRun ( THREAD_ARG arg)

Continuous-component thread entry: runs PsySpace::runContinuousComponent() for the space passed in arg.

Thread entry for continuously running components.

See also
PsySpaceContinuousRun()

Definition at line 1173 of file PsySpace.cpp.

Referenced by _wrap_PsySpaceContinuousRun(), _wrap_PsySpaceContinuousRun(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PsySpaceContinuousRun().

◆ PsySpacePoolRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::PsySpacePoolRun ( THREAD_ARG arg)

Pool worker-thread entry: runs PsySpace::threadPoolDispatch() for the space passed in arg.

Thread entry for pool worker threads.

See also
PsySpacePoolRun()

Definition at line 1168 of file PsySpace.cpp.

Referenced by _wrap_PsySpacePoolRun(), _wrap_PsySpacePoolRun(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PsySpacePoolRun().

◆ PsySpaceRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::PsySpaceRun ( THREAD_ARG arg)

Main service-thread entry: runs PsySpace::run() for the space passed in arg.

Thread entry for the space's main service thread.

See also
PsySpaceRun()

Definition at line 1162 of file PsySpace.cpp.

Referenced by _wrap_PsySpaceRun(), _wrap_PsySpaceRun(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PsySpaceRun().

◆ QueueTest()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::QueueTest ( THREAD_ARG arg)
static

Definition at line 1698 of file ProcessMemory.cpp.

Referenced by cmlabs::ProcessMemory::UnitTest().

◆ readdir()

◆ Register_Base64_Tests()

void cmlabs::Register_Base64_Tests ( )

◆ Register_Bitmap_Tests()

void cmlabs::Register_Bitmap_Tests ( )

◆ Register_ComponentData_Tests()

void cmlabs::Register_ComponentData_Tests ( )

◆ Register_ComponentMemory_Tests()

void cmlabs::Register_ComponentMemory_Tests ( )

◆ Register_ControlMessage_Tests()

void cmlabs::Register_ControlMessage_Tests ( )

◆ Register_DataMessage_Tests()

void cmlabs::Register_DataMessage_Tests ( )

◆ Register_Hash_Tests()

void cmlabs::Register_Hash_Tests ( )

◆ Register_HTML_Tests()

void cmlabs::Register_HTML_Tests ( )

◆ Register_MathClasses_Tests()

void cmlabs::Register_MathClasses_Tests ( )

◆ Register_MemoryManager_Tests()

◆ Register_MemoryRequestServer_Tests()

void cmlabs::Register_MemoryRequestServer_Tests ( )

◆ Register_MessageIndex_Tests()

void cmlabs::Register_MessageIndex_Tests ( )

◆ Register_MovingAverage_Tests()

void cmlabs::Register_MovingAverage_Tests ( )

◆ Register_NetworkManager_Tests()

◆ Register_NetworkProtocols_Tests()

void cmlabs::Register_NetworkProtocols_Tests ( )

◆ Register_Observations_Tests()

void cmlabs::Register_Observations_Tests ( )

Register the Observations tests with the unit test framework.

Definition at line 327 of file Observations.cpp.

References cmlabs::UnitTestRunner::instance(), Observations_UnitTest(), and cmlabs::UnitTestRunner::registerTest().

Referenced by RegisterAllCMSDKTests().

◆ Register_ProcessMemory_Tests()

◆ Register_PsyTime_Tests()

void cmlabs::Register_PsyTime_Tests ( )

◆ Register_RequestClient_Tests()

void cmlabs::Register_RequestClient_Tests ( )

◆ Register_RequestGateway_Tests()

void cmlabs::Register_RequestGateway_Tests ( )

◆ Register_RESTParser_Tests()

void cmlabs::Register_RESTParser_Tests ( )

◆ Register_Stats_Tests()

void cmlabs::Register_Stats_Tests ( )

◆ Register_Subscriptions_Tests()

void cmlabs::Register_Subscriptions_Tests ( )

◆ Register_TemporalMemory_Tests()

void cmlabs::Register_TemporalMemory_Tests ( )

◆ Register_ThreadManager_Tests()

void cmlabs::Register_ThreadManager_Tests ( )

◆ Register_Utils_Tests()

void cmlabs::Register_Utils_Tests ( )

◆ Register_VantagePoints_Tests()

void cmlabs::Register_VantagePoints_Tests ( )

◆ Register_XMLParser_Tests()

void cmlabs::Register_XMLParser_Tests ( )

Referenced by RegisterAllCMSDKTests().

◆ RegisterAllCMSDKTests()

◆ rewinddir()

void cmlabs::rewinddir ( DIR * dir)

◆ RunCMSDKTests()

bool cmlabs::RunCMSDKTests ( const char * name,
const char * compareFile,
const char * outFile,
const char * outDir,
bool verbose,
bool listOnly,
bool forkPerTest = true )

Full configurable entry used by the Psyclone test= dispatch.

Parameters
nameNULL/"cmsdk"/"sdk"/"all" runs every test; otherwise the one named.
compareFilePrevious perf JSON to compare against (may be NULL).
outFileExplicit perf JSON output path (NULL = timestamped + latest).
outDirDirectory for the default output files (NULL = ".").
verboseShow verbose diagnostics.
listOnlyJust list the available tests and return.
forkPerTestRun each test in its own process where supported.
Returns
true only if every test that ran passed.

Definition at line 101 of file UnitTest_CMSDK.cpp.

References cmlabs::UnitTestRunner::instance(), cmlabs::UnitTestRunner::listTests(), RegisterAllCMSDKTests(), cmlabs::UnitTestRunner::runAll(), cmlabs::UnitTestRunner::runOne(), cmlabs::UnitTestRunner::setCompareFile(), cmlabs::UnitTestRunner::setForkPerTest(), cmlabs::UnitTestRunner::setOutputDir(), cmlabs::UnitTestRunner::setOutputFile(), cmlabs::UnitTestRunner::setVerbose(), and stricmp.

Referenced by UnitTest_CMSDK().

◆ SetDebugLevel() [1/2]

bool cmlabs::SetDebugLevel ( unsigned char level)

Set the debug level for all subjects at once.

Parameters
levelNew debug level; messages with a level <= this value are printed. 0 disables debug output.
Returns
true always.

Definition at line 9 of file ConsoleOutput.cpp.

References CONSOLE_COUNT, and DebugLevel.

◆ SetDebugLevel() [2/2]

bool cmlabs::SetDebugLevel ( unsigned char subject,
unsigned char level )

Set the debug level for a single subject.

Parameters
subjectOne of the CONSOLE_* subject ids (1..CONSOLE_COUNT).
levelNew debug level for that subject.
Returns
true on success, false if subject is out of range.

Definition at line 14 of file ConsoleOutput.cpp.

References CONSOLE_COUNT, and DebugLevel.

◆ SetErrorLevel()

bool cmlabs::SetErrorLevel ( unsigned char level)

Set the global error output level.

Parameters
levelNew error level threshold; 0 silences error output.
Returns
true always.

Definition at line 33 of file ConsoleOutput.cpp.

References ErrorLevel.

◆ SetVerboseLevel() [1/2]

bool cmlabs::SetVerboseLevel ( unsigned char level)

Set the verbose level for all subjects at once.

Parameters
levelNew verbose level; 0 silences verbose output.
Returns
true always.

Definition at line 21 of file ConsoleOutput.cpp.

References CONSOLE_COUNT, and VerboseLevel.

◆ SetVerboseLevel() [2/2]

bool cmlabs::SetVerboseLevel ( unsigned char subject,
unsigned char level )

Set the verbose level for a single subject.

Parameters
subjectOne of the CONSOLE_* subject ids (1..CONSOLE_COUNT).
levelNew verbose level for that subject.
Returns
true on success, false if subject is out of range.

Definition at line 26 of file ConsoleOutput.cpp.

References CONSOLE_COUNT, and VerboseLevel.

◆ ShortExecutorRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::ShortExecutorRun ( THREAD_ARG arg)

Definition at line 579 of file RequestExecutor.cpp.

◆ SSLCheckBufferForCompatibility()

bool cmlabs::SSLCheckBufferForCompatibility ( const char * buffer,
uint32 length )

Definition at line 41 of file NetworkConnections.cpp.

References cmlabs::utils::stristr().

◆ SSLConnectionRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::SSLConnectionRun ( THREAD_ARG arg)

Definition at line 2785 of file NetworkConnections.cpp.

◆ StopProcessTestThread()

◆ stringDup()

XMLDLLENTRY XMLSTR cmlabs::stringDup ( XMLCSTR source,
int cbData = 0 )

References XMLCSTR, XMLDLLENTRY, and XMLSTR.

◆ Test_RequestClient()

◆ Test_RequestGateway()

bool cmlabs::Test_RequestGateway ( )
static

Definition at line 2888 of file RequestGateway.cpp.

References cmlabs::RequestGateway::UnitTest().

Referenced by Register_RequestGateway_Tests().

◆ Test_Timer()

bool cmlabs::Test_Timer ( )
static

Definition at line 8362 of file Utils.cpp.

References cmlabs::utils::UnitTest_Timer().

Referenced by Register_Utils_Tests().

◆ Test_Utils()

bool cmlabs::Test_Utils ( )
static

Definition at line 8361 of file Utils.cpp.

References cmlabs::utils::UnitTest_Utils().

Referenced by Register_Utils_Tests().

◆ TestMemoryCommander()

bool cmlabs::TestMemoryCommander ( )

Self-test hook for the memory commander.

Returns
true if all checks pass.

◆ TestRequestClientRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::TestRequestClientRun ( THREAD_ARG arg)

Definition at line 1112 of file RequestClient.cpp.

◆ TestSSL()

int cmlabs::TestSSL ( int port)

Standalone smoke test for the SSL server functionality.

Parameters
portTCP port to listen on for the test.
Returns
0 on success, non-zero on failure. Blocking call.

Definition at line 236 of file PsySSL.cpp.

◆ TestThreadManager()

bool cmlabs::TestThreadManager ( )

Legacy standalone smoke test for ThreadManager (predates the UnitTestRunner framework).

References THREAD_FUNCTION_CALL, and THREAD_RET.

◆ TestWebRequestClientRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::TestWebRequestClientRun ( THREAD_ARG arg)

Definition at line 1256 of file RequestClient.cpp.

◆ TestWebSocketRequestClientRun()

THREAD_RET THREAD_FUNCTION_CALL cmlabs::TestWebSocketRequestClientRun ( THREAD_ARG arg)

Definition at line 1416 of file RequestClient.cpp.

◆ TestWebsocketRoundTrip()

◆ ToLowerHex()

std::string cmlabs::ToLowerHex ( const std::string & s)
static

Definition at line 31 of file HashTest.cpp.

Referenced by CheckHex().

◆ TypePageID() [1/7]

uint16 cmlabs::TypePageID ( ContextMapEntry * e)
inline

Definition at line 227 of file MemoryMaps.h.

References ID_CONTEXTMAPPAGE.

◆ TypePageID() [2/7]

uint16 cmlabs::TypePageID ( CrankMapEntry * e)
inline

Definition at line 226 of file MemoryMaps.h.

References ID_CRANKMAPPAGE.

◆ TypePageID() [3/7]

uint16 cmlabs::TypePageID ( ProcessMapEntry * e)
inline

Definition at line 224 of file MemoryMaps.h.

References ID_PROCESSMAPPAGE.

◆ TypePageID() [4/7]

uint16 cmlabs::TypePageID ( QueueMapEntry * e)
inline

Definition at line 223 of file MemoryMaps.h.

References ID_QUEUEMAPPAGE.

◆ TypePageID() [5/7]

uint16 cmlabs::TypePageID ( RequestMapEntry * e)
inline

Definition at line 225 of file MemoryMaps.h.

References ID_REQUESTMAPPAGE.

◆ TypePageID() [6/7]

uint16 cmlabs::TypePageID ( TopicMapEntry * e)
inline

Definition at line 221 of file MemoryMaps.h.

References ID_TOPICMAPPAGE.

◆ TypePageID() [7/7]

uint16 cmlabs::TypePageID ( TypeMapEntry * e)
inline

Definition at line 220 of file MemoryMaps.h.

References ID_TYPEMAPPAGE.

◆ UnitTest_CMSDK()

bool cmlabs::UnitTest_CMSDK ( )

Back-compatible entry: run the full suite with default settings.

Definition at line 126 of file UnitTest_CMSDK.cpp.

References RunCMSDKTests().

Referenced by main().

◆ ut_clearSegmentsIn()

void cmlabs::ut_clearSegmentsIn ( const char * dir,
const char * prefix )
static

Definition at line 50 of file UnitTestFramework.cpp.

References closedir(), cmlabs::dirent::d_name, opendir(), and readdir().

Referenced by ClearStaleTestSegments().

◆ ut_escape_field()

std::string cmlabs::ut_escape_field ( const std::string & s)
static

Definition at line 366 of file UnitTestFramework.cpp.

Referenced by ut_writeChildResult().

◆ ut_installTimeoutTraceHandler()

void cmlabs::ut_installTimeoutTraceHandler ( const std::string & tracePath)
static

Definition at line 93 of file UnitTestFramework.cpp.

References ut_timeoutTraceHandler(), and ut_traceFd.

◆ ut_printTraceFile()

void cmlabs::ut_printTraceFile ( const std::string & path)
static

Definition at line 114 of file UnitTestFramework.cpp.

◆ ut_readChildResult()

◆ ut_readProgressNote()

std::string cmlabs::ut_readProgressNote ( const std::string & path)
static

Definition at line 100 of file UnitTestFramework.cpp.

◆ ut_timeoutTraceHandler()

void cmlabs::ut_timeoutTraceHandler ( int )
static

Definition at line 85 of file UnitTestFramework.cpp.

References ut_traceFd.

Referenced by ut_installTimeoutTraceHandler().

◆ ut_writeChildResult()

Variable Documentation

◆ CleanShutdownInstance

CleanShutdown cmlabs::CleanShutdownInstance

Definition at line 33 of file Utils.cpp.

◆ CleanShutdownInstanceCount

uint32 cmlabs::CleanShutdownInstanceCount = 0

◆ ColorMap

const std::map<std::string, std::array<uint8, 3> > cmlabs::ColorMap

Lookup table mapping ~200 CSS/X11 color names (with and without spaces) to 8-bit RGB triplets; used by Color(const char*).

Definition at line 29 of file MathClasses.h.

◆ CTRL_LOGPRINT

struct PsyType cmlabs::CTRL_LOGPRINT = { { 1,10002,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static

Definition at line 84 of file ObjectIDs.h.

Referenced by cmlabs::PsySpace::logEntry().

◆ CTRL_PING

struct PsyType cmlabs::CTRL_PING = { { 1,10003,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static

Definition at line 85 of file ObjectIDs.h.

◆ CTRL_PING_REPLY

struct PsyType cmlabs::CTRL_PING_REPLY = { { 1,10004,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static

Definition at line 86 of file ObjectIDs.h.

◆ CTRL_TEST

◆ DebugLevel

unsigned char cmlabs::DebugLevel[5] = {0,0,0,0,0}
static

Current debug level per subject (index = subject-1).

Default 0 (debug output off). Per-translation-unit copy.

Definition at line 51 of file ConsoleOutput.h.

Referenced by PrintDebug(), SetDebugLevel(), and SetDebugLevel().

◆ DebugSubjects

const char* cmlabs::DebugSubjects[] = { "debug-system", "debug-network", "debug-node", "debug-process", "debug-component" }
static

Spec attribute names for per-subject debug levels, indexed by subject-1.

Definition at line 47 of file ConsoleOutput.h.

◆ ErrorLevel

unsigned char cmlabs::ErrorLevel = 1
static

Current error level threshold.

Default 1 (errors printed). Per-translation-unit copy.

Definition at line 53 of file ConsoleOutput.h.

Referenced by PrintError(), and SetErrorLevel().

◆ g_processTestStop

volatile bool cmlabs::g_processTestStop = false
static

◆ g_processTestThreadID

uint32 cmlabs::g_processTestThreadID = 0
static

◆ g_registered

bool cmlabs::g_registered = false
static

Definition at line 54 of file UnitTest_CMSDK.cpp.

Referenced by RegisterAllCMSDKTests().

◆ HTTP_Status

char cmlabs::HTTP_Status[][128]
static
Initial value:
=
{
"HTTP/1.1 200 OK",
"HTTP/1.1 301 Moved Permanently",
"HTTP/1.1 304 Use Local Copy",
"HTTP/1.1 400 Bad Request <H1>Malformed URL</H1>",
"HTTP/1.1 401 Unauthorized",
"HTTP/1.1 403 Access Denied",
"HTTP/1.1 404 Object Not Found",
"HTTP/1.1 500 Internal Server Error <H1>Error while creating page</H1>",
"HTTP/1.1 501 Not Implemented <H1>Not implemented</H1>",
"HTTP/1.1 503 Service Unavailable <H1>Service Unavailable</H1>",
"HTTP/1.1 504 Gateway Timeout <H1>Gateway Timeout</H1>",
"HTTP/1.1 500 Internal Server Error <H1>Server unavailable</H1>",
"HTTP/1.1 500 Internal Server Error <H1>No reply from server</H1>",
"HTTP/1.1 500 Internal Server Error <H1>Malformed server reply</H1>",
"HTTP/1.1 101 Switching Protocols"
}

Full HTTP status lines (with inline error bodies for error cases), indexed by the HTTP_* status ids above.

Definition at line 652 of file NetworkProtocols.h.

Referenced by cmlabs::HTTPReply::createAuthorizationReply(), cmlabs::HTTPReply::createErrorPage(), cmlabs::HTTPReply::createPage(), cmlabs::HTTPReply::createWebsocketHTTPReply(), and cmlabs::RequestGateway::replyToClient().

◆ HTTP_Type

char cmlabs::HTTP_Type[][8]
static
Initial value:
=
{
"",
"GET",
"PUT",
"POST",
"HEAD",
"DELETE",
"OPTIONS"
}

HTTP method name strings, indexed by the HTTP_* method ids (index 0 unused).

Definition at line 101 of file NetworkProtocols.h.

Referenced by cmlabs::HTTPRequest::createMultipartRequest(), cmlabs::HTTPRequest::createRequest(), cmlabs::HTTPRequest::createRequest(), cmlabs::HTTPRequest::createRequest(), cmlabs::RESTParser::parseRequest(), cmlabs::RESTParser::parseRequest(), and cmlabs::CallLogEntry::toJSON().

◆ IsSSLInitialised

bool cmlabs::IsSSLInitialised = false

Definition at line 1704 of file NetworkConnections.cpp.

Referenced by cmlabs::SSLConnection::SSLConnection().

◆ ut_traceFd

int cmlabs::ut_traceFd = -1
static

Definition at line 84 of file UnitTestFramework.cpp.

Referenced by ut_installTimeoutTraceHandler(), and ut_timeoutTraceHandler().

◆ VerboseLevel

unsigned char cmlabs::VerboseLevel[5] = {1,1,1,1,1}
static

Current verbose level per subject (index = subject-1).

Default 1 (basic verbosity on). Per-translation-unit copy.

Definition at line 49 of file ConsoleOutput.h.

Referenced by PrintVerbose(), SetVerboseLevel(), and SetVerboseLevel().

◆ VerboseSubjects

const char* cmlabs::VerboseSubjects[] = { "verbose-system", "verbose-network", "verbose-node", "verbose-process", "verbose-component" }
static

Spec attribute names for per-subject verbose levels, indexed by subject-1.

Definition at line 45 of file ConsoleOutput.h.