VR-Exchange 2.4 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tenaBroker/tenaBroker/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 <tenaBroker/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 DtTenaBroker
22  {
23 
24  class DtGlobalIdMapper;
25 
27  typedef DtGlobalIdMapper* (*DtGlobalIdMapperCreator)();
28 
44  {
45  public:
46 
47  typedef DtEntityIdentifier TenaId;
48  typedef DtString PortalId;
49 
52  enum { NoSystemId = -1 };
53  enum { NoBeamId = -1 };
54 
55  typedef enum {
56  NoType = -1,
57  EntityType = 0,
58  EmitterSystemType = 1,
59  RadioTransmitterType = 2,
60  RadioReceiverType = 3,
61  EmitterBeamType = 4,
62  EnvironmentProcess = 5,
63  GridData = 6
64  } ObjectType;
65 
68 
70  virtual ~DtGlobalIdMapper();
71 
74  virtual bool add( const PortalId& portal_name, const TenaId& tena_name,
75  ObjectType oType = EntityType, int systemId = NoSystemId,
76  int beamId = NoBeamId );
77 
80  virtual void remove( const PortalId& portal_name );
81  virtual void remove( const TenaId& tena_name, ObjectType otype = EntityType,
82  int systemId = NoSystemId, int beamId = NoBeamId );
83 
86  virtual void remove( const PortalId& portal_name, const TenaId& tena_name,
87  ObjectType otype = EntityType, int systemId = NoSystemId,
88  int beamId = NoBeamId );
89 
93  virtual const PortalId& convertTenaGidToPortalGid( const TenaId& tena_name,
94  ObjectType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
95 
98  virtual const TenaId& convertPortalGidToTenaGid( const PortalId& portal_name,
99  ObjectType* otype = 0, int* systemId = 0, int* beamId = 0 );
100 
101  virtual bool unique( const PortalId& portal_name ) const;
102  virtual bool unique( const TenaId &tena_name, ObjectType oType = EntityType,
103  int systemId = NoSystemId, int beamId = NoBeamId ) const;
104 
105  virtual void setDebug( bool debugOn );
106  virtual bool debug () const;
107 
108  virtual void setParseUnknownIds( bool parseOn );
109  virtual bool parseUnknownIds() const;
110 
111  protected:
112 
114  const PortalId& parseAndCreatePortalId(
115  const TenaId& tenaName, const DtStringHashKey& tenaKey,
116  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
117 
119  const TenaId& parseAndCreateTenaId(
120  const PortalId& portalName, const DtStringHashKey& portalKey,
121  ObjectType* oType = 0, int* systemId = 0, int* beamId = 0 );
122 
123  virtual bool addUnknownIds( const PortalId& portal_name, const TenaId& tena_name,
124  ObjectType oType = EntityType, int systemId = NoSystemId, int beamId = NoBeamId );
125 
126  DtStringHashKey createTenaKey( const TenaId& tena_name, ObjectType oType,
127  int systemId, int beamId ) const;
128 
129  protected:
130 
133 
135  DtHashlist* myPortalIdHashList;
136 
138  DtHashlist* myTenaIdHashList;
139 
143 
146 
147  };
148 
149 
152  {
153  public:
154 
157  int sysId= DtGlobalIdMapper::NoSystemId,
158  int beamId = DtGlobalIdMapper::NoBeamId );
159 
161  int systemId() const;
162  int beamId() const;
163 
164  DtGlobalIdMapper::ObjectType objectType() const;
165  const DtGlobalIdMapper::TenaId* gid() const;
166 
167  protected:
168 
170  int myBeamId;
173 
174  };
175 
176  }
177 }

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)