Handle Class Template Reference
#include <ql/handle.hpp>
Detailed Description
template<class T>
class QuantLib::Handle< T >
Globally accessible relinkable pointer.
An instance of this class can be relinked to another shared pointer: such change will be propagated to all the copies of the instance.
- Precondition:
- Class T must inherit from Observable
- Examples:
-
BermudanSwaption.cpp, ConvertibleBonds.cpp, DiscreteHedging.cpp, EquityOption.cpp, FRA.cpp, Replication.cpp, Repo.cpp, and swapvaluation.cpp.
Public Member Functions | |
| Handle (const boost::shared_ptr< T > &h=boost::shared_ptr< T >(), bool registerAsObserver=true) | |
| void | linkTo (const boost::shared_ptr< T > &, bool registerAsObserver=true) |
| const boost::shared_ptr< T > & | currentLink () const |
| dereferencing | |
| const boost::shared_ptr< T > & | operator-> () const |
| bool | empty () const |
| checks if the contained shared pointer points to anything | |
| operator boost::shared_ptr () const | |
| allows registration as observable | |
| void | swap (Handle< T > &other) |
| swaps two handles | |
| template<class U> | |
| bool | operator== (const Handle< U > &other) |
| equality test | |
| template<class U> | |
| bool | operator!= (const Handle< U > &other) |
| disequality test | |
| template<class U> | |
| bool | operator< (const Handle< U > &other) |
| strict weak ordering | |
Related Functions | |
| (Note that these are not member functions.) | |
| void | swap (Handle< T > &, Handle< T > &) |
Constructor & Destructor Documentation
| Handle | ( | const boost::shared_ptr< T > & | h = boost::shared_ptr< T >(), |
|
| bool | registerAsObserver = true | |||
| ) | [explicit] |
Member Function Documentation
| void linkTo | ( | const boost::shared_ptr< T > & | , | |
| bool | registerAsObserver = true | |||
| ) |