Logo
Reference manual - version orea_version
StringStreamCrifLoader Class Referenceabstract
Inheritance diagram for StringStreamCrifLoader:

Public Member Functions

 StringStreamCrifLoader (const QuantLib::ext::shared_ptr< SimmConfiguration > &configuration, const std::vector< std::set< std::string > > &additionalHeaders={}, bool updateMapper=false, bool aggregateTrades=true, bool allowUseCounterpartyTrade=true, char eol='\n', char delim='\t', char quoteChar='\0', char escapeChar='\\', const std::string &nullString="#N/A")
Public Member Functions inherited from CrifLoader
 CrifLoader (const QuantLib::ext::shared_ptr< SimmConfiguration > &configuration, const std::vector< std::set< std::string > > &additionalHeaders={}, bool updateMapper=false, bool aggregateTrades=true, bool allowUseCounterpartyTrade=true)
virtual ~CrifLoader ()
virtual QuantLib::ext::shared_ptr< CrifloadCrif ()
const QuantLib::ext::shared_ptr< SimmConfiguration > & simmConfiguration ()
 SIMM configuration getter.

Protected Member Functions

QuantLib::ext::shared_ptr< CrifloadCrifImpl () override
QuantLib::ext::shared_ptr< CrifloadFromStream (std::stringstream &&stream)
 Core CRIF loader from generic istream.
virtual std::stringstream stream () const =0
void processHeader (const std::vector< std::string > &headers)
 Process the elements of a header line of a CRIF file.
bool process (const std::vector< std::string > &entries, QuantLib::Size maxIndex, QuantLib::Size currentLine, const QuantLib::ext::shared_ptr< Crif > &result, std::vector< std::tuple< std::string, std::string, std::string, std::string > > &structuredErrors)
Protected Member Functions inherited from CrifLoader
void addRecordToCrif (const QuantLib::ext::shared_ptr< Crif > &crif, CrifRecord &&recordToAdd) const
void validateSimmRecord (const CrifRecord &cr) const
 Check if the record is a valid Simm Crif Record.
void currencyOverrides (CrifRecord &crifRecord) const
 Override currency codes.
void updateMapping (const CrifRecord &cr) const
 update bucket mappings

Protected Attributes

std::map< QuantLib::Size, QuantLib::Size > columnIndex_
std::map< QuantLib::Size, std::set< std::string > > additionalHeadersIndexMap_
char eol_
char delim_
char quoteChar_
char escapeChar_
std::string nullString_
Protected Attributes inherited from CrifLoader
QuantLib::ext::shared_ptr< SimmConfigurationconfiguration_
 Simm configuration that is used during loading of CRIF records.
std::vector< std::set< std::string > > additionalHeaders_
 Defines accepted column headers, beyond required and optional headers, see crifloader.cpp.
bool updateMapper_
bool aggregateTrades_
bool allowUseCounterpartyTrade_

Additional Inherited Members

Static Protected Attributes inherited from CrifLoader
static std::map< QuantLib::Size, std::set< std::string > > requiredHeaders
 Map giving required CRIF file headers and their allowable alternatives.
static std::map< QuantLib::Size, std::set< std::string > > optionalHeaders
 Map giving optional CRIF file headers and their allowable alternatives.

Member Function Documentation

◆ loadCrifImpl()

QuantLib::ext::shared_ptr< Crif > loadCrifImpl ( )
overrideprotectedvirtual

Implements CrifLoader.

◆ process()

bool process ( const std::vector< std::string > & entries,
QuantLib::Size maxIndex,
QuantLib::Size currentLine,
const QuantLib::ext::shared_ptr< Crif > & result,
std::vector< std::tuple< std::string, std::string, std::string, std::string > > & structuredErrors )
protected

Process a line of a CRIF file and return true if valid line or false if an invalid line

Member Data Documentation

◆ columnIndex_

std::map<QuantLib::Size, QuantLib::Size> columnIndex_
protected

Internal map from known index of CRIF record member to file column For example, give trade ID an index of 0 and find the column index of trade ID in the CRIF file e.g. n. The map entry would be [0, n]