VR-Exchange 2.6 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ddsBroker/ddsBroker/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 <ddsBroker/dllExport.h>
13 
14 // ************************************************************************ //
15 // Use the DIS implementation from VR-Link by temporarily defining DtDIS.
16 // ************************************************************************ //
17 #ifndef DtDIS
18 # define MUST_UNDEF_DTDIS
19 # define DtDIS 1
20 #endif
21 
22 #include <vl/globalObjectDesignator.h>
23 
24 #ifdef MUST_UNDEF_DTDIS
25 # undef DtDIS
26 #endif
27 // ************************************************************************ //
28 
29 #include <vlutil/vlHashlist.h>
30 #include <vlutil/vlHashKeys.h>
31 #include <vlutil/vlString.h>
32 
33 namespace MAKVrExchange
34 {
35  namespace DtDdsBroker
36  {
37 
38  class DtGlobalIdMapper;
39 
41  typedef DtGlobalIdMapper* (*DtGlobalIdMapperCreator)();
42 
56  {
57  public:
58 
59  typedef DtEntityIdentifier DdsId;
60  typedef DtString PortalId;
61 
64  enum { NoSystemId = -1};
65  enum { NoBeamId = -1};
66 
67  typedef enum {
68  NoType = -1,
69  EntityType = 0,
70  EmitterSystemType = 1,
71  RadioTransmitterType = 2,
72  RadioReceiverType = 3,
73  EmitterBeamType = 4,
74  EnvironmentProcess = 5,
75  GridData = 6
76  } ObjectType;
77 
78  public:
79 
82 
84  virtual ~DtGlobalIdMapper();
85 
88  virtual bool add(const PortalId &portal_name,
89  const DdsId &dds_name,
90  ObjectType oType = EntityType,
91  int systemId = NoSystemId,
92  int beamId = NoBeamId);
93 
96  virtual void remove(const PortalId &portal_name);
97  virtual void remove(const DdsId &dds_name,
98  ObjectType otype = EntityType,
99  int systemId = NoSystemId,
100  int beamId = NoBeamId);
101 
102 
105  virtual void remove(const PortalId &portal_name,
106  const DdsId &dds_name,
107  ObjectType otype = EntityType,
108  int systemId = NoSystemId,
109  int beamId = NoBeamId);
110 
114  virtual const PortalId &convertDdsGidToPortalGid(
115  const DdsId &dds_name,
116  ObjectType = EntityType,
117  int systemId = NoSystemId,
118  int beamId = NoBeamId);
119 
122  virtual const DdsId &convertPortalGidToDdsGid(
123  const PortalId &portal_name,
124  ObjectType* otype = 0,
125  int* systemId = 0,
126  int* beamId = 0);
127 
128  virtual bool unique(const PortalId &portal_name) const;
129  virtual bool unique(const DdsId &dds_name,
130  ObjectType oType = EntityType,
131  int systemId = NoSystemId,
132  int beamId = NoBeamId) const;
133 
134  virtual void setDebug( bool debugOn);
135  virtual bool debug () const;
136 
137  virtual void setParseUnknownIds(bool parseOn);
138  virtual bool parseUnknownIds() const;
139 
140  protected:
141 
143  const PortalId& parseAndCreatePortalId(
144  const DdsId& ddsName, const DtStringHashKey& ddsKey,
145  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId);
146 
148  const DdsId& parseAndCreateDdsId(
149  const PortalId& portalName, const DtStringHashKey& portalKey,
150  ObjectType* oType = 0, int* systemId = 0, int* beamId = 0);
151 
152  virtual bool addUnknownIds(const PortalId &portal_name,
153  const DdsId &dds_name,
154  ObjectType oType = EntityType,
155  int systemId = NoSystemId,
156  int beamId = NoBeamId);
157 
158  DtStringHashKey createDdsKey(const DdsId& dds_name,
159  ObjectType oType, int systemId, int beamId) const;
160 
163 
165  DtHashlist *myPortalIdHashList;
166 
168  DtHashlist *myDdsIdHashList;
169 
173 
176 
177  };
178 
181  {
182  public:
183 
186  int sysId= DtGlobalIdMapper::NoSystemId,
188 
190  int systemId() const;
191  int beamId() const;
192 
194  const DtGlobalIdMapper::DdsId *gid() const ;
195 
196  protected:
197 
199  int myBeamId;
202 
203  };
204 
205  }
206 }

Document ID: Generated on Wed Jan 30 18:15:18 EST 2019 from SVN revision 195534
Copyright © 2005-2019 VT MÄK. All Rights Reserved (www.mak.com)