MAK Data Logger API Documentation for DIS
smartPointer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef smartPointer_H_
10 #define smartPointer_H_
11 
12 #include <vlutil/vlSmartPointers.h>
13 
14 namespace MAKLogger
15 {
16 
17  template <typename T>
18  bool compareValidAndEqual(const DtBoost::weak_ptr<T>& wp1,const DtBoost::weak_ptr<T>& wp2)
19  {
20  DtBoost::shared_ptr<T> sp1 = wp1.lock();
21  DtBoost::shared_ptr<T> sp2 = wp2.lock();
22 
24  return (sp1 && sp2) && (sp1 == sp2);
25  }
26 
27  template <typename T>
28  bool compareValidAndEqual(const DtBoost::shared_ptr<T>& sp1,const DtBoost::weak_ptr<T>& wp1)
29  {
30  DtBoost::shared_ptr<T> sp2 = wp1.lock();
32  return (sp2) && (sp1 == sp2);
33  }
34 
35 }
36 
37 #endif

Document ID: Generated on Thu Apr 10 18:53:01 EDT 2014 from SVN revision 138105
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)