Proton  1.1.1
Make porting easy from Python to C++11
proton::ref_< objT, allocator > Struct Template Reference

The core reference support template. More...

#include <proton/ref.hpp>

List of all members.

Public Member Functions

 ref_ ()
 default ctor.
template<typename... argT>
 ref_ (init_alloc, argT &&...a)
 explicit forwarding ctor.
template<typename... argT>
 ref_ (argT &&...a)
 implicit forwarding ctor.
template<typename T >
 ref_ (init_alloc, std::initializer_list< T > a)
 explicit initializer_list forwarding ctor.
template<typename T >
 ref_ (std::initializer_list< T > a)
 implicit initializer_list forwarding ctor.
 ref_ (const ref_ &r)
 copy ctor.
 ref_ (ref_ &&r) noexcept
 move ctor.
ref_operator= (const ref_ &r)
 assign operator.
ref_operator= (ref_ &&r) noexcept(noexcept(_p->~objT()))
 assign move operator.
 ~ref_ () noexcept(noexcept(_p->~objT()))
 dtor.
template<typename baseT , typename = typename std::enable_if< std::is_base_of<baseT, obj_t>::value >::type>
 operator ref_< baseT > () const noexcept
 conversion to baseT.
objT * operator-> ()
 operator-> points to the object refered.
const objT * operator-> () const
 operator-> points to the object refered.
template<typename T >
bool operator== (const T &x) const
 general operator== for refs.
template<typename T >
bool operator< (const T &x) const
 general operator< for refs.
template<typename... T>
auto operator() (T &&...x) const -> decltype((*_p)(x...))
 general operator() const for refs.
template<typename... T>
auto operator() (T &&...x)-> decltype((*_p)(x...))
 general operator() for refs.
template<typename T >
auto operator[] (T &&x) const -> decltype((*_p)[x])
 general operator[] const for refs.
template<typename T >
auto operator[] (T &&x)-> decltype((*_p)[x])
 general operator[] for refs.

Detailed Description

template<typename objT, typename allocator = smart_allocator<objT>>
struct proton::ref_< objT, allocator >

The core reference support template.

Parameters:
allocatorIt must support confiscate(), and allocator::allocate() must be static.
See also:
smart_allocator in <proton/pool.hpp>
Examples:
functor.cpp.

Definition at line 176 of file ref.hpp.


Constructor & Destructor Documentation

template<typename objT, typename allocator = smart_allocator<objT>>
proton::ref_< objT, allocator >::ref_ ( )
inline

default ctor.

Doesn't refer to any object.

Definition at line 217 of file ref.hpp.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename... argT>
proton::ref_< objT, allocator >::ref_ ( init_alloc  ,
argT &&...  a 
)
inlineexplicit

explicit forwarding ctor.

Construct an obj_t using give args.

Definition at line 233 of file ref.hpp.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename... argT>
proton::ref_< objT, allocator >::ref_ ( argT &&...  a)
inlineexplicit

implicit forwarding ctor.

Construct an obj_t using give args. Note: don't conflict with copy ctors. Use the explicit fwd ctor in that case.

Definition at line 254 of file ref.hpp.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
proton::ref_< objT, allocator >::ref_ ( init_alloc  ,
std::initializer_list< T >  a 
)
inlineexplicit

explicit initializer_list forwarding ctor.

Construct an obj_t using give args.

Definition at line 260 of file ref.hpp.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
proton::ref_< objT, allocator >::ref_ ( std::initializer_list< T >  a)
inlineexplicit

implicit initializer_list forwarding ctor.

Construct an obj_t using give args.

Definition at line 280 of file ref.hpp.


Member Function Documentation

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename... T>
auto proton::ref_< objT, allocator >::operator() ( T &&...  x) const
inline

general operator() const for refs.

Need to implement obj_t() const.

Definition at line 517 of file ref.hpp.

References proton::is_null(), and PROTON_THROW_IF.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename... T>
auto proton::ref_< objT, allocator >::operator() ( T &&...  x)
inline

general operator() for refs.

Need to implement obj_t().

Definition at line 526 of file ref.hpp.

References proton::is_null(), and PROTON_THROW_IF.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
bool proton::ref_< objT, allocator >::operator< ( const T &  x) const
inline

general operator< for refs.

Need to implement obj_t < T::obj_t.

Definition at line 486 of file ref.hpp.

References proton::is_null().

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
bool proton::ref_< objT, allocator >::operator== ( const T &  x) const
inline

general operator== for refs.

Need to implement obj_t == T::obj_t.

Definition at line 467 of file ref.hpp.

References proton::is_null().

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
auto proton::ref_< objT, allocator >::operator[] ( T &&  x) )[x] const
inline

general operator[] const for refs.

Need to implement obj_t[] const.

Definition at line 535 of file ref.hpp.

References proton::is_null(), and PROTON_THROW_IF.

template<typename objT, typename allocator = smart_allocator<objT>>
template<typename T >
auto proton::ref_< objT, allocator >::operator[] ( T &&  x) )[x]
inline

general operator[] for refs.

Need to implement obj_t[].

Definition at line 544 of file ref.hpp.

References proton::is_null(), and PROTON_THROW_IF.


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