MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
smartPointer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
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 std::weak_ptr<T>& wp1,const std::weak_ptr<T>& wp2)
19  {
20  std::shared_ptr<T> sp1 = wp1.lock();
21  std::shared_ptr<T> sp2 = wp2.lock();
22 
24  return (sp1 && sp2) && (sp1 == sp2);
25  }
26 
27  template <typename T>
28  bool compareValidAndEqual(const std::shared_ptr<T>& sp1,const std::weak_ptr<T>& wp1)
29  {
30  std::shared_ptr<T> sp2 = wp1.lock();
32  return (sp2) && (sp1 == sp2);
33  }
34 
35 }
36 
37 #endif
bool compareValidAndEqual(const std::weak_ptr< T > &wp1, const std::weak_ptr< T > &wp2)
Definition: smartPointer.h:18

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)