VR-Exchange 2.1 API Documentation
tenaBroker/entityIdMapper.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 2009 MaK Technologies, Inc.
3  ** All rights reserved.
4  *********************************************************************/
5 /*********************************************************************
6  ** $RCSfile: entityIdMapper.h,v $ $Revision: 1.1 $ $State: Exp $
7  *********************************************************************/
8 #ifndef DtEntityIdMapper_H_
9 #define DtEntityIdMapper_H_
10 
14 
15 #include "vlutil/vlMachineTypes.h"
16 #include "vlutil/vlFilename.h"
17 #include <map>
18 #include <namespace.h>
19 
20 class DtString;
21 class DtEntityIdentifier;
22 class DtHashlist;
23 
24 namespace MAKVrExchange
25 {
26  namespace DtTenaBroker
27  {
28 
37  {
38  public:
39 
40  DtEntityIdMapper(int siteNum, int appNum);
41 
42  virtual ~DtEntityIdMapper();
43 
44  protected:
46 
47  DtEntityIdMapper& operator=(const DtEntityIdMapper& orig);
48 
49  public:
54  virtual bool add(const DtEntityIdentifier &portalId,
55  const DtEntityIdentifier &tenaId);
56 
59  virtual void removePortalId(const DtEntityIdentifier &portalId);
60  virtual void removeTenaId(const DtEntityIdentifier &tenaId);
61 
64  virtual void remove(const DtEntityIdentifier &portalId,
65  const DtEntityIdentifier &tenaId);
66 
70  virtual const DtEntityIdentifier *convertTenaEidToPortalEid(
71  const DtEntityIdentifier &tenaId);
72  virtual const DtEntityIdentifier *convertPortalEidToTenaEid(
73  const DtEntityIdentifier &portalId);
74 
75 
76  virtual DtEntityIdentifier getNextTenaId();
77  virtual DtEntityIdentifier getNextPortalId();
78 
81  virtual DtEntityIdentifier getPersistentId(const DtString& name);
82 
84  virtual void setPersistentId(const DtString& name, const DtEntityIdentifier& id);
85 
86  virtual void setDebug(bool debugOn);
87  virtual bool debug() const;
88 
89  virtual bool portalHasMapping(const DtEntityIdentifier& portalId) const;
90  virtual bool tenaHasMapping(const DtEntityIdentifier& tenaId) const;
91 
92  //Persistent Functions
93  virtual void loadPersistentNumMappingFile();
94  virtual void savePersistentNumMappingFile();
95 
96  protected:
98  virtual bool publishingPortal(const DtEntityIdentifier &portalId) const;
99  virtual bool publishingTena(const DtEntityIdentifier &tenaId) const;
100 
102  int myAppNum;
105 
106  typedef std::map<DtEntityIdentifier, DtEntityIdentifier*> DtEntityIdMap;
107 
110 
113 
114  const DtEntityIdentifier *myEmptyPortalId;
115  const DtEntityIdentifier *myEmptyTenaId;
116 
117  //Used for Persisting entity Ids.
118  std::map<DtString,DtEntityIdentifier> myPersistNameToEntityNum;
119 
120  };
121 
122  inline void DtEntityIdMapper::setDebug(bool debugOn)
123  {
124  myDebugOutputOn = debugOn;
125  }
126 
127  inline bool DtEntityIdMapper::debug() const
128  {
129  return myDebugOutputOn;
130  }
131 
132  }
133 }
134 
135 
136 #endif

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)