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

This file contains template specializations for the DtRtiMsgParam and DtRtiArrayMsgParam template classes to handle DtInetAddr parameters and arrays of DtInetAddrs. More...

Go to the source code of this file.

Classes

class  DtRtiMsgParam< MAKRti::DtInetAddr, MAKRti::DtNetU128 >
 Template specialization for DtInetAddr message parameters. More...
class  DtRtiArrayMsgParam< MAKRti::DtInetAddr, MAKRti::DtU128, MAKRti::DtNetU128, AllocatedMsgParamType >
 Template specialization for an RTI message parameter which is an array of DtInetAddrs. More...

Macros

#define DtDECLARE_INET_ADDR_PARAMETER_METHODS(ParamName)
#define DtDECLARE_INET_ADDR_ARRAY_PARAMETER_METHODS(ParamName, CountBitSize)
#define DtDEFINE_INET_ADDR_PARAMETER_METHODS(ClassName, ParamName)   DtDEFINE_BY_REF_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtInetAddr)
#define DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, CtrType)
#define DtDEFINE_INET_ADDR_ARRAY_PARAMETER_METHODS(ClassName, ParamName)
#define DtADD_INET_ADDR_PARAMETER(ParamName, FamilyParamName)   addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##FamilyParamName));
#define DtADD_INET_ADDR_ARRAY_PARAMETER(ParamName, SizeParamName, FamilyParamName)   addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##SizeParamName, my##FamilyParamName));

Detailed Description

This file contains template specializations for the DtRtiMsgParam and DtRtiArrayMsgParam template classes to handle DtInetAddr parameters and arrays of DtInetAddrs.

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

Macro Definition Documentation

#define DtADD_INET_ADDR_ARRAY_PARAMETER (   ParamName,
  SizeParamName,
  FamilyParamName 
)    addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##SizeParamName, my##FamilyParamName));
#define DtADD_INET_ADDR_PARAMETER (   ParamName,
  FamilyParamName 
)    addParameter(my##ParamName = new ParamName##Type(ParamName##Name, my##FamilyParamName));
#define DtDECLARE_INET_ADDR_ARRAY_PARAMETER_METHODS (   ParamName,
  CountBitSize 
)
Value:
DtDECLARE_ARRAY_PARAMETER_METHODS(ParamName, MAKRti::DtInetAddr) \
protected: \
typedef DtRtiArrayMsgParam<MAKRti::DtInetAddr, MAKRti::DtU128, MAKRti::DtNetU128, \
ParamName##Type* my##ParamName;
#define DtDECLARE_INET_ADDR_PARAMETER_METHODS (   ParamName)
Value:
DtDECLARE_BY_REF_PARAMETER_METHODS(ParamName, MAKRti::DtInetAddr) \
protected: \
ParamName##Type* my##ParamName;
#define DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS (   ClassName,
  ParamName,
  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 * sizeof(MAKRti::DtNetU128); \
unsigned newSize = container.size() * sizeof(MAKRti::DtNetU128); \
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); \
}
#define DtDEFINE_INET_ADDR_ARRAY_PARAMETER_METHODS (   ClassName,
  ParamName 
)
Value:
const char* ClassName::ParamName##Name = #ParamName; \
DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::set<MAKRti::DtInetAddr>) \
DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::vector<MAKRti::DtInetAddr>) \
DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::list<MAKRti::DtInetAddr>) \
DtDEFINE_INET_ADDR_ARRAY_PARAMETER_CONTAINER_METHODS(ClassName, ParamName, std::deque<MAKRti::DtInetAddr>) \
void ClassName::set##ParamName(const MAKRti::DtInetAddr* buff, \
unsigned num, DtResizeArrayFlag resizeFlag) \
{ \
unsigned currNum = my##ParamName->numItems(); \
if(resizeFlag == DtResizeIfNeeded && num != currNum) \
{ \
unsigned currSize = currNum * sizeof(MAKRti::DtNetU128); \
unsigned newSize = num * sizeof(MAKRti::DtNetU128); \
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(MAKRti::DtInetAddr* buff) const \
{ \
return my##ParamName->getParams(buff); \
}
#define DtDEFINE_INET_ADDR_PARAMETER_METHODS (   ClassName,
  ParamName 
)    DtDEFINE_BY_REF_PARAMETER_METHODS(ClassName, ParamName, MAKRti::DtInetAddr)

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)