VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
influenceInteractionExtension.h
Go to the documentation of this file.
1 /****************************************************************************
2 * Copyright (c) 2018 VT MAK
3 * All rights reserved.
4 ****************************************************************************/
5 
8 
9 #pragma once
10 
11 #if DtHLA
12 
13 #include <vl/interactionWithEncDec.h>
18 
19 class DtExerciseConn;
21 
24 
30 {
31 
32 protected:
33 
38 
39 public:
40 
46  DtInfluenceInteractionExtension(const DtString& influenceName);
47 
50 
53 
56 
58  virtual void printData() const;
59 
61  virtual void printDataToStream(std::ostream& stream) const;
62 
64  virtual const char* name() const { return "DtInfluenceInteraction"; }
65 
66 public:
67 
70  static DtInteraction* create();
71 
74  static void addCallback(DtExerciseConn* conn,
75  DtInfluenceInterExtensionCb cb, void* usr,
76  DtDDMRegionSP region = DtDDMRegionSP());
77  static void removeCallback(DtExerciseConn* conn,
78  DtInfluenceInterExtensionCb cb, void* usr,
79  DtDDMRegionSP region = DtDDMRegionSP());
80 
82 
83 protected:
84 
85 };
86 
89 #define DtDECLARE_INFLUENCE_W_G_PARAM_ENCODER(paramName) \
90  DtDECLARE_PARAM_ENCODER(DtInfluenceInteractionExtension, paramName)
91 
92 #define DtDEFINE_SIMPLE_INFLUENCE_W_G_PARAM_ENCODER( \
93  paramName, netType, inspector) \
94  DtDEFINE_SIMPLE_PARAM_ENCODER( \
95  DtInfluenceInterExtensionEncoder, DtInfluenceInteractionExtension, \
96  paramName, netType, inspector)
97 
98 #define DtDEFINE_SIMPLE_INFLUENCE_W_G_STRING_PARAM_ENCODER( \
99  paramName, inspector) \
100  void DtInfluenceInterExtensionEncoder::encode##paramName(const DtInfluenceInteractionExtension& inter, \
101  RTI::ParameterHandleValuePairSet* params, \
102  RTI::ParameterHandle paramHandle) \
103 { \
104  DtString netVal = inter.inspector(); \
105  params->add(paramHandle, (char*) netVal.c_str(), netVal.length()+1); \
106 }
107 
112 {
113 public:
115  DtInfluenceInterExtensionEncoder(DtExerciseConn* exConn,
116  DtInterClassDesc* classDesc);
117 
120 
123 
126 
127 protected:
128 
129 };
130 
131 #define DtDECLARE_INFLUENCE_W_G_PARAM_DECODER(paramName) \
132  DtDECLARE_PARAM_DECODER(DtInfluenceInteractionExtension, paramName)
133 
134 #define DtDEFINE_SIMPLE_INFLUENCE_W_G_PARAM_DECODER( \
135  paramName, netType, mutator) \
136  DtDEFINE_SIMPLE_PARAM_DECODER( \
137  DtInfluenceInterExtensionDecoder, DtInfluenceInteractionExtension, \
138  paramName, netType, mutator)
139 
140 #define DtDEFINE_SIMPLE_INFLUENCE_W_G_STRING_PARAM_DECODER( \
141  paramName, mutator) \
142  void DtInfluenceInterExtensionDecoder::decode##paramName(DtInfluenceInteractionExtension* inter, \
143  const RTI::ParameterHandleValuePairSet& params, \
144  int index) \
145 { \
146  RTI::ULong length = 0; \
147  char* buf = (char*) params.getValuePointer(index, length); \
148  DtString val(buf, length); \
149  inter->mutator(val); \
150 }
151 
155 {
156 public:
158  DtInfluenceInterExtensionDecoder(DtExerciseConn* exConn,
159  DtInterClassDesc* classDesc);
160 
163 
166 
169 
170 protected:
171 
172 };
173 
175 
176 #endif
Contains Extended DI-Guy Object net types.
Contains Extended DI-Guy Object net types.
DtInfluenceInteraction & operator=(const DtInfluenceInteraction &orig)
Assignment operator.
Instances of DtInfluenceInterExtensionEncoder are used to encode data from DtInfluenceInter objects i...
Definition: influenceInteractionExtension.h:111
virtual void printDataToStream(std::ostream &stream) const
Print the interaction&#39;s data to the specified stream.
#define DT_DLL_vrfExtendedProperties
This file is used to determine how to build.
Definition: vrfExtendedPropertiesDefines.h:25
virtual const char * name() const
Name of the interaction. (Not necessarily the ClassName from the FOM.)
Definition: influenceInteractionExtension.h:64
static const DtString theEngagementInfluenceName
Definition: influenceInteractionExtension.h:81
void(* DtInfluenceInterExtensionCb)(DtInfluenceInteractionExtension *inter, void *usr)
DtInfluenceInteractionExtension callback function signature.
Definition: influenceInteractionExtension.h:23
static void addCallback(DtExerciseConn *conn, DtInfluenceInterCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
Add (register)/Remove (deregister) function to be called when interaction occurs. ...
DtInfluenceInterEncoder & operator=(const DtInfluenceInterEncoder &orig)
Assignment operator.
Instances of DtInfluenceInterDecoder are used to decode data from the network into DtInfluenceInter o...
Definition: influenceInterDecoderHLA.h:46
voidpf stream
Definition: ioapi.h:39
Instances of DtInfluenceInterEncoder are used to encode data from DtInfluenceInter objects into netwo...
Definition: influenceInterEncoderHLA.h:43
static void removeCallback(DtExerciseConn *conn, DtInfluenceInterCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
Instances of DtInfluenceInter are used to store state data for Influence interactions.
Definition: influenceInteractionHLA.h:27
DT_DLL_vrfExtendedProperties void registerInfluenceInteractionExtension(DtExerciseConn *exConn)
Contains Extended DI-Guy Object net types.
static DtInteraction * create()
Create a DtInfluenceInter.
Instances of DtInfluenceInteractionExtension are used to store state data for Influence interactions ...
Definition: influenceInteractionExtension.h:29
Instances of DtInfluenceInterExtensionDecoder are used to decode data from the network into DtInfluen...
Definition: influenceInteractionExtension.h:154
virtual void printData() const
Print the interaction&#39;s data.
DtInfluenceInterDecoder & operator=(const DtInfluenceInterDecoder &orig)
Assignment operator.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)