pointer.hh File Reference
#include <boost/smart_ptr.hpp>
Include dependency graph for pointer.hh:

Macros

#define HPP_POINTER_DEFS(t)
 Defines the four types of smart pointers associated with type t. More...
 
#define HPP_PREDEF_CLASS(t)
 Makes a forward declaration of class t and of the four types of shared pointers associated with it. More...
 
#define HPP_STATIC_PTR_CAST(t, x)   boost::static_pointer_cast < t > (x)
 
#define HPP_DYNAMIC_PTR_CAST(t, x)   boost::dynamic_pointer_cast < t > (x)
 
#define HPP_STATIC_CAST_REF_CHECK(t, x)
 

Macro Definition Documentation

#define HPP_DYNAMIC_PTR_CAST (   t,
 
)    boost::dynamic_pointer_cast < t > (x)
#define HPP_POINTER_DEFS (   t)
Value:
typedef boost::weak_ptr <t> t##WkPtr_t; \
typedef boost::weak_ptr <const t> t##ConstWkPtr_t; \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n

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
#define HPP_PREDEF_CLASS (   t)
Value:
class t; \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
#define HPP_POINTER_DEFS(t)
Defines the four types of smart pointers associated with type t.
Definition: pointer.hh:25

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

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