VR-Link API Documentation for HLA 1.3
vlSmartPointers.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 ******************************************************************************/
00013 #pragma once
00014 
00020 #ifndef BOOST_HAS_THREADS
00021 #define BOOST_HAS_THREADS
00022 #endif
00023 
00025 #include "boost_1_33/smart_ptr.hpp"
00026 
00029 namespace DtBoost = ::boost_1_33;
00030 
00031 #ifdef DtUSE_UTILITIES_NAMESPACE
00032 namespace DtUSE_UTILITIES_NAMESPACE
00033 {
00034 #endif
00035 
00043 template <typename T>
00044 bool DtValidAndEqual(const DtBoost::weak_ptr<T>& wp1,
00045    const DtBoost::weak_ptr<T>& wp2)
00046 {
00047    DtBoost::shared_ptr<T> sp1 = wp1.lock();
00048    DtBoost::shared_ptr<T> sp2 = wp2.lock();
00049 
00051    return (sp1 && sp2) && (sp1 == sp2);
00052 }
00053 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 template <typename T>
00065 bool DtValidAndEqual(const DtBoost::shared_ptr<T>& sp1,
00066    const DtBoost::weak_ptr<T>& wp1)
00067 {
00068    DtBoost::shared_ptr<T> sp2 = wp1.lock();
00070    return (sp2) && (sp1 == sp2);
00071 }
00072 
00073 template <typename T>
00074 bool DtValidAndEqual(const DtBoost::weak_ptr<T>& wp1,
00075    const DtBoost::shared_ptr<T>& sp1)
00076 {
00077    DtBoost::shared_ptr<T> sp2 = wp1.lock();
00079    return (sp2) && (sp1 == sp2);
00080 }
00082 
00083 #ifdef DtUSE_UTILITIES_NAMESPACE
00084 } 
00085 #endif
00086 
00087 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)