VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
vlSmartPointers.h File Reference

Includes utility functions for weak and shared pointers. More...

Go to the source code of this file.

Macros

#define BOOST_HAS_THREADS
 Required so that shared pointers are thread safe. More...
 

Functions

template<typename T >
bool DtValidAndEqual (const std::weak_ptr< T > &wp1, const std::weak_ptr< T > &wp2)
 Compare if two weak pointers are both valid and equal. More...
 
template<typename T >
bool DtValidAndEqual (const std::shared_ptr< T > &sp1, const std::weak_ptr< T > &wp1)
 Compare if a weak pointer is valid and equal to a shared pointer. More...
 
template<typename T >
bool DtValidAndEqual (const std::weak_ptr< T > &wp1, const std::shared_ptr< T > &sp1)
 Compare if a weak pointer is valid and equal to a shared pointer. More...
 

Detailed Description

Includes utility functions for weak and shared pointers.

Using std::weak_ptr and std::shared_ptr

Macro Definition Documentation

#define BOOST_HAS_THREADS

Required so that shared pointers are thread safe.

Since shared pointers can be used, across library and thread boundaries safely. NOTE: This does not make the objects that they point reentrant or thread safe. For a detailed discussion of the thread safety of shared_ptr please see the Thread Safety section of the Boost, smart_ptr documentation on http://www.boost.org

Function Documentation

template<typename T >
bool DtValidAndEqual ( const std::weak_ptr< T > &  wp1,
const std::weak_ptr< T > &  wp2 
)

Compare if two weak pointers are both valid and equal.

Parameters
wp1A weak pointer to type T.
wp2A weak pointer to type T.
Returns
Whether both weak pointers are valid and point to the same memory.
Return values
trueBoth weak pointers point to the same value.
falseBoth weak pointers point do not point to the same value or both may be invalid.
template<typename T >
bool DtValidAndEqual ( const std::shared_ptr< T > &  sp1,
const std::weak_ptr< T > &  wp1 
)

Compare if a weak pointer is valid and equal to a shared pointer.

Parameters
sp1A shared pointer to type T.
wp1A weak pointer to type T.
Returns
Whether the weak pointer is valid and points to the same memory as the shared pointer.
Return values
trueThe weak pointer is valid and points to the same memory as the shared pointer.
falseEither the weak pointer is invalid or it points to different memory than the shared pointer.
template<typename T >
bool DtValidAndEqual ( const std::weak_ptr< T > &  wp1,
const std::shared_ptr< T > &  sp1 
)

Compare if a weak pointer is valid and equal to a shared pointer.

Parameters
sp1A shared pointer to type T.
wp1A weak pointer to type T.
Returns
Whether the weak pointer is valid and points to the same memory as the shared pointer.
Return values
trueThe weak pointer is valid and points to the same memory as the shared pointer.
falseEither the weak pointer is invalid or it points to different memory than the shared pointer.

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)