hpp-util 6.0.0
Debugging tools for the HPP project.
Loading...
Searching...
No Matches
pointer.hh File Reference
#include <memory>
Include dependency graph for pointer.hh:

Go to the source code of this file.

Namespaces

namespace  hpp
 

Macros

#define HPP_POINTER_DEFS(t)
 
#define HPP_PREDEF_CLASS(t)
 
#define HPP_STATIC_PTR_CAST(t, x)   hpp::static_pointer_cast<t>(x)
 
#define HPP_DYNAMIC_PTR_CAST(t, x)   hpp::dynamic_pointer_cast<t>(x)
 
#define HPP_STATIC_CAST_REF_CHECK(t, x)
 

Macro Definition Documentation

◆ HPP_DYNAMIC_PTR_CAST

#define HPP_DYNAMIC_PTR_CAST (   t,
 
)    hpp::dynamic_pointer_cast<t>(x)

◆ HPP_POINTER_DEFS

#define HPP_POINTER_DEFS (   t)
Value:
typedef hpp::weak_ptr<t> t##WkPtr_t; \
typedef hpp::weak_ptr<const t> t##ConstWkPtr_t; \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
Class to ease exception creation.
Definition exception-factory.hh:73

Defines the four types of smart pointers associated with type t. If t is CMyClass then

  • the type of a shared pointer to t is CMyClassShPtr
  • the type of a weak pointer to t is CMyClassWkPtr_t
  • the type of a shared pointer to t const is CMyClassConstShPtr
  • the type of a weak pointer to t const is CMyClassConstWkPtr_t

◆ HPP_PREDEF_CLASS

#define HPP_PREDEF_CLASS (   t)
Value:
class t; \
HPP_POINTER_DEFS(t); \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n

Makes a forward declaration of class t and of the four types of shared pointers associated with it.

◆ HPP_STATIC_CAST_REF_CHECK

#define HPP_STATIC_CAST_REF_CHECK (   t,
 
)
Value:
try { \
dynamic_cast<t&>(x); \
} catch (const std::exception& exc) { \
assert("Cast in #t failed" && 0); \
}

◆ HPP_STATIC_PTR_CAST

#define HPP_STATIC_PTR_CAST (   t,
 
)    hpp::static_pointer_cast<t>(x)