VR-Exchange 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
disBroker/disBroker/globalIdMapper.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2015 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <disBroker/dllExport.h>
13 #include <vlpi/entityIdentifier.h>
14 #include <vlutil/vlHashlist.h>
15 #include <vlutil/vlHashKeys.h>
16 #include <vlutil/vlString.h>
17 
18 namespace MAKVrExchange
19 {
20 
21  namespace DtDisBroker
22  {
23 
24  class DtGlobalIdMapper;
25 
27  typedef DtGlobalIdMapper* (*DtGlobalIdMapperCreator)();
28 
46  {
47  public:
48 
54  typedef DtEntityIdentifier DisId;
55 
58  typedef DtString PortalId;
59 
62  enum { NoSystemId = -1 };
63  enum { NoBeamId = -1 };
64 
65  typedef enum {
66  NoType = -1,
67  EntityType = 0,
68  EmitterSystemType = 1,
69  RadioTransmitterType = 2,
70  RadioReceiverType = 3,
71  EmitterBeamType = 4,
72  EnvironmentProcess = 5,
73  GridData = 6,
74  ActiveSonarType = 7,
75  AdditionalPassiveActivitesType = 8,
76  PropulsionNoiseType = 9,
77  DesignatorType = 10,
78  IffType = 11
79  } ObjectType;
80 
83 
85  virtual ~DtGlobalIdMapper();
86 
89  virtual bool add( const PortalId& portal_name, const DisId& dis_name,
90  ObjectType oType = EntityType, int systemId = NoSystemId,
91  int beamId = NoBeamId );
92 
96  virtual void remove( const PortalId& portal_name );
97 
101  virtual void remove( const DisId& dis_name, ObjectType otype = EntityType,
102  int systemId = NoSystemId, int beamId = NoBeamId );
103 
106  virtual void remove( const PortalId& portal_name, const DisId& dis_name,
107  ObjectType otype = EntityType, int systemId = NoSystemId,
108  int beamId = NoBeamId );
109 
113  virtual const PortalId& convertDisGidToPortalGid( const DisId& dis_name,
114  ObjectType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
115 
118  virtual const DisId& convertPortalGidToDisGid( const PortalId& portal_name,
119  ObjectType* otype = 0, int* systemId = 0, int* beamId = 0 );
120 
122  virtual bool unique( const PortalId& portal_name ) const;
123 
125  virtual bool unique( const DisId& dis_name, ObjectType oType = EntityType,
126  int systemId = NoSystemId, int beamId = NoBeamId ) const;
127 
131  virtual void setDebug( bool debugOn );
132 
134  virtual bool debug () const;
135 
139  virtual void setParseUnknownIds(bool parseOn);
140 
142  virtual bool parseUnknownIds() const;
143 
144  protected:
145 
147  const PortalId& parseAndCreatePortalId( const DisId& disName, const DtStringHashKey& disKey,
148  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
149 
151  const DisId& parseAndCreateDisId( const PortalId& portalName, const DtStringHashKey& portalKey,
152  ObjectType* oType = 0, int* systemId = 0, int* beamId = 0 );
153 
154  virtual bool addUnknownIds( const PortalId& portal_name, const DisId& dis_name,
155  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
156 
157  DtStringHashKey createDisKey( const DisId& dis_name,
158  ObjectType oType, int systemId, int beamId ) const;
159 
160  protected:
161 
164 
166  DtHashlist *myPortalIdHashList;
167 
169  DtHashlist *myDisIdHashList;
170 
174 
177 
178  };
179 
180 
183  {
184  public:
185 
188  int sysId= DtGlobalIdMapper::NoSystemId,
189  int beamId = DtGlobalIdMapper::NoBeamId);
190 
192  int systemId() const;
193  int beamId() const;
194 
195  DtGlobalIdMapper::ObjectType objectType() const;
196  const DtGlobalIdMapper::DisId *gid() const ;
197 
198  protected:
199 
201  int myBeamId;
204 
205  };
206 
207  DT_DLL_DISBROKER std::ostream& operator << (std::ostream& os, const DtGlobalIdMapper::ObjectType &ut);
208 
209  }
210 }
ObjectType
Definition: disBroker/disBroker/globalIdMapper.h:65
int mySystemId
Definition: disBroker/disBroker/globalIdMapper.h:200
DtGlobalIdMapper is used by the DIS Broker to convert between Portal ObjectIds and DIS Entity IDs...
Definition: disBroker/disBroker/globalIdMapper.h:45
Definition: disBroker/disBroker/globalIdMapper.h:67
Definition: disBroker/disBroker/globalIdMapper.h:63
int myBeamId
Definition: disBroker/disBroker/globalIdMapper.h:201
DtGlobalIdMapper::DisId * myGid
Definition: disBroker/disBroker/globalIdMapper.h:203
DtHashlist * myUnknownDisIdHashList
Definition: disBroker/disBroker/globalIdMapper.h:173
A simple helper class for DtGlobalIdMapper.
Definition: disBroker/disBroker/globalIdMapper.h:182
Definition: disBroker/disBroker/globalIdMapper.h:62
DtHashlist * myPortalIdHashList
a list of Portal ID&#39;s hashed by DIS ID&#39;s
Definition: disBroker/disBroker/globalIdMapper.h:166
const DisId myEmptyDisId
Definition: disBroker/disBroker/globalIdMapper.h:176
const PortalId myEmptyPortalId
Definition: disBroker/disBroker/globalIdMapper.h:175
bool myParseUnknownIds
Definition: disBroker/disBroker/globalIdMapper.h:163
DtEntityIdentifier DisId
A typedef to make it easier to see what kid of ID this is.
Definition: disBroker/disBroker/globalIdMapper.h:54
DtHashlist * myUnknownPortalIdHashList
We need the same type of hash lists for global ID&#39;s.
Definition: disBroker/disBroker/globalIdMapper.h:172
DtString PortalId
A typedef to make it easier to see what kind of ID this is.
Definition: disBroker/disBroker/globalIdMapper.h:58
DtHashlist * myDisIdHashList
a List of DIS ID&#39;s hashed by Portal ID&#39;s
Definition: disBroker/disBroker/globalIdMapper.h:169
#define DT_DLL_DISBROKER
Definition: brokers/disBroker/disBroker/dllExport.h:20
bool myDebugOutputOn
Definition: disBroker/disBroker/globalIdMapper.h:162
DtGlobalIdMapper::ObjectType myType
Definition: disBroker/disBroker/globalIdMapper.h:202
DtString PortalId
A typedef to make it easier to see what kind of ID this is.
Definition: rprBroker/rprBroker/globalIdMapper.h:25
DT_DLL_DISBROKER std::ostream & operator<<(std::ostream &os, const DtGlobalIdMapper::ObjectType &ut)

Document ID: Generated on Mon Apr 19 15:55:22 EDT 2021 from SVN revision 227909
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)