MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
handleCreator1516e.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2010 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: handleCreator1516e.h,v $ $Revision: 1.0 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef handleCreatore_H_
10 #define handleCreatore_H_
11 
14 
15 #ifdef DtIFSPEC1516E
16 
17 #include "handleImpl.h"
18 #include "internalTypes.h"
19 #include <vlutil/vlFedTarget.h>
20 #include <RTI/Handle.h>
21 #include <RTI/Typedefs.h>
22 
23 namespace rti1516e
24 {
25 
30 #define DEFINE_HANDLE_CLASS_FRIEND(HandleKind) \
31  \
32 class HandleKind##Friend \
33 { \
34 public: \
35  HandleKind##Friend(); \
36  static rti1516e::HandleKind HandleKind(Dt##HandleKind handleValue); \
37  static rti1516e::HandleKind HandleKind( \
38  VariableLengthData const & encodedValue); \
39  static HandleKind##Implementation const* getImplementation( \
40  rti1516e::HandleKind const& handle); \
41  static HandleKind##Implementation* getImplementation( \
42  rti1516e::HandleKind& handle); \
43 }; \
44 inline HandleKind##Friend::HandleKind##Friend() \
45 { \
46 } \
47 inline rti1516e::HandleKind HandleKind##Friend::HandleKind( \
48  Dt##HandleKind handleValue) \
49 { \
50  return rti1516e::HandleKind((HandleKind##Implementation*)handleValue); \
51 } \
52 inline rti1516e::HandleKind HandleKind##Friend::HandleKind( \
53  VariableLengthData const & encodedValue) \
54 { \
55  return rti1516e::HandleKind(encodedValue); \
56 } \
57 inline HandleKind##Implementation const* \
58 HandleKind##Friend::getImplementation(rti1516e::HandleKind const& handle) \
59 { \
60  return handle.getImplementation(); \
61 } \
62 inline HandleKind##Implementation* \
63 HandleKind##Friend::getImplementation(rti1516e::HandleKind & handle) \
64 { \
65  return handle.getImplementation(); \
66 } \
67  \
68 inline rti1516e::HandleKind make##HandleKind(Dt##HandleKind handle) \
69 { \
70  return HandleKind##Friend::HandleKind(handle); \
71 } \
72  \
73 inline rti1516e::HandleKind make##HandleKind( \
74  VariableLengthData const & encodedValue) \
75 { \
76  return HandleKind##Friend::HandleKind(encodedValue); \
77 } \
78  \
79 inline Dt##HandleKind make##HandleKind##Impl( \
80  const rti1516e::HandleKind& handle) \
81 { \
82  return (Dt##HandleKind)HandleKind##Friend::getImplementation(handle); \
83 }
84 
87 #define DEFINE_FILL_HANDLE_SET_IMPL(HandleKind) \
88  \
89 inline void fill##HandleKind##SetImpl( \
90  rti1516e::HandleKind##Set const & rtiHandleSet, \
91  Dt##HandleKind##Set & internHandleSet) \
92 { \
93  for (rti1516e::HandleKind##Set::const_iterator iter = rtiHandleSet.begin();\
94  iter != rtiHandleSet.end(); \
95  iter++) \
96  { \
97  internHandleSet.insert(make##HandleKind##Impl(*iter)); \
98  } \
99 }
100 
103 #define DEFINE_FILL_HANDLE_SET(HandleKind) \
104  \
105 inline void fill##HandleKind##Set( \
106  Dt##HandleKind##Set const & internHandleSet, \
107  rti1516e::HandleKind##Set & rtiHandleSet) \
108 { \
109  for (Dt##HandleKind##Set::const_iterator iter = internHandleSet.begin(); \
110  iter != internHandleSet.end(); \
111  iter++) \
112  { \
113  rtiHandleSet.insert(make##HandleKind(*iter)); \
114  } \
115 }
116 
117 DEFINE_HANDLE_CLASS_FRIEND(FederateHandle)
118 DEFINE_HANDLE_CLASS_FRIEND(ObjectClassHandle)
119 DEFINE_HANDLE_CLASS_FRIEND(InteractionClassHandle)
120 DEFINE_HANDLE_CLASS_FRIEND(ObjectInstanceHandle)
121 DEFINE_HANDLE_CLASS_FRIEND(AttributeHandle)
122 DEFINE_HANDLE_CLASS_FRIEND(ParameterHandle)
123 DEFINE_HANDLE_CLASS_FRIEND(DimensionHandle)
124 DEFINE_HANDLE_CLASS_FRIEND(RegionHandle)
125 
126 DEFINE_FILL_HANDLE_SET(DimensionHandle)
127 DEFINE_FILL_HANDLE_SET_IMPL(DimensionHandle)
128 DEFINE_FILL_HANDLE_SET(RegionHandle)
129 DEFINE_FILL_HANDLE_SET_IMPL(RegionHandle)
130 
134 class MessageRetractionHandleFriend
135 {
136 public:
137  MessageRetractionHandleFriend();
138  static rti1516e::MessageRetractionHandle MessageRetractionHandle(
139  DtMessageRetractionHandle handleValue);
140  static rti1516e::MessageRetractionHandle MessageRetractionHandle(
141  VariableLengthData const & encodedValue);
142  static MessageRetractionHandleImplementation const* getImplementation(
143  rti1516e::MessageRetractionHandle const& handle);
144  static MessageRetractionHandleImplementation* getImplementation(
145  rti1516e::MessageRetractionHandle& handle);
146 };
147 inline MessageRetractionHandleFriend::MessageRetractionHandleFriend()
148 {
149 }
150 inline rti1516e::MessageRetractionHandle
151 MessageRetractionHandleFriend::MessageRetractionHandle(
152  DtMessageRetractionHandle handleValue)
153 {
154  return rti1516e::MessageRetractionHandle(
155  (MessageRetractionHandleImplementation*)&handleValue);
156 }
157 inline rti1516e::MessageRetractionHandle
158 MessageRetractionHandleFriend::MessageRetractionHandle(
159  VariableLengthData const & encodedValue)
160 {
161  return rti1516e::MessageRetractionHandle(encodedValue);
162 }
163 inline MessageRetractionHandleImplementation const *
164 MessageRetractionHandleFriend::getImplementation(
165  rti1516e::MessageRetractionHandle const& handle)
166 {
167  return handle.getImplementation();
168 }
169 inline MessageRetractionHandleImplementation*
170 MessageRetractionHandleFriend::getImplementation(
171  rti1516e::MessageRetractionHandle & handle)
172 {
173  return handle.getImplementation();
174 }
175 
176 inline rti1516e::MessageRetractionHandle makeMessageRetractionHandle(
178 {
179  return MessageRetractionHandleFriend::MessageRetractionHandle(handle);
180 }
181 
182 inline rti1516e::MessageRetractionHandle makeMessageRetractionHandle(
183  VariableLengthData const & encodedValue)
184 {
185  return MessageRetractionHandleFriend::MessageRetractionHandle(encodedValue);
186 }
187 
188 inline DtMessageRetractionHandle makeMessageRetractionHandleImpl(
189  rti1516e::MessageRetractionHandle handle)
190 {
191  return MessageRetractionHandleFriend::getImplementation(handle)->value();
192 }
193 
194 inline rti1516e::MessageRetractionHandle makeMessageRetractionHandle(
195  DtFederateHandle fedHandle, unsigned long serialNumber)
196 {
197  DtMessageRetractionHandle handleImpl = {serialNumber, fedHandle};
198  return makeMessageRetractionHandle(handleImpl);
199 };
200 
201 inline MAKRti::DtOrderType makeOrderTypeImpl(rti1516e::OrderType order)
202 {
203  return (order == RECEIVE) ? MAKRti::DtReceive : MAKRti::DtTimestamp;
204 }
205 
206 inline MAKRti::DtTransportType makeTransportTypeImpl(rti1516e::TransportationType transport)
207 {
208  return (transport == RELIABLE) ? MAKRti::DtReliable : MAKRti::DtBest_Effort;
209 }
210 
211 inline rti1516e::OrderType makeOrderType(MAKRti::DtOrderType order)
212 {
213  return (order == MAKRti::DtReceive) ? RECEIVE : TIMESTAMP;
214 }
215 
216 inline rti1516e::TransportationType makeTransportType(MAKRti::DtTransportType transport)
217 {
218  return (transport == MAKRti::DtReliable) ? RELIABLE : BEST_EFFORT;
219 }
220 
221 };
222 
223 #endif
224 #endif

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)