COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Safe pointer to an object. This is the supported method for referring to components. More...
#include <Handle.hpp>
Public Member Functions | |
Handle () | |
Default constructor, generating a null handle. More... | |
template<typename Y > | |
Handle (const boost::shared_ptr< Y > &ptr) | |
template<typename Y > | |
Handle (const Handle< Y > &other) | |
Construction from another handle. Casting is done as in construction from shared_ptr. More... | |
T * | get () const |
Raw pointer to the stored value, or null if there is none. More... | |
Handle & | swap (Handle &other) |
Swap two handles. More... | |
void | reset () |
Set the handle to null. More... | |
operator bool () const | |
Conversion to bool for null checking. More... | |
template<typename Y > | |
operator Handle< Y > () const | |
Explicit conversion to other handle type. This ony works for base classes and const/non const. More... | |
bool | operator! () const |
T * | operator-> () const |
T & | operator* () const |
template<typename Y > | |
bool | _internal_less (Handle< Y > const &rhs) const |
Internal compare function, modeled after boost::shared_ptr. More... | |
Private Member Functions | |
template<typename Y > | |
void | create_from_shared (const boost::shared_ptr< Y > &ptr) |
Helper function for the constructors. More... | |
void | create_from_shared (const boost::shared_ptr< T > &ptr) |
Avoid the is_base_of stuff when both types are the same. More... | |
template<typename Y > | |
void | create_from_shared (const boost::true_type, const boost::shared_ptr< Y > &ptr) |
Static dispatch in case T is a base of Y. More... | |
template<typename Y > | |
void | create_from_shared (const boost::false_type, const boost::shared_ptr< Y > &ptr) |
Static dispatch in case T is not a base of Y. More... | |
Private Attributes | |
boost::weak_ptr< T > | m_weak_ptr |
Weak pointer to the original shared pointer for the component. More... | |
T * | m_cached_ptr |
Cached pointer after the first dereference. More... | |
Friends | |
template<class Y > | |
class | Handle |
Needed for private access from the casting constructors. More... | |
Safe pointer to an object. This is the supported method for referring to components.
Definition at line 39 of file Handle.hpp.
|
inline |
Default constructor, generating a null handle.
Definition at line 43 of file Handle.hpp.
|
inlineexplicit |
Construction from shared_ptr. This constructor may cast the argument:
Definition at line 49 of file Handle.hpp.
Construction from another handle. Casting is done as in construction from shared_ptr.
Definition at line 57 of file Handle.hpp.
|
inline |
Internal compare function, modeled after boost::shared_ptr.
Definition at line 123 of file Handle.hpp.
|
inlineprivate |
Helper function for the constructors.
Definition at line 131 of file Handle.hpp.
|
inlineprivate |
Avoid the is_base_of stuff when both types are the same.
Definition at line 137 of file Handle.hpp.
|
inlineprivate |
Static dispatch in case T is a base of Y.
Definition at line 145 of file Handle.hpp.
|
inlineprivate |
Static dispatch in case T is not a base of Y.
Definition at line 153 of file Handle.hpp.
|
inline |
Raw pointer to the stored value, or null if there is none.
Definition at line 65 of file Handle.hpp.
|
inline |
Conversion to bool for null checking.
Definition at line 88 of file Handle.hpp.
|
inline |
Explicit conversion to other handle type. This ony works for base classes and const/non const.
Definition at line 95 of file Handle.hpp.
|
inline |
Definition at line 105 of file Handle.hpp.
|
inline |
Definition at line 116 of file Handle.hpp.
|
inline |
Definition at line 110 of file Handle.hpp.
|
inline |
Set the handle to null.
Definition at line 81 of file Handle.hpp.
Swap two handles.
Definition at line 74 of file Handle.hpp.
|
friend |
Needed for private access from the casting constructors.
Definition at line 166 of file Handle.hpp.
|
mutableprivate |
Cached pointer after the first dereference.
Definition at line 163 of file Handle.hpp.
|
private |
Weak pointer to the original shared pointer for the component.
Definition at line 160 of file Handle.hpp.
Send comments to: COOLFluiD Web Admin |