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

#include <ored/scripting/scriptedinstrument.hpp>

+ Inheritance diagram for ScriptedInstrument:
+ Collaboration diagram for ScriptedInstrument:

Classes

class  arguments
 

Public Types

using results = QuantLib::Instrument::results
 
using engine = QuantLib::GenericEngine< arguments, results >
 

Public Member Functions

 ScriptedInstrument (const QuantLib::Date &lastRelevantDate)
 
bool isExpired () const override
 
void setupArguments (QuantLib::PricingEngine::arguments *) const override
 
bool lastCalculationWasValid () const
 
QuantLib::ext::shared_ptr< PricingEngine > pricingEngine () const
 

Private Attributes

const QuantLib::Date lastRelevantDate_
 

Detailed Description

Definition at line 31 of file scriptedinstrument.hpp.

Member Typedef Documentation

◆ results

using results = QuantLib::Instrument::results

Definition at line 37 of file scriptedinstrument.hpp.

◆ engine

using engine = QuantLib::GenericEngine<arguments, results>

Definition at line 38 of file scriptedinstrument.hpp.

Constructor & Destructor Documentation

◆ ScriptedInstrument()

ScriptedInstrument ( const QuantLib::Date &  lastRelevantDate)
explicit

Definition at line 25 of file scriptedinstrument.cpp.

25 : lastRelevantDate_(lastRelevantDate) {
26}
const QuantLib::Date lastRelevantDate_

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 28 of file scriptedinstrument.cpp.

28{ return QuantLib::detail::simple_event(lastRelevantDate_).hasOccurred(); }

◆ setupArguments()

void setupArguments ( QuantLib::PricingEngine::arguments ) const
override

Definition at line 40 of file scriptedinstrument.hpp.

40{}

◆ lastCalculationWasValid()

bool lastCalculationWasValid ( ) const

Definition at line 30 of file scriptedinstrument.cpp.

30 {
31 if (auto res = QuantLib::ext::dynamic_pointer_cast<ore::data::ScriptedInstrumentPricingEngine>(engine_)) {
32 return res->lastCalculationWasValid();
33 } else if (auto res = QuantLib::ext::dynamic_pointer_cast<ore::data::ScriptedInstrumentPricingEngineCG>(engine_)) {
34 return res->lastCalculationWasValid();
35 } else {
36 QL_FAIL(
37 "internal error: could not cast to ScriptedInstrumentPricingEngine or ScriptedInstrumentPricingEngineCG");
38 }
39}

◆ pricingEngine()

QuantLib::ext::shared_ptr< PricingEngine > pricingEngine ( ) const

Definition at line 42 of file scriptedinstrument.hpp.

42{ return engine_; }
boost::shared_ptr< PricingEngine > engine_

Member Data Documentation

◆ lastRelevantDate_

const QuantLib::Date lastRelevantDate_
private

Definition at line 45 of file scriptedinstrument.hpp.