Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
TradeGroupContainer Class Reference

#include <orea/engine/marketriskreport.hpp>

+ Inheritance diagram for TradeGroupContainer:
+ Collaboration diagram for TradeGroupContainer:

Public Member Functions

 TradeGroupContainer ()
 
QuantLib::ext::shared_ptr< TradeGroupBasenext () override
 
void add (const QuantLib::ext::shared_ptr< TradeGroupBase > &tradeGroup) override
 
void reset () override
 
- Public Member Functions inherited from TradeGroupBaseContainer
 TradeGroupBaseContainer ()
 
virtual ~TradeGroupBaseContainer ()
 
virtual QuantLib::ext::shared_ptr< TradeGroupBasenext ()=0
 
virtual void add (const QuantLib::ext::shared_ptr< TradeGroupBase > &tradeGroup)=0
 
virtual void reset ()=0
 

Private Attributes

std::set< QuantLib::ext::shared_ptr< TradeGroup > > tradeGroups_
 
std::set< QuantLib::ext::shared_ptr< TradeGroup > >::const_iterator tgIdx_
 

Detailed Description

Definition at line 140 of file marketriskreport.hpp.

Constructor & Destructor Documentation

◆ TradeGroupContainer()

Definition at line 142 of file marketriskreport.hpp.

142{}

Member Function Documentation

◆ next()

QuantLib::ext::shared_ptr< TradeGroupBase > next ( )
overridevirtual

Implements TradeGroupBaseContainer.

Definition at line 101 of file marketriskreport.cpp.

101 {
102 if (tgIdx_ == tradeGroups_.end())
103 return nullptr;
104 auto tg = *tgIdx_;
105 ++tgIdx_;
106 return tg;
107}
std::set< QuantLib::ext::shared_ptr< TradeGroup > >::const_iterator tgIdx_
std::set< QuantLib::ext::shared_ptr< TradeGroup > > tradeGroups_

◆ add()

void add ( const QuantLib::ext::shared_ptr< TradeGroupBase > &  tradeGroup)
overridevirtual

Implements TradeGroupBaseContainer.

Definition at line 109 of file marketriskreport.cpp.

109 {
110 auto tg = QuantLib::ext::dynamic_pointer_cast<TradeGroup>(tradeGroup);
111 QL_REQUIRE(tg, "tradeGroup must be of type VarTradeGroup");
112 tradeGroups_.insert(tg);
113}

◆ reset()

void reset ( )
overridevirtual

Implements TradeGroupBaseContainer.

Definition at line 99 of file marketriskreport.cpp.

99{ tgIdx_ = tradeGroups_.begin(); }

Member Data Documentation

◆ tradeGroups_

std::set<QuantLib::ext::shared_ptr<TradeGroup> > tradeGroups_
private

Definition at line 149 of file marketriskreport.hpp.

◆ tgIdx_

std::set<QuantLib::ext::shared_ptr<TradeGroup>>::const_iterator tgIdx_
private

Definition at line 150 of file marketriskreport.hpp.