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

Relinkable handle to an observable. More...

#include <handle.hpp>

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

Public Member Functions

 RelinkableHandle ()
 
 RelinkableHandle (const ext::shared_ptr< T > &p, bool registerAsObserver=true)
 
 RelinkableHandle (ext::shared_ptr< T > &&p, bool registerAsObserver=true)
 
 RelinkableHandle (T *p, bool registerAsObserver=true)
 
void linkTo (const ext::shared_ptr< T > &h, bool registerAsObserver=true)
 
void linkTo (ext::shared_ptr< T > &&h, bool registerAsObserver=true)
 
- Public Member Functions inherited from Handle< T >
 Handle ()
 
 Handle (const ext::shared_ptr< T > &p, bool registerAsObserver=true)
 
 Handle (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 117 of file handle.hpp.

Constructor & Destructor Documentation

◆ RelinkableHandle() [1/4]

Definition at line 119 of file handle.hpp.

◆ RelinkableHandle() [2/4]

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

Definition at line 202 of file handle.hpp.

◆ RelinkableHandle() [3/4]

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

Definition at line 207 of file handle.hpp.

◆ RelinkableHandle() [4/4]

RelinkableHandle ( T p,
bool  registerAsObserver = true 
)
explicit
Deprecated:
Use one of the constructors taking shared_ptr. Deprecated in version 1.35.

Definition at line 212 of file handle.hpp.

Member Function Documentation

◆ linkTo() [1/2]

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 217 of file handle.hpp.

+ Here is the caller graph for this function:

◆ linkTo() [2/2]

void linkTo ( ext::shared_ptr< T > &&  h,
bool  registerAsObserver = true 
)

Definition at line 223 of file handle.hpp.