#include <handle.hpp>


Usually such a handle is created by an service interface and activated by setting up the link to some internal implementation object. This setup can only be done by a friend or derived class, //////////////////////////TODO: that was the intention. Why didn't this work out as expected? while client code is free to copy and store handle objects. Finally, any handle can be closed, thereby decrementing the use count.
Definition at line 70 of file handle.hpp.
Public Member Functions | |
| Handle & | activate (shared_ptr< IMP > const &impl) |
| another way of activating a handle by sharing ownership with an existing smart-ptr | |
| template<typename DEL> | |
| Handle & | activate (IMP *impl, DEL whenDead) |
| Activation of the handle by the managing service. | |
| void | close () |
| deactivate this handle, so it isn't tied any longer to the associated implementation or service object. | |
| template<class Y> | |
| Handle (std::auto_ptr< Y > &ar) | |
| template<class Y> | |
| Handle (weak_ptr< Y > const &wr) | |
| template<class Y> | |
| Handle (shared_ptr< Y > const &r) | |
| Handle (Handle const &r) | |
| Handle () | |
| by default create an Null handle. | |
| bool | isValid () const |
| implicit conversion to bool (BoolCheckable) | |
| template<class Y> | |
| Handle & | operator= (std::auto_ptr< Y > &ar) |
| template<class Y> | |
| Handle & | operator= (shared_ptr< Y > const &sr) |
| Handle & | operator= (Handle const &r) |
Protected Types | |
| typedef std::tr1::shared_ptr< IMP > | SmPtr |
Protected Member Functions | |
| IMP & | impl () const |
Protected Attributes | |
| SmPtr | smPtr_ |
| lib::Handle< IMP >::Handle | ( | ) | [inline] |
by default create an Null handle.
Typically this is followed by activating the handle by the managing service.
Definition at line 84 of file handle.hpp.
| Handle& lib::Handle< IMP >::activate | ( | shared_ptr< IMP > const & | impl | ) | [inline] |
another way of activating a handle by sharing ownership with an existing smart-ptr
Definition at line 114 of file handle.hpp.
| Handle& lib::Handle< IMP >::activate | ( | IMP * | impl, | |
| DEL | whenDead | |||
| ) | [inline] |
Activation of the handle by the managing service.
| impl | the implementation object this handle is tied to | |
| whenDead | functor to be invoked when reaching end-of-life |
| std::bad_alloc,in | which case whenDead(impl) is invoked |
Definition at line 105 of file handle.hpp.
Referenced by control::Command::activate().

| void lib::Handle< IMP >::close | ( | ) | [inline] |
deactivate this handle, so it isn't tied any longer to the associated implementation or service object.
When all handles have either been deactivated or went out of scope, the associated implementation reaches end-of-life.
Definition at line 126 of file handle.hpp.
| bool lib::Handle< IMP >::isValid | ( | ) | const [inline] |
implicit conversion to bool (BoolCheckable)
Reimplemented in mobject::MORef< MO >, and mobject::MORef< mobject::session::Binding >.
Definition at line 130 of file handle.hpp.
1.5.6