VR-Exchange 2.4 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disBroker/disBroker/globalIdMapper.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2013 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(
148  const DisId& disName, const DtStringHashKey& disKey,
149  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId);
150 
152  const DisId& parseAndCreateDisId(
153  const PortalId& portalName, const DtStringHashKey& portalKey,
154  ObjectType* oType = 0, int* systemId = 0, int* beamId = 0);
155 
156  virtual bool addUnknownIds(const PortalId &portal_name,
157  const DisId &dis_name,
158  ObjectType oType = EntityType,
159  int systemId = NoSystemId,
160  int beamId = NoBeamId);
161 
162  DtStringHashKey createDisKey(const DisId& dis_name,
163  ObjectType oType, int systemId, int beamId) const;
164 
165  protected:
166 
169 
171  DtHashlist *myPortalIdHashList;
172 
174  DtHashlist *myDisIdHashList;
175 
179 
182 
183  };
184 
185 
188  {
189  public:
190 
193  int sysId= DtGlobalIdMapper::NoSystemId,
194  int beamId = DtGlobalIdMapper::NoBeamId);
195 
197  int systemId() const;
198  int beamId() const;
199 
200  DtGlobalIdMapper::ObjectType objectType() const;
201  const DtGlobalIdMapper::DisId *gid() const ;
202 
203  protected:
204 
206  int myBeamId;
209 
210  };
211 
212  DT_DLL_DISBROKER std::ostream& operator << (std::ostream& os, const DtGlobalIdMapper::ObjectType &ut);
213 
214  }
215 }

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)