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

#include <handle.hpp>

+ Inheritance diagram for Handle< T >::Link:
+ Collaboration diagram for Handle< T >::Link:

Public Member Functions

 Link (const ext::shared_ptr< T > &h, bool registerAsObserver)
 
 Link (ext::shared_ptr< T > &&h, bool registerAsObserver)
 
void linkTo (ext::shared_ptr< T >, bool registerAsObserver)
 
bool empty () const
 
const ext::shared_ptr< T > & currentLink () const
 
void update () override
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Private Attributes

ext::shared_ptr< Th_
 
bool isObserver_ = false
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

template<class T>
class QuantLib::Handle< T >::Link

Definition at line 43 of file handle.hpp.

Constructor & Destructor Documentation

◆ Link() [1/2]

Link ( const ext::shared_ptr< T > &  h,
bool  registerAsObserver 
)

Definition at line 148 of file handle.hpp.

+ Here is the call graph for this function:

◆ Link() [2/2]

Link ( ext::shared_ptr< T > &&  h,
bool  registerAsObserver 
)

Definition at line 153 of file handle.hpp.

Member Function Documentation

◆ linkTo()

void linkTo ( ext::shared_ptr< T h,
bool  registerAsObserver 
)

Definition at line 158 of file handle.hpp.

+ Here is the caller graph for this function:

◆ empty()

bool empty ( ) const

Definition at line 51 of file handle.hpp.

◆ currentLink()

const ext::shared_ptr< T > & currentLink ( ) const

Definition at line 52 of file handle.hpp.

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Definition at line 53 of file handle.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ h_

ext::shared_ptr<T> h_
private

Definition at line 56 of file handle.hpp.

◆ isObserver_

bool isObserver_ = false
private

Definition at line 57 of file handle.hpp.