MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Enumerations
rtiTemplateMsgArrayParams.h File Reference

This file defines the DtRtiArrayMsgParam template which can be used to create a message parameter which is a variable length array of elements for template based message classes. More...

Go to the source code of this file.

Classes

class  DtRtiArraySizeMsgParam< ParamType, NetParamType >
 The template for an RTI message parameter which is actually the size of an array. More...
 
class  DtRtiArrayMsgParam< ParamType, ConvParamType, NetParamType, AllocatedMsgParamType >
 The template for an RTI message parameter which is actually an array of items of the same type. More...
 
class  DtRtiArrayMsgParam< char, char, char, AllocatedMsgParamType >
 Template specialization for a string RTI message parameter. More...
 

Macros

#define DtDECLARE_ARRAY_SIZE_PARAMETER_METHODS(ParamName, BitSize)
 
#define DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, CtrType)
 
#define DtDECLARE_ARRAY_PARAMETER_POINTER_METHODS(ParamName, ParamType)
 
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
 
#define DtDECLARE_UNSIGNED_ARRAY_PARAMETER_METHODS(ParamName, BitSize, CountBitSize)
 
#define DtDECLARE_INT_ARRAY_PARAMETER_METHODS(ParamName, BitSize, CountBitSize)
 
#define DtDECLARE_BOOL_ARRAY_PARAMETER_METHODS(ParamName, CountBitSize)
 
#define DtDECLARE_ENUMERATION_ARRAY_PARAMETER_METHODS(ParamName, EnumType, BitSize, CountBitSize)
 
#define DtDECLARE_FLOAT_ARRAY_PARAMETER_METHODS(ParamName, BitSize, CountBitSize)
 
#define DtDECLARE_STRING_PARAMETER_METHODS(ParamName, LengthBitSize)
 
#define DtDECLARE_STRING_ARRAY_PARAMETER_METHODS(ParamName, LengthBitSize)
 
#define DtDEFINE_ARRAY_SIZE_PARAMETER_METHODS(ClassName, ParamName, BitSize)
 
#define DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, CtrType)
 
#define DtDEFINE_ARRAY_PARAMETER_POINTER_METHODS(ClassName, ParamName, ParamType, BitSize)
 
#define DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, ParamType, BitSize)
 
#define DtDEFINE_UNSIGNED_ARRAY_PARAMETER_METHODS(ClassName, ParamName, BitSize)   DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtU##BitSize, BitSize)
 
#define DtDEFINE_INT_ARRAY_PARAMETER_METHODS(ClassName, ParamName, BitSize)   DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtInt##BitSize, BitSize)
 
#define DtDEFINE_ENUMERATION_ARRAY_PARAMETER_METHODS(ClassName, ParamName, EnumType, BitSize)   DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, EnumType, BitSize)
 
#define DtDEFINE_BOOL_ARRAY_PARAMETER_METHODS(ClassName, ParamName)   DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, bool, 8)
 
#define DtDEFINE_FLOAT_ARRAY_PARAMETER_METHODS(ClassName, ParamName, BitSize)   DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtFloat##BitSize, BitSize)
 
#define DtDEFINE_STRING_PARAMETER_METHODS(ClassName, ParamName)
 
#define DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, CtrType)
 
#define DtDEFINE_STRING_ARRAY_PARAMETER_METHODS(ClassName, ParamName)
 
#define DtADD_ARRAY_PARAMETER(ParamName, SizeParamName)   addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##SizeParamName));
 

Enumerations

enum  DtResizeArrayFlag { DtDoNotResize, DtResizeIfNeeded }
 

Detailed Description

This file defines the DtRtiArrayMsgParam template which can be used to create a message parameter which is a variable length array of elements for template based message classes.

It also defines easy macros to make creating a new message simpler. See rtiTemplateMsgParams.h for the template and macros for simple types.

Macro Definition Documentation

#define DtADD_ARRAY_PARAMETER (   ParamName,
  SizeParamName 
)    addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##SizeParamName));
#define DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS (   ParamName,
  CtrType 
)
Value:
public: \
void set##ParamName(const CtrType& val, \
void get##ParamName(CtrType&) const;
DtResizeArrayFlag
Definition: rtiTemplateMsgArrayParams.h:492
Definition: rtiTemplateMsgArrayParams.h:495
#define DtDECLARE_ARRAY_PARAMETER_METHODS (   ParamName,
  ParamType 
)
Value:
public: \
static const char* ParamName##Name; \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::set<ParamType>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::vector<ParamType>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::deque<ParamType>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::list<ParamType>) \
#define DtDECLARE_ARRAY_PARAMETER_POINTER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:539
#define DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, CtrType)
Definition: rtiTemplateMsgArrayParams.h:527
#define DtDECLARE_ARRAY_PARAMETER_POINTER_METHODS (   ParamName,
  ParamType 
)
Value:
public: \
void set##ParamName(const ParamType* inputBuff, unsigned numItems, \
unsigned get##ParamName(ParamType* outputBuff) const; /*returns num items*/
DtResizeArrayFlag
Definition: rtiTemplateMsgArrayParams.h:492
Definition: rtiTemplateMsgArrayParams.h:495
#define DtDECLARE_ARRAY_SIZE_PARAMETER_METHODS (   ParamName,
  BitSize 
)
Value:
DtDECLARE_PARAMETER_METHODS(ParamName, MAKRti::DtU##BitSize) \
protected: \
ParamName##Type* my##ParamName; \
public: \
void reserveSpaceFor##ParamName(unsigned num);
#define DtDECLARE_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgParams.h:184
The template for an RTI message parameter which is actually the size of an array. ...
Definition: rtiTemplateMsgArrayParams.h:30
#define DtDECLARE_BOOL_ARRAY_PARAMETER_METHODS (   ParamName,
  CountBitSize 
)
Value:
protected: \
typedef DtRtiArrayMsgParam<bool, MAKRti::DtU8, MAKRti::DtNetU8, \
DtRtiArraySizeMsgParam<MAKRti::DtU##CountBitSize, MAKRti::DtNetU##CountBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:551
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_ENUMERATION_ARRAY_PARAMETER_METHODS (   ParamName,
  EnumType,
  BitSize,
  CountBitSize 
)
Value:
DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, EnumType) \
protected: \
typedef DtRtiArrayMsgParam<EnumType, MAKRti::DtU##BitSize, MAKRti::DtNetU##BitSize, \
DtRtiArraySizeMsgParam<MAKRti::DtU##CountBitSize, MAKRti::DtNetU##CountBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:551
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_FLOAT_ARRAY_PARAMETER_METHODS (   ParamName,
  BitSize,
  CountBitSize 
)
Value:
DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, MAKRti::DtFloat##BitSize) \
protected: \
typedef DtRtiArrayMsgParam<MAKRti::DtFloat##BitSize, MAKRti::DtFloat##BitSize, MAKRti::DtNetFloat##BitSize,\
DtRtiArraySizeMsgParam<MAKRti::DtU##CountBitSize, MAKRti::DtNetU##CountBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:551
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_INT_ARRAY_PARAMETER_METHODS (   ParamName,
  BitSize,
  CountBitSize 
)
Value:
DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, MAKRti::DtInt##BitSize) \
protected: \
typedef DtRtiArrayMsgParam<MAKRti::DtInt##BitSize, MAKRti::DtInt##BitSize, MAKRti::DtNetInt##BitSize,\
DtRtiArraySizeMsgParam<MAKRti::DtU##CountBitSize, MAKRti::DtNetU##CountBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:551
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_STRING_ARRAY_PARAMETER_METHODS (   ParamName,
  LengthBitSize 
)
Value:
public: \
static const char* ParamName##Name; \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::set<MAKRti::DtString>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::vector<MAKRti::DtString>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::list<MAKRti::DtString>) \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, std::deque<MAKRti::DtString>) \
protected: \
typedef DtRtiArrayMsgParam<char, char, char, \
DtRtiArraySizeMsgParam<MAKRti::DtU##LengthBitSize, MAKRti::DtNetU##LengthBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, CtrType)
Definition: rtiTemplateMsgArrayParams.h:527
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_STRING_PARAMETER_METHODS (   ParamName,
  LengthBitSize 
)
Value:
public: \
static const char* ParamName##Name; \
DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, MAKRti::DtString) \
protected: \
typedef DtRtiArrayMsgParam<char, char, char, \
DtRtiArraySizeMsgParam<MAKRti::DtU##LengthBitSize, MAKRti::DtNetU##LengthBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_POINTER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:539
#define DtDECLARE_ARRAY_PARAMETER_CONTAINER_METHODS(ParamName, CtrType)
Definition: rtiTemplateMsgArrayParams.h:527
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDECLARE_UNSIGNED_ARRAY_PARAMETER_METHODS (   ParamName,
  BitSize,
  CountBitSize 
)
Value:
DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, MAKRti::DtU##BitSize) \
protected: \
typedef DtRtiArrayMsgParam<MAKRti::DtU##BitSize, MAKRti::DtU##BitSize, MAKRti::DtNetU##BitSize, \
DtRtiArraySizeMsgParam<MAKRti::DtU##CountBitSize, MAKRti::DtNetU##CountBitSize> > ParamName##Type; \
ParamName##Type* my##ParamName;
#define DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, ParamType)
Definition: rtiTemplateMsgArrayParams.h:551
The template for an RTI message parameter which is actually an array of items of the same type...
Definition: rtiTemplateMsgArrayParams.h:92
#define DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS (   ClassName,
  ParamName,
  ParamType,
  BitSize,
  CtrType 
)
Value:
void ClassName::set##ParamName(const CtrType& container, \
DtResizeArrayFlag resizeFlag) \
{ \
unsigned currNum = my##ParamName->numItems(); \
if(resizeFlag == DtResizeIfNeeded && container.size() != currNum) \
{ \
unsigned currSize = currNum * BitSize/8; \
unsigned newSize = container.size() * BitSize/8; \
char* begPtr = static_cast<char*>(my##ParamName->beginPtr()); \
if(newSize > currSize) \
{ \
insertBytes(begPtr + currSize, newSize - currSize); \
} \
else if(currSize > newSize) \
{ \
deleteBytes(begPtr + newSize, currSize - newSize); \
} \
my##ParamName->setNumItems(container.size()); \
} \
my##ParamName->setParams(container); \
} \
void ClassName::get##ParamName(CtrType& container) const \
{ \
my##ParamName->getParams(container); \
}
DtResizeArrayFlag
Definition: rtiTemplateMsgArrayParams.h:492
Definition: rtiTemplateMsgArrayParams.h:495
void insertBytes(std::vector< Octet > &wrapper, size_t length)
Insert bytes into the octet buffer.
Definition: encodingImplHelpers.h:109
#define DtDEFINE_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName,
  ParamType,
  BitSize 
)
Value:
const char* ClassName::ParamName##Name = #ParamName; \
DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, std::set<ParamType>) \
DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, std::vector<ParamType>) \
DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, std::list<ParamType>) \
DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, std::deque<ParamType>) \
DtDEFINE_ARRAY_PARAMETER_POINTER_METHODS(ClassName, ParamName, ParamType, BitSize)
#define DtDEFINE_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, ParamType, BitSize, CtrType)
Definition: rtiTemplateMsgArrayParams.h:687
#define DtDEFINE_ARRAY_PARAMETER_POINTER_METHODS(ClassName, ParamName, ParamType, BitSize)
Definition: rtiTemplateMsgArrayParams.h:721
#define DtDEFINE_ARRAY_PARAMETER_POINTER_METHODS (   ClassName,
  ParamName,
  ParamType,
  BitSize 
)
Value:
void ClassName::set##ParamName(const ParamType* buff, unsigned num, \
DtResizeArrayFlag resizeFlag) \
{ \
unsigned currNum = my##ParamName->numItems(); \
if(resizeFlag == DtResizeIfNeeded && num != currNum) \
{ \
unsigned currSize = currNum * BitSize/8; \
unsigned newSize = num * BitSize/8; \
char* begPtr = static_cast<char*>(my##ParamName->beginPtr()); \
if(newSize > currSize) \
{ \
insertBytes(begPtr + currSize, newSize - currSize); \
} \
else if(currSize > newSize) \
{ \
deleteBytes(begPtr + newSize, currSize - newSize); \
} \
my##ParamName->setNumItems(num); \
} \
my##ParamName->setParams(buff, num); \
} \
unsigned ClassName::get##ParamName(ParamType* buff) const \
{ \
return my##ParamName->getParams(buff); \
}
DtResizeArrayFlag
Definition: rtiTemplateMsgArrayParams.h:492
Definition: rtiTemplateMsgArrayParams.h:495
void insertBytes(std::vector< Octet > &wrapper, size_t length)
Insert bytes into the octet buffer.
Definition: encodingImplHelpers.h:109
#define DtDEFINE_ARRAY_SIZE_PARAMETER_METHODS (   ClassName,
  ParamName,
  BitSize 
)
Value:
DtDEFINE_UNSIGNED_PARAMETER_METHODS(ClassName, ParamName, BitSize) \
void ClassName::reserveSpaceFor##ParamName(unsigned num) \
{ \
void* p = my##ParamName->firstArrayPtr(); \
if(p && my##ParamName->param() == 0) \
{ \
unsigned bytes = my##ParamName->bytesNeeded(num); \
insertBytes(p, bytes); \
my##ParamName->setParam(num); \
} \
}
void insertBytes(std::vector< Octet > &wrapper, size_t length)
Insert bytes into the octet buffer.
Definition: encodingImplHelpers.h:109
#define DtDEFINE_UNSIGNED_PARAMETER_METHODS(ClassName, ParamName, BitSize)
Definition: rtiTemplateMsgParams.h:305
#define DtDEFINE_BOOL_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName 
)    DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, bool, 8)
#define DtDEFINE_ENUMERATION_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName,
  EnumType,
  BitSize 
)    DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, EnumType, BitSize)
#define DtDEFINE_FLOAT_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName,
  BitSize 
)    DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtFloat##BitSize, BitSize)
#define DtDEFINE_INT_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName,
  BitSize 
)    DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtInt##BitSize, BitSize)
#define DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS (   ClassName,
  ParamName,
  CtrType 
)
#define DtDEFINE_STRING_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName 
)
Value:
const char* ClassName::ParamName##Name = #ParamName; \
DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::set<MAKRti::DtString>)\
DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::vector<MAKRti::DtString>)\
DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::list<MAKRti::DtString>)\
DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::deque<MAKRti::DtString>)
#define DtDEFINE_STRING_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, CtrType)
Definition: rtiTemplateMsgArrayParams.h:864
#define DtDEFINE_STRING_PARAMETER_METHODS (   ClassName,
  ParamName 
)
#define DtDEFINE_UNSIGNED_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName,
  BitSize 
)    DtDEFINE_ARRAY_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtU##BitSize, BitSize)

Enumeration Type Documentation

Enumerator
DtDoNotResize 
DtResizeIfNeeded 

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)