VR-Link API Documentation for HLA 1516
vlSmartPointers.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
13 #pragma once
14 
20 #ifndef BOOST_HAS_THREADS
21 #define BOOST_HAS_THREADS
22 #endif
23 
25 #include "boost_1_33/smart_ptr.hpp"
26 
29 namespace DtBoost = ::boost_1_33;
30 
31 #ifdef DtUSE_UTILITIES_NAMESPACE
32 namespace DtUSE_UTILITIES_NAMESPACE
33 {
34 #endif
35 
43 template <typename T>
44 bool DtValidAndEqual(const DtBoost::weak_ptr<T>& wp1,
45  const DtBoost::weak_ptr<T>& wp2)
46 {
47  DtBoost::shared_ptr<T> sp1 = wp1.lock();
48  DtBoost::shared_ptr<T> sp2 = wp2.lock();
49 
51  return (sp1 && sp2) && (sp1 == sp2);
52 }
53 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 template <typename T>
65 bool DtValidAndEqual(const DtBoost::shared_ptr<T>& sp1,
66  const DtBoost::weak_ptr<T>& wp1)
67 {
68  DtBoost::shared_ptr<T> sp2 = wp1.lock();
70  return (sp2) && (sp1 == sp2);
71 }
72 
73 template <typename T>
74 bool DtValidAndEqual(const DtBoost::weak_ptr<T>& wp1,
75  const DtBoost::shared_ptr<T>& sp1)
76 {
77  DtBoost::shared_ptr<T> sp2 = wp1.lock();
79  return (sp2) && (sp1 == sp2);
80 }
82 
83 #ifdef DtUSE_UTILITIES_NAMESPACE
84 }
85 #endif
86 
87 

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)