VR-Vantage 3.0 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProxy.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef DtProxy_H_
10 #define DtProxy_H_
11 
12 #include <vrvUtil/vrvUtil.h>
13 #include <vlutil/vlSmartPointers.h>
14 #include <vlutil/vlExceptions.h>
15 
16 #include <map>
17 
18 namespace makVrv
19 {
20  class DtMessage;
21 
39  {
40  public:
41 
43  DtProxy();
44 
46  virtual void makeInvalid();
47 
51  inline bool isValid() const
52  {
53  return myValidFlag;
54  }
55 
60  inline void validate() const
61  {
62  if(!isValid())
63  {
64  DtTHROW_NEW(DtCorruptedState, "Interface is invalid.");
65  }
66  }
67 
68  protected:
69 
71  };
72 
73  typedef DtBoost::weak_ptr<DtProxy> DtProxyWP;
74  typedef DtBoost::shared_ptr<DtProxy> DtProxySP;
75 
79  template <typename K, typename V>
80  DtBoost::shared_ptr<V> DtFindProxyByName(std::map<K, DtBoost::weak_ptr<V> >& map, const std::string& name)
81  {
82  typedef DtBoost::weak_ptr<V> VWP;
83  typedef DtBoost::shared_ptr<V> VSP;
84 
85  typename std::map<K, DtBoost::weak_ptr<V> >::iterator iter = map.find(name);
86  if(iter != map.end())
87  {
88  VSP proctor = iter->second.lock();
89  if(proctor)
90  {
91  return proctor;
92  }
93  }
94  return VSP();
95  }
96 
97 }
98 
99 #endif


Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)