Go to the documentation of this file.
10 #define scIGPMessage_h
16 using namespace sc_core;
using namespace std;
33 uint32_t
Time : (32-4-4-4-4);
39 int &ToInt() {
return *
reinterpret_cast<int *
>(
this);}
119 { assert(!(index<0 || index >= MAX_IGPCBUFFER_SIZE));
120 mBuffer[4+index] = C;
125 { assert(!(index<0 || index >= MAX_IGPCBUFFER_SIZE));
126 return mBuffer[4+index];
133 oss <<
"0x" << hex << BufferContent_Get(index) << dec ;
143 static_assert(
sizeof(MsgType) <=
sizeof(mBuffer[1]),
"!");
144 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
154 static_assert(
sizeof(F) <=
sizeof(mBuffer[1]),
"!");
155 memcpy(&mBuffer[1], &F,
sizeof(mBuffer[1]));
162 static_assert(
sizeof(MsgType) <=
sizeof(mBuffer[1]),
"!");
163 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
171 static_assert(
sizeof(T) <=
sizeof(mBuffer[1]),
"!");
172 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
174 memcpy(&mBuffer[1], &MsgType,
sizeof(mBuffer[1]));
181 static_assert(
sizeof(MsgType) <=
sizeof(mBuffer[1]),
"!");
182 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
193 static_assert(
sizeof(MsgType) <=
sizeof(mBuffer[1]),
"!");
194 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
202 memcpy(&CA, &mBuffer[0],
sizeof(CA));
209 memcpy(&mBuffer[0], &CA,
sizeof(CA));
216 memcpy(&mBuffer[2], &CA,
sizeof(CA));
224 memcpy(&CA, &mBuffer[2],
sizeof(CA));
233 memcpy(&A, &mBuffer[3],
sizeof(A));
240 memcpy(&mBuffer[3], &A,
sizeof(A));
248 static_assert(
sizeof(T) <=
sizeof(mBuffer[1]),
"!");
249 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
251 memcpy(&mBuffer[1], &MsgType,
sizeof(mBuffer[1]));
258 static_assert(
sizeof(MsgType) <=
sizeof(mBuffer[1]),
"!");
259 memcpy( &MsgType ,&mBuffer[1],
sizeof(mBuffer[1]));
263 int32_t mBuffer[4+MAX_IGPCBUFFER_SIZE];
267 #endif // scIGPMessage_h
uint32_t Length
Definition: scIGPMessage.h:37
@ msg_Coop
Cooperation-type messages.
Definition: scIGPMessage.h:24
int ReplyLength_Get(void)
Get from the 'memory read' message the requested reply length MessageFeatures_t::ReplyLength.
Definition: scIGPMessage.h:190
uint32_t ReplyLength
Definition: scIGPMessage.h:35
Topology information for the electronic modules arranged in a grid.
int32_t BufferContent_Get(int index)
Returns the index-th element in the buffer.
Definition: scIGPMessage.h:124
The scIGPMessage class.
Definition: scIGPMessage.h:97
uint32_t Time
Definition: scIGPMessage.h:33
ClusterAddress_t DestinationAddress_Get(void)
Return the ClusterAddress_t address of the destination in the message.
Definition: scIGPMessage.h:199
int16_t DelayTime_Get(void)
Return MessageFeatures_t::Length of the message (Total, including the header)
Definition: scIGPMessage.h:255
@ msg_Qt
QT-type messages.
Definition: scIGPMessage.h:22
void DestinationAddress_Set(ClusterAddress_t CA)
Set the destination address to ClusterAddress_t address CA.
Definition: scIGPMessage.h:207
void Header3Address_Set(uint32_t A)
Set the Header3 address to ClusterAddress_t address CA.
Definition: scIGPMessage.h:238
MessageFeatures_t FeatureWord_Get(void)
Returns the features word of the message.
Definition: scIGPMessage.h:140
uint32_t SubKey
Definition: scIGPMessage.h:34
This class implements the autonomous grid point functionality: it is a communicating GridPoint....
Definition: scGridPoint.h:127
A GridPoint can be addressed also by its cluster address of type ClusterAddress_t....
Definition: Clustering.h:58
int Length_Get(void)
Return MessageFeatures_t::Length of the message (Total, including the header)
Definition: scIGPMessage.h:178
ClusterAddress_t ReplyToAddress_Get(void)
Return the ClusterAddress_t ReplyTo (or source) address.
Definition: scIGPMessage.h:221
void BufferContent_Set(int index, int32_t C)
Sets the index-th element of the buffer to C.
Definition: scIGPMessage.h:118
void FeatureWord_Set(MessageFeatures_t &F)
Sets the features word to F.
Definition: scIGPMessage.h:152
@ msg_Neur
Neuron-type messages.
Definition: scIGPMessage.h:25
void ReplyToAddress_Set(ClusterAddress_t CA)
Set the ReplyTo address to ClusterAddress_t address CA.
Definition: scIGPMessage.h:214
The basic message types of scIGPMessage messages.
@ msg_Reg
Register-type messages.
Definition: scIGPMessage.h:21
void DelayTime_Set(int16_t T)
Set the type of the message in the buffer to MessageFeatures_t::Type T.
Definition: scIGPMessage.h:245
string StringOfBufferContent_Get(int index)
return content of the index-th element in hexadecimal string form
Definition: scIGPMessage.h:130
The messages may use this feature word in different ways.
Definition: scIGPMessage.h:32
uint32_t Header3Address_Get(void)
Set the ReplyTo (or source) address to ClusterAddress_t CA.
Definition: scIGPMessage.h:230
uint32_t Type
Definition: scIGPMessage.h:38
IGPMessageType
Definition: scIGPMessage.h:21
IGPMessageType Type_Get(void)
Returns MessageFeatures_t::Type.
Definition: scIGPMessage.h:159
void Type_Set(IGPMessageType &T)
Set the type of the message in the buffer to MessageFeatures_t::Type T.
Definition: scIGPMessage.h:168
@ msg_Mem
Memory-type messages.
Definition: scIGPMessage.h:23