11#include "dawn/debug.hxx"
12#include "dawn/porting/config.hxx"
26 constexpr static size_t PRIV_MAX = 0b11111111111111;
27 constexpr static size_t PRIV_SHIFT = 0;
28 constexpr static size_t FLAGS_MAX = 0b11;
29 constexpr static size_t FLAGS_SHIFT = 14;
30 constexpr static size_t DTYPE_MAX = 0b1111;
31 constexpr static size_t DTYPE_SHIFT = 16;
32 constexpr static size_t EXT_MAX = 0b1;
33 constexpr static size_t EXT_SHIFT = 20;
34 constexpr static size_t CLS_MAX = 0b111111111;
35 constexpr static size_t CLS_SHIFT = 21;
36 constexpr static size_t CLS_MASK = (CLS_MAX << CLS_SHIFT);
37 constexpr static size_t TYPE_MAX = 0b11;
38 constexpr static size_t TYPE_SHIFT = 30;
39 constexpr static size_t TYPE_MASK = (TYPE_MAX << TYPE_SHIFT);
40 constexpr static size_t fCLS_ANY = 0;
296 DEBUGASSERT(type <= TYPE_MAX);
297 DEBUGASSERT(cls <= CLS_MAX);
298 DEBUGASSERT(dtype <= DTYPE_MAX);
301 return (((type & TYPE_MAX) << TYPE_SHIFT) | ((cls & CLS_MAX) << CLS_SHIFT) |
302 ((dtype & DTYPE_MAX) << DTYPE_SHIFT) | ((flags & FLAGS_MAX) << FLAGS_SHIFT) |
315 return ((objid >> PRIV_SHIFT) &
PRIV_MAX);
327 return ((objid >> FLAGS_SHIFT) & FLAGS_MAX);
339 return ((objid >> DTYPE_SHIFT) & DTYPE_MAX);
351 return ((objid >> CLS_SHIFT) & CLS_MAX);
363 return ((objid >> TYPE_SHIFT) & TYPE_MAX);
377 return objid & (~PRIV_MAX);
463 return (objid & TYPE_MASK) | (objid & CLS_MASK);
Out-of-tree user-extension hooks for Dawn.
32-bit encoded Object ID with type, class, data type, and instance.
static bool objectIsProto(const ObjectId objid)
Check if object is Protocol type (raw 32-bit version).
static uint16_t objectIdGetCls(const ObjectId objid)
Extract object class from ObjectID.
EObjectIdType
Object types in the Dawn framework.
@ OBJTYPE_PROTO
Protocol object type.
@ OBJTYPE_LAST
Sentinel value (last valid type + 1).
@ OBJTYPE_IO
Input/Output object type.
@ OBJTYPE_PROG
Program/algorithm object type.
@ OBJTYPE_ANY
Wildcard/metadata object type.
static const char * dtypeToString(uint8_t dtype)
Convert data type to human-readable string.
static bool objectIsIO(const UObjectId &objid)
Check if object is I/O type (union structure version).
static ObjectId objectMask(const ObjectId objid)
Extract type and class mask from ObjectID.
static uint8_t objectIdGetType(const ObjectId objid)
Extract object type from ObjectID.
static bool objectIsProto(const UObjectId &objid)
Check if object is Protocol type (raw 32-bit version).
static uint16_t objectIdGetId(const ObjectId objid)
Extract instance/private field from ObjectID.
EObjectDataType
Data types supported by Dawn framework.
@ DTYPE_FLOAT
IEEE 754 single-precision floating point (32-bit).
@ DTYPE_INT32
Signed 32-bit integer (-2147483648 to 2147483647).
@ DTYPE_UINT8
Unsigned 8-bit integer (0 to 255).
@ DTYPE_INT16
Signed 16-bit integer (-32768 to 32767).
@ DTYPE_INT8
Signed 8-bit integer (-128 to 127).
@ DTYPE_ANY
Wildcard data type (matches any actual type).
@ DTYPE_BLOCK
Opaque block/byte-stream data type.
@ DTYPE_UINT64
Unsigned 64-bit integer.
@ DTYPE_UINT16
Unsigned 16-bit integer (0 to 65535).
@ DTYPE_UB16
Unsigned 16.16 fixed-point (32-bit).
@ DTYPE_DOUBLE
IEEE 754 double-precision floating point (64-bit).
@ DTYPE_CHAR
Character/string type (null-terminated, 4-byte aligned).
@ DTYPE_INT64
Signed 64-bit integer.
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
@ DTYPE_BOOL
Boolean data type (stored in 32-bit container).
@ DTYPE_LAST
Sentinel value (last valid type + 1).
@ DTYPE_B16
Signed 16.16 fixed-point (32-bit).
static uint32_t objectIdGetNoId(const ObjectId objid)
Extract "type-agnostic" ObjectID (zero instance field).
static uint8_t objectIdGetDtype(const ObjectId objid)
Extract data type field from ObjectID.
static size_t PRIV_MAX
Bit field constants and shift positions for ObjectID extraction.
static bool objectIsProg(const ObjectId objid)
Check if object is Program type (raw 32-bit version).
uint64_t ObjectIdExt
Extended ObjectID type - future 64-bit support.
static bool isDtypeSupported(uint8_t dtype)
Check if a data type is enabled in build configuration.
uint32_t ObjectId
ObjectID type - single 32-bit value.
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.
static bool objectIsProg(const UObjectId &objid)
Check if object is Program type (raw 32-bit version).
static bool objectIsIO(const ObjectId objid)
Check if object is I/O type (union structure version).
static int getDtypeSize_(const EObjectDataType dtype)
Get byte size for a specific data type.
static uint8_t objectIdGetFlags(const ObjectId objid)
Extract type-specific flags from ObjectID.
32-bit encoded object identifier (union with bit field).
uint32_t priv
Instance/private data field (bits 0-13, max 16383).
ObjectId v
Raw 32-bit ObjectID value (for comparison, hashing, storage).
uint32_t dtype
Data type field (bits 16-19, see EObjectDataType).
uint32_t type
Object type field (bits 30-31, see EObjectIdType).
uint32_t cls
Object class field (bits 21-29, max 511).
uint32_t flags
Type-specific flags (bits 14-15, max 3).
uint32_t ext
Extension flag (bit 20).
struct dawn::SObjectId::UObjectId::@14 s
Bit-field structure for named member access.