29 { printf(
"\n===================\n"
30 "Constructing DtF18EntityStateRep\n"
31 "=====================\n"); }
34 virtual ~DtF18EntityStateRep() {}
39 DtF18EntityStateRep(
const DtF18EntityStateRep& orig);
42 DtF18EntityStateRep&
operator=(
const DtF18EntityStateRep& orig);
47 virtual void setF18Attribute(
const DtString & val) { myAttrib = val;}
49 virtual DtString f18Attribute()
const {
return myAttrib;}
53 static DtF18EntityStateRep*
create() {
return new DtF18EntityStateRep; };
65 class DtF18EntityDecoder :
public DtPlatformDecoder
70 DtObjClassDesc* classDesc):
72 DtPlatformDecoder(exConn, classDesc)
75 addDecoder(
"SpecialF18Attribute",
76 (DtAttributeDecoder) decodeSpecialF18Attribute);
80 virtual ~DtF18EntityDecoder(){}
87 static void decodeSpecialF18Attribute(DtF18EntityStateRep* stateRep,
88 const RTI::AttributeHandleValuePairSet& attrs,
91 RTI::ULong length = attrs.getValueLength(pairSetIndex);
93 if (length == 0)
return;
96 attrs.getValue(pairSetIndex, buffer, length);
97 buffer[length] =
'\0';
99 stateRep->setF18Attribute(buffer);
107 class DtF18EntityEncoder :
public DtPlatformEncoder
112 DtObjClassDesc* classDesc):
114 DtPlatformEncoder(exConn, classDesc)
117 addEncoder(
"SpecialF18Attribute",
118 (DtAttributeEncoder) encodeSpecialF18Attribute);
119 addChecker(
"SpecialF18Attribute",
120 (DtAttributeChecker) needSpecialF18Attribute);
122 virtual ~DtF18EntityEncoder() {}
126 static bool needSpecialF18Attribute(
const DtF18EntityStateRep& stateRep,
127 const DtF18EntityStateRep& asSeenByRemote)
129 return(stateRep.f18Attribute() != asSeenByRemote.f18Attribute());
132 static void encodeSpecialF18Attribute(
const DtF18EntityStateRep& stateRep,
133 RTI::AttributeHandleValuePairSet* avList,
134 RTI::AttributeHandle attrHandle)
138 avList->add(attrHandle,
139 stateRep.f18Attribute().c_str(),
140 stateRep.f18Attribute().size());
147 #define DtADD_ENCODER(className, derivedEnc) \
149 DtObjClassDesc* classDesc = exConn.fom()->objClassByName(#className); \
152 exConn.fomMapper()->stateEncoderFactory()->addEncoder( \
153 classDesc->handle(), new derivedEnc(&exConn, classDesc)); \
157 DtWarn("Can't add encoder for object class %s: Not in FOM.\n", #className); \
162 #define DtADD_DECODER(className, derivedDec) \
164 DtObjClassDesc* classDesc = exConn.fom()->objClassByName(#className); \
167 exConn.fomMapper()->stateDecoderFactory()->addDecoder( \
168 classDesc->handle(), new derivedDec(&exConn, classDesc)); \
172 DtWarn("Can't add decoder for object class %s: Not in FOM.\n", #className); \
177 char* DtF18EntityChooser(
const char* vrlinkClassName,
181 printf(
"=========\n");
182 printf(
" In Class Chooser, deciding which entity Type to publish\n");
183 printf(
"=========\n");
192 printf(
"Choosing F18 Type, we will use the new class!\n");
194 return "BaseEntity.PhysicalEntity.Platform.Aircraft.F18";
198 return(DtRprFomMapper::dfltEntityClassChooser(vrlinkClassName,
Instances of DtExerciseConn are used to provide an application's interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
Contains the DtString class declaration.
This file declares enumerations for use with DtEntityType.
DT_DLL_VLPROTIND char * DtDecodingBuffer(unsigned int requestedLength)
DtDecodingBuffer returns a pointer to a chunk of memory requestedLength long which can be used for de...
This file declares DtFomMapper.
int subCategory() const
Definition: entityType.h:88
static DtEntityStateRepository * create()
Static create method.
This file declares DtFom.
Instances of DtEntityStateRepository are used to maintain attributes and state of entity objects in a...
Definition: entityStateRepository.h:36
Definition: entityTypes.h:219
DtEntityStateRepository & operator=(const DtEntityStateRepository &orig)
Assignment operator.
Contains the DtEntityStateRepository class declaration.
Instances of DtString are used to represent strings.
Definition: vlString.h:29
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
This file contains the declaration of DtStateDecoderFactory.