32#include <ql/types.hpp>
46 CrifLoader(
const QuantLib::ext::shared_ptr<SimmConfiguration>& configuration,
47 const std::vector<std::set<std::string>>& additionalHeaders = {},
48 bool updateMapper =
false,
bool aggregateTrades =
true)
104 const std::vector<std::set<std::string>>& additionalHeaders = {},
bool updateMapper =
false,
105 bool aggregateTrades =
true,
char eol =
'\n',
char delim =
'\t',
char quoteChar =
'\0',
106 char escapeChar =
'\\',
const std::string& nullString =
"#N/A");
114 virtual std::stringstream
stream()
const = 0;
130 bool process(
const std::vector<std::string>& entries, QuantLib::Size maxIndex, QuantLib::Size currentLine,
Crif& result);
140 CsvFileCrifLoader(
const std::string& filename,
const QuantLib::ext::shared_ptr<SimmConfiguration>& configuration,
141 const std::vector<std::set<std::string>>& additionalHeaders = {},
142 bool updateMapper =
false,
bool aggregateTrades =
true,
char eol =
'\n',
char delim =
'\t',
143 char quoteChar =
'\0',
char escapeChar =
'\\',
const std::string& nullString =
"#N/A")
144 :
StringStreamCrifLoader(configuration, additionalHeaders, updateMapper, aggregateTrades, eol, delim, quoteChar,
145 escapeChar, nullString),
150 std::stringstream
stream()
const override;
155 CsvBufferCrifLoader(
const std::string& buffer,
const QuantLib::ext::shared_ptr<SimmConfiguration>& configuration,
156 const std::vector<std::set<std::string>>& additionalHeaders = {},
157 bool updateMapper =
false,
bool aggregateTrades =
true,
char eol =
'\n',
char delim =
'\t',
158 char quoteChar =
'\0',
char escapeChar =
'\\',
const std::string& nullString =
"#N/A")
159 :
StringStreamCrifLoader(configuration, additionalHeaders, updateMapper, aggregateTrades, eol, delim, quoteChar,
160 escapeChar, nullString),
165 std::stringstream
stream()
const override;
void currencyOverrides(CrifRecord &crifRecord) const
Override currency codes.
static std::map< QuantLib::Size, std::set< std::string > > requiredHeaders
Map giving required CRIF file headers and their allowable alternatives.
QuantLib::ext::shared_ptr< SimmConfiguration > configuration_
Simm configuration that is used during loading of CRIF records.
void updateMapping(const CrifRecord &cr) const
update bucket mappings
static std::map< QuantLib::Size, std::set< std::string > > optionalHeaders
Map giving optional CRIF file headers and their allowable alternatives.
virtual Crif loadCrifImpl()=0
CrifLoader(const QuantLib::ext::shared_ptr< SimmConfiguration > &configuration, const std::vector< std::set< std::string > > &additionalHeaders={}, bool updateMapper=false, bool aggregateTrades=true)
void validateSimmRecord(const CrifRecord &cr) const
Check if the record is a valid Simm Crif Record.
const QuantLib::ext::shared_ptr< SimmConfiguration > & simmConfiguration()
SIMM configuration getter.
std::vector< std::set< std::string > > additionalHeaders_
Defines accepted column headers, beyond required and optional headers, see crifloader....
void addRecordToCrif(Crif &crif, CrifRecord &&recordToAdd) const
std::stringstream stream() const override
CsvBufferCrifLoader(const std::string &buffer, const QuantLib::ext::shared_ptr< SimmConfiguration > &configuration, const std::vector< std::set< std::string > > &additionalHeaders={}, bool updateMapper=false, bool aggregateTrades=true, char eol='\n', char delim='\t', char quoteChar='\0', char escapeChar='\\', const std::string &nullString="#N/A")
CsvFileCrifLoader(const std::string &filename, const QuantLib::ext::shared_ptr< SimmConfiguration > &configuration, const std::vector< std::set< std::string > > &additionalHeaders={}, bool updateMapper=false, bool aggregateTrades=true, char eol='\n', char delim='\t', char quoteChar='\0', char escapeChar='\\', const std::string &nullString="#N/A")
std::stringstream stream() const override
std::map< QuantLib::Size, QuantLib::Size > columnIndex_
Crif loadCrifImpl() override
bool process(const std::vector< std::string > &entries, QuantLib::Size maxIndex, QuantLib::Size currentLine, Crif &result)
virtual std::stringstream stream() const =0
std::map< QuantLib::Size, std::set< std::string > > additionalHeadersIndexMap_
Crif loadFromStream(std::stringstream &&stream)
Core CRIF loader from generic istream.
void processHeader(const std::vector< std::string > &headers)
Process the elements of a header line of a CRIF file.
Struct for holding CRIF records.
SIMM configuration interface.