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

Core fixed-width scalar typedefs and the PsyType / PsyContext hierarchical identifiers. More...

#include "Standard.h"
#include <stdio.h>
#include <cstdint>
#include <string.h>
Include dependency graph for Types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PsyType
 Hierarchical message type identifier — the key used for publish/subscribe matching in Psyclone. More...
struct  PsyContext
 Hierarchical execution-context identifier. More...

Macros

#define CNSPRIORITY   90
#define FACTORYPRIORITY   90
#define BITFREE   1
#define BITOCCUPIED   0
#define INT32_NOVALUE   0x12345678
#define INT64_NOVALUE   0x123456789ABCDEF0L
#define FLOAT64_NOVALUE   0.123456789123456789
#define MAXVALUINT8   ((uint8)~((uint8)0))
#define MAXVALINT8   ((int8)(MAXVALUINT8 >> 1))
#define MAXVALUINT16   ((uint16)~((uint16)0))
#define MAXVALINT16   ((int16)(MAXVALUINT16 >> 1))
#define MAXVALUINT32   ((uint32)~((uint32)0))
#define MAXVALINT32   ((int32)(MAXVALUINT32 >> 1))
#define MAXVALUINT64   ((uint64)~((uint64)0))
#define MAXVALINT64   ((int64)(MAXVALUINT64 >> 1))
#define MERGEUINT3264(a, b)
#define GET1UINT3264(a)
#define GET2UINT3264(a)
#define MERGEUINT1632(a, b)
#define GET1UINT1632(a)
#define GET2UINT1632(a)
#define PSYTYPELEVELS   16
 Number of hierarchy levels in a PsyType.
#define PSYCONTEXTLEVELS   16
 Number of hierarchy levels in a PsyContext.
#define CONTEXT_OTHER_ROOT   0
 compare(): the contexts differ already at the root level.
#define CONTEXT_EQUAL   1
 compare(): the contexts are equal (up to wildcards).
#define CONTEXT_SUPERSEDES   2
 compare(): this context is more specific than / supersedes the other.
#define CONTEXT_INCLUDED   3
 compare(): this context is more general and includes the other.

Variables

static struct PsyType NOTYPE = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
 The empty/unset message type (isValid() == false).
static struct PsyContext NOCONTEXT = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
 The empty/unset context (isValid() == false).

Detailed Description

Core fixed-width scalar typedefs and the PsyType / PsyContext hierarchical identifiers.

This file defines the CMSDK-wide, architecture-independent integer and floating point types (int8..int64, uint8..uint64, float32/float64) selected via the ARCH_32 / ARCH_64 build defines, plus the two central hierarchical identifier structs used throughout Psyclone: PsyType (message types) and PsyContext (execution contexts). Both structs are plain fixed-size PODs so they can be embedded directly in wire/shared-memory structures such as DataMessageHeader.

PLATFORM DIFFERENCES: on 64-bit builds, Windows maps int64/uint64 to (unsigned) long long while other platforms use int64_t/uint64_t from <cstdint>; the sizes are identical, only the underlying compiler types (and hence printf format expectations) differ — which is also why the -Wformat warning is suppressed on non-Windows GCC builds.

Definition in file Types.h.

Macro Definition Documentation

◆ BITFREE

◆ BITOCCUPIED

◆ CNSPRIORITY

#define CNSPRIORITY   90

Definition at line 30 of file Types.h.

◆ CONTEXT_EQUAL

#define CONTEXT_EQUAL   1

compare(): the contexts are equal (up to wildcards).

Definition at line 407 of file Types.h.

Referenced by PsyContext::compare().

◆ CONTEXT_INCLUDED

#define CONTEXT_INCLUDED   3

compare(): this context is more general and includes the other.

Definition at line 409 of file Types.h.

Referenced by PsyContext::compare().

◆ CONTEXT_OTHER_ROOT

#define CONTEXT_OTHER_ROOT   0

compare(): the contexts differ already at the root level.

Definition at line 406 of file Types.h.

Referenced by PsyContext::compare().

◆ CONTEXT_SUPERSEDES

#define CONTEXT_SUPERSEDES   2

compare(): this context is more specific than / supersedes the other.

Definition at line 408 of file Types.h.

Referenced by PsyContext::compare().

◆ FACTORYPRIORITY

#define FACTORYPRIORITY   90

Definition at line 31 of file Types.h.

◆ FLOAT64_NOVALUE

#define FLOAT64_NOVALUE   0.123456789123456789

◆ GET1UINT1632

#define GET1UINT1632 ( a)
Value:
(uint16)((a & 0xffff0000L)>>16)

Definition at line 96 of file Types.h.

◆ GET1UINT3264

#define GET1UINT3264 ( a)
Value:
(uint32)((a & 0xffffffff00000000L)>>32)

Definition at line 93 of file Types.h.

◆ GET2UINT1632

#define GET2UINT1632 ( a)
Value:
(uint16)(a & 0x0000ffffL)

Definition at line 97 of file Types.h.

◆ GET2UINT3264

#define GET2UINT3264 ( a)
Value:
(uint32)(a & 0x00000000ffffffffL)

Definition at line 94 of file Types.h.

◆ INT32_NOVALUE

#define INT32_NOVALUE   0x12345678

Definition at line 79 of file Types.h.

◆ INT64_NOVALUE

#define INT64_NOVALUE   0x123456789ABCDEF0L

◆ MAXVALINT16

#define MAXVALINT16   ((int16)(MAXVALUINT16 >> 1))

Definition at line 86 of file Types.h.

◆ MAXVALINT32

#define MAXVALINT32   ((int32)(MAXVALUINT32 >> 1))

Definition at line 88 of file Types.h.

◆ MAXVALINT64

#define MAXVALINT64   ((int64)(MAXVALUINT64 >> 1))

Definition at line 90 of file Types.h.

◆ MAXVALINT8

#define MAXVALINT8   ((int8)(MAXVALUINT8 >> 1))

Definition at line 84 of file Types.h.

◆ MAXVALUINT16

#define MAXVALUINT16   ((uint16)~((uint16)0))

Definition at line 85 of file Types.h.

Referenced by cmlabs::utils::GetFirstFreeBitLocN(), and cmlabs::utils::SetBitN().

◆ MAXVALUINT32

◆ MAXVALUINT64

#define MAXVALUINT64   ((uint64)~((uint64)0))

Definition at line 89 of file Types.h.

◆ MAXVALUINT8

#define MAXVALUINT8   ((uint8)~((uint8)0))

Definition at line 83 of file Types.h.

◆ MERGEUINT1632

#define MERGEUINT1632 ( a,
b )
Value:
(((uint32)a)<<16)|((uint32)b)

Definition at line 95 of file Types.h.

◆ MERGEUINT3264

#define MERGEUINT3264 ( a,
b )
Value:
(((uint64)a)<<32)|((uint64)b)

Definition at line 92 of file Types.h.

◆ PSYCONTEXTLEVELS

◆ PSYTYPELEVELS

#define PSYTYPELEVELS   16

Variable Documentation

◆ NOCONTEXT

struct PsyContext NOCONTEXT = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static

◆ NOTYPE

struct PsyType NOTYPE = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
static

The empty/unset message type (isValid() == false).

Definition at line 436 of file Types.h.

Referenced by cmlabs::DataMessage::getType(), cmlabs::PsyAPI::postOutputMessage(), and cmlabs::MessagePlayer::waitForNextMessage().