Bytemaster's Boost Libraries
|
Behaves like a smart pointer that can handle any type with the same interface. More...
#include <any_ptr.hpp>
Public Types | |
typedef boost::reflect::vtable < InterfaceType, InterfaceDelegate > | vtable_type |
typedef InterfaceType | interface_type |
typedef InterfaceDelegate | delegate_type |
Public Member Functions | |
operator bool () const | |
bool | operator! () const |
template<typename T > | |
any_ptr (T *v) | |
template<typename T > | |
any_ptr (const boost::shared_ptr< T > &v) | |
template<typename OtherInterface , typename OtherDelegate > | |
any_ptr (const any_ptr< OtherInterface, OtherDelegate > &p) | |
constructs an any_ptr from another any_ptr with compatible interface. | |
const vtable_type & | operator* () const |
vtable_type & | operator* () |
const vtable_type * | operator-> () const |
vtable_type * | operator-> () |
Protected Attributes | |
boost::any | m_ptr |
boost::shared_ptr< vtable_type > | m_vtable |
Behaves like a smart pointer that can handle any type with the same interface.
If constructed from a shared pointer, then a copy of the shared pointer will go with every any_ptr. If constructed from a regular pointer, then the pointer must be valid for the life of all copies of the any_ptr.