cgv
Loading...
Searching...
No Matches
cgv::utils::pointer_test Class Reference

Public Member Functions

 pointer_test (const void *ptr)
 Instantiate a pointer_test with a const void pointer.
 
bool is (const void *ptr) const
 Test if the stored pointer points to the given pointer address.
 
template<typename T >
bool is (const T &ref) const
 Test if the stored pointer points to the given variable/object instance.
 
template<typename T , typename... Ts>
bool one_of (const T &ref, const Ts &... refs) const
 Test if the stored pointer points to one of the given variable/object instances.
 
bool one_of (const std::vector< const void * > &ptrs) const
 Test if the stored pointer points to one of the given pointer addresses.
 
template<typename T >
bool member_of (const T &ref) const
 Test if the stored pointer points inside the address range of the given object instance.
 

Public Attributes

const void * ptr = nullptr
 The stored pointer.
 

Detailed Description

Definition at line 9 of file pointer_test.h.

Constructor & Destructor Documentation

◆ pointer_test()

cgv::utils::pointer_test::pointer_test ( const void *  ptr)
inline

Instantiate a pointer_test with a const void pointer.

Definition at line 21 of file pointer_test.h.

Member Function Documentation

◆ is() [1/2]

template<typename T >
bool cgv::utils::pointer_test::is ( const T &  ref) const
inline

Test if the stored pointer points to the given variable/object instance.

Definition at line 30 of file pointer_test.h.

References is().

◆ is() [2/2]

bool cgv::utils::pointer_test::is ( const void *  ptr) const
inline

◆ member_of()

template<typename T >
bool cgv::utils::pointer_test::member_of ( const T &  ref) const
inline

Test if the stored pointer points inside the address range of the given object instance.

Definition at line 57 of file pointer_test.h.

References ptr.

Referenced by cgv::app::color_map_legend::handle_member_change().

◆ one_of() [1/2]

bool cgv::utils::pointer_test::one_of ( const std::vector< const void * > &  ptrs) const
inline

Test if the stored pointer points to one of the given pointer addresses.

Definition at line 49 of file pointer_test.h.

References is().

◆ one_of() [2/2]

template<typename T , typename... Ts>
bool cgv::utils::pointer_test::one_of ( const T &  ref,
const Ts &...  refs 
) const
inline

Test if the stored pointer points to one of the given variable/object instances.

Definition at line 36 of file pointer_test.h.

References is().

Member Data Documentation

◆ ptr

const void* cgv::utils::pointer_test::ptr = nullptr

The stored pointer.

Definition at line 18 of file pointer_test.h.

Referenced by is(), and member_of().


The documentation for this class was generated from the following file: