11 #ifndef HPP_UTIL_POINTER_HH
12 # define HPP_UTIL_POINTER_HH
17 using std::shared_ptr;
20 using std::static_pointer_cast;
21 using std::dynamic_pointer_cast;
22 using std::const_pointer_cast;
24 using std::make_shared;
36 # define HPP_POINTER_DEFS(t) \
37 typedef hpp::weak_ptr <t> t##WkPtr_t; \
38 typedef hpp::weak_ptr <const t> t##ConstWkPtr_t; \
39 struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
44 # define HPP_PREDEF_CLASS(t) \
46 HPP_POINTER_DEFS(t); \
47 struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
49 # define HPP_STATIC_PTR_CAST(t, x) hpp::static_pointer_cast < t > (x)
50 # define HPP_DYNAMIC_PTR_CAST(t, x) hpp::dynamic_pointer_cast < t > (x)
52 # define HPP_STATIC_CAST_REF_CHECK(t, x)\
54 dynamic_cast < t& > (x);\
55 } catch (const std::exception& exc) {\
56 assert ("Cast in #t failed" && 0);\
59 # define HPP_STATIC_CAST_REF_CHECK(t, x)
Definition: assertion.hh:23