FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kAlgMsg.h
Go to the documentation of this file.
1 
8 #ifndef K_FIRESYNC_ALG_MSG_H
9 #define K_FIRESYNC_ALG_MSG_H
10 
11 #include <kFireSync/Data/kMsgSet.h>
12 
14 #define kALG_MSG_MAX_PARTS (4)
15 
17 #include <kFireSync/Data/kAlgMsg.x.h>
18 
37 //typedef kMsgSet kAlgMsg; --forward-declared in kFsDef.x.h
38 
47 {
48  kObj(kAlgMsg, msg);
49 
50  return obj->frameCount;
51 }
52 
61 {
62  kObj(kAlgMsg, msg);
63 
64  return obj->partCount;
65 }
66 
76 {
77  kObj(kAlgMsg, msg);
78 
79  kAssert(partIndex < obj->partCount);
80 
81  return xkAlgMsg_DescriptorAt(msg, partIndex)->itemType;
82 }
83 
93 {
94  kObj(kAlgMsg, msg);
95 
96  kAssert(partIndex < obj->partCount);
97 
98  return xkAlgMsg_DescriptorAt(msg, partIndex)->dimensionCount;
99 }
100 
110 kInlineFx(kSize) kAlgMsg_PartLength(kAlgMsg msg, kSize partIndex, kSize dimensionIndex)
111 {
112  kObj(kAlgMsg, msg);
113 
114  kAssert(partIndex < obj->partCount);
115  kAssert(dimensionIndex < xkAlgMsg_DescriptorAt(msg, partIndex)->dimensionCount);
116 
117  return xkAlgMsg_DescriptorAt(msg, partIndex)->length[dimensionIndex];
118 }
119 
129 kInlineFx(void*) kAlgMsg_Part(kAlgMsg msg, kSize frameIndex, kSize partIndex)
130 {
131  kObj(kAlgMsg, msg);
132 
133  kAssert(frameIndex < obj->frameCount);
134  kAssert(partIndex < obj->partCount);
135 
136  return obj->parts[frameIndex*kAlgMsg_PartCount(msg) + partIndex];
137 }
138 
152 #define kAlgMsg_PartT(kAlgMsg_msg, kSize_frameIndex, kSize_partIndex, T) \
153  kCast(T*, xkAlgMsg_PartT(kAlgMsg_msg, kSize_frameIndex, kSize_partIndex, sizeof(T)))
154 
155 #endif
kSize kAlgMsg_PartDimensionCount(kAlgMsg msg, kSize partIndex)
Reports the dimensionality of the specified content part.
Definition: kAlgMsg.h:92
Declares the kMsgSet type.
kSize kAlgMsg_PartLength(kAlgMsg msg, kSize partIndex, kSize dimensionIndex)
Reports the length of the specified part dimension.
Definition: kAlgMsg.h:110
Abstract base class for algorithm data messages.
#define kInlineFx(TYPE)
kType kAlgMsg_PartType(kAlgMsg msg, kSize partIndex)
Reports the data type of the specified content part.
Definition: kAlgMsg.h:75
#define kObj(TypeName_T, T_object)
kSize kAlgMsg_PartCount(kAlgMsg msg)
Reports the number of content parts for each frame.
Definition: kAlgMsg.h:60
#define kAssert(EXPRESSION)
kSize kAlgMsg_FrameCount(kAlgMsg msg)
Reports the number of frames in the message.
Definition: kAlgMsg.h:46
void * kAlgMsg_Part(kAlgMsg msg, kSize frameIndex, kSize partIndex)
Gets a pointer to the specified frame content part.
Definition: kAlgMsg.h:129