QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RelinkableHandle< T > Class Template Reference

Relinkable handle to an observable. More...

#include <ql/handle.hpp>

+ Inheritance diagram for RelinkableHandle< T >:
+ Collaboration diagram for RelinkableHandle< T >:

Public Member Functions

 RelinkableHandle (const ext::shared_ptr< T > &p=ext::shared_ptr< T >(), bool registerAsObserver=true)
 
 RelinkableHandle (T *p, bool registerAsObserver=true)
 
void linkTo (const ext::shared_ptr< T > &, bool registerAsObserver=true)
 
- Public Member Functions inherited from Handle< T >
 Handle ()
 
 Handle (const ext::shared_ptr< T > &p, bool registerAsObserver=true)
 
const ext::shared_ptr< T > & currentLink () const
 dereferencing More...
 
const ext::shared_ptr< T > & operator-> () const
 
const ext::shared_ptr< T > & operator* () const
 
bool empty () const
 checks if the contained shared pointer points to anything More...
 
 operator ext::shared_ptr< Observable > () const
 allows registration as observable More...
 
template<class U >
bool operator== (const Handle< U > &other) const
 equality test More...
 
template<class U >
bool operator!= (const Handle< U > &other) const
 disequality test More...
 
template<class U >
bool operator< (const Handle< U > &other) const
 strict weak ordering More...
 

Additional Inherited Members

- Protected Attributes inherited from Handle< T >
ext::shared_ptr< Linklink_
 

Detailed Description

template<class T>
class QuantLib::RelinkableHandle< T >

Relinkable handle to an observable.

An instance of this class can be relinked so that it points to another observable. The change will be propagated to all handles that were created as copies of such instance.

Precondition
Class T must inherit from Observable
Warning:
see the Handle documentation for issues relatives to registerAsObserver.
Examples
Bonds.cpp, FRA.cpp, FittedBondCurve.cpp, Gaussian1dModels.cpp, MulticurveBootstrapping.cpp, and Repo.cpp.

Definition at line 112 of file handle.hpp.

Constructor & Destructor Documentation

◆ RelinkableHandle() [1/2]

RelinkableHandle ( const ext::shared_ptr< T > &  p = ext::shared_ptr<T>(),
bool  registerAsObserver = true 
)
explicit

Definition at line 177 of file handle.hpp.

◆ RelinkableHandle() [2/2]

RelinkableHandle ( T *  p,
bool  registerAsObserver = true 
)
explicit

Definition at line 182 of file handle.hpp.

Member Function Documentation

◆ linkTo()

void linkTo ( const ext::shared_ptr< T > &  h,
bool  registerAsObserver = true 
)
Examples
Bonds.cpp, FRA.cpp, FittedBondCurve.cpp, MulticurveBootstrapping.cpp, and Repo.cpp.

Definition at line 187 of file handle.hpp.

+ Here is the caller graph for this function: