VR-Exchange 2.1 API Documentation
disBroker/globalIdMapper.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  *********************************************************************/
4 #pragma once
5 
6 #include <vlutil/vlString.h>
7 #include <vlpi/entityIdentifier.h>
8 #include <vlutil/vlHashlist.h>
9 #include <vlutil/vlHashKeys.h>
10 #include <namespace.h>
11 
12 namespace MAKVrExchange
13 {
14  namespace DtDisBroker
15  {
16 
17  class DtGlobalIdMapper;
18 
20  typedef DtGlobalIdMapper* (*DtGlobalIdMapperCreator)();
21 
39  {
40  public:
41 
47  typedef DtEntityIdentifier DisId;
48 
51  typedef DtString PortalId;
52 
55  enum { NoSystemId = -1};
56  enum { NoBeamId = -1};
57 
58  typedef enum {
59  NoType = -1,
60  EntityType = 0,
61  EmitterSystemType = 1,
62  RadioTransmitterType = 2,
63  RadioReceiverType = 3,
64  EmitterBeamType = 4,
65  EnvironmentProcess = 5,
66  GridData = 6
67  } ObjectType;
68 
71 
73  virtual ~DtGlobalIdMapper();
74 
77  virtual bool add(const PortalId &portal_name,
78  const DisId &dis_name,
79  ObjectType oType = EntityType,
80  int systemId = NoSystemId,
81  int beamId = NoBeamId);
82 
86  virtual void remove(const PortalId &portal_name);
87 
91  virtual void remove(const DisId &dis_name,
92  ObjectType otype = EntityType,
93  int systemId = NoSystemId,
94  int beamId = NoBeamId);
95 
96 
99  virtual void remove(const PortalId &portal_name,
100  const DisId &dis_name,
101  ObjectType otype = EntityType,
102  int systemId = NoSystemId,
103  int beamId = NoBeamId);
104 
108  virtual const PortalId &convertDisGidToPortalGid(
109  const DisId &dis_name,
110  ObjectType = EntityType,
111  int systemId = NoSystemId,
112  int beamId = NoBeamId);
113 
116  virtual const DisId &convertPortalGidToDisGid(
117  const PortalId &portal_name,
118  ObjectType* otype = 0,
119  int* systemId = 0,
120  int* beamId = 0);
121 
123  virtual bool unique(const PortalId &portal_name) const;
124 
126  virtual bool unique(const DisId &dis_name,
127  ObjectType oType = EntityType,
128  int systemId = NoSystemId,
129  int beamId = NoBeamId) const;
130 
134  virtual void setDebug( bool debugOn);
135 
137  virtual bool debug () const;
138 
142  virtual void setParseUnknownIds(bool parseOn);
143 
145  virtual bool parseUnknownIds() const;
146 
147  protected:
149  const PortalId& parseAndCreatePortalId(
150  const DisId& disName, const DtStringHashKey& disKey,
151  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId);
152 
154  const DisId& parseAndCreateDisId(
155  const PortalId& portalName, const DtStringHashKey& portalKey,
156  ObjectType* oType = 0, int* systemId = 0, int* beamId = 0);
157 
158  virtual bool addUnknownIds(const PortalId &portal_name,
159  const DisId &dis_name,
160  ObjectType oType = EntityType,
161  int systemId = NoSystemId,
162  int beamId = NoBeamId);
163 
164  DtStringHashKey createDisKey(const DisId& dis_name,
165  ObjectType oType, int systemId, int beamId) const;
166 
167  protected:
168 
171 
173  DtHashlist *myPortalIdHashList;
174 
176  DtHashlist *myDisIdHashList;
177 
181 
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:
205  int myBeamId;
208 
209  };
210  DT_DLL_DISBROKER std::ostream& operator << (std::ostream& os, const DtGlobalIdMapper::ObjectType &ut);
211 
212  }
213 }

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)