VR-Vantage 2.4 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 /******************************************************************************
6 ** $RCSfile: DtProxy.h,v $ $Revision: 1.31 $ $State: Exp $
7 ******************************************************************************/
8 
11 
12 #ifndef DtProxy_H_
13 #define DtProxy_H_
14 
15 #include <vrvUtil/vrvUtil.h>
16 #include <vlutil/vlSmartPointers.h>
17 #include <vlutil/vlExceptions.h>
18 
19 #include <map>
20 
21 namespace makVrv
22 {
23  class DtMessage;
24 
42  {
43  public:
44 
46  DtProxy();
47 
49  virtual void makeInvalid();
50 
54  inline bool isValid() const
55  {
56  return myValidFlag;
57  }
58 
63  inline void validate() const
64  {
65  if(!isValid())
66  {
67  DtTHROW_NEW(DtCorruptedState, "Interface is invalid.");
68  }
69  }
70 
71  protected:
72 
74  };
75 
76  typedef DtBoost::weak_ptr<DtProxy> DtProxyWP;
77  typedef DtBoost::shared_ptr<DtProxy> DtProxySP;
78 
82  template <typename K, typename V>
83  DtBoost::shared_ptr<V> DtFindProxyByName(std::map<K, DtBoost::weak_ptr<V> >& map, const std::string& name)
84  {
85  typedef DtBoost::weak_ptr<V> VWP;
86  typedef DtBoost::shared_ptr<V> VSP;
87 
88  typename std::map<K, DtBoost::weak_ptr<V> >::iterator iter = map.find(name);
89  if(iter != map.end())
90  {
91  VSP proctor = iter->second.lock();
92  if(proctor)
93  {
94  return proctor;
95  }
96  }
97  return VSP();
98  }
99 
100 }
101 
102 #endif


Copyright © 2005-2018 VT MAK. All Rights Reserved (www.mak.com)