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

#include <orea/engine/sensitivityfilestream.hpp>

+ Inheritance diagram for SensitivityFileStream:
+ Collaboration diagram for SensitivityFileStream:

Public Member Functions

 SensitivityFileStream (const std::string &fileName, char delim=',', const std::string &comment="#")
 Constructor providing path to csv file fileName. More...
 
 ~SensitivityFileStream () override
 
- Public Member Functions inherited from SensitivityInputStream
 SensitivityInputStream (char delim=',', const std::string &comment="#")
 Constructor. More...
 
virtual ~SensitivityInputStream ()
 
void setStream (std::istream *stream)
 
SensitivityRecord next () override
 Returns the next SensitivityRecord in the stream. More...
 
void reset () override
 Resets the stream so that SensitivityRecord objects can be streamed again. More...
 
- Public Member Functions inherited from SensitivityStream
virtual ~SensitivityStream ()
 Destructor. More...
 
virtual SensitivityRecord next ()=0
 Returns the next SensitivityRecord in the stream. More...
 
virtual void reset ()=0
 Resets the stream so that SensitivityRecord objects can be streamed again. More...
 

Private Attributes

std::ifstream * file_
 

Detailed Description

Definition at line 62 of file sensitivityfilestream.hpp.

Constructor & Destructor Documentation

◆ SensitivityFileStream()

SensitivityFileStream ( const std::string &  fileName,
char  delim = ',',
const std::string &  comment = "#" 
)

Constructor providing path to csv file fileName.

Definition at line 100 of file sensitivityfilestream.cpp.

101 : SensitivityInputStream(delim, comment) {
102
103 // set file name
104 file_ = new std::ifstream(fileName);
105 QL_REQUIRE(file_->is_open(), "error opening file " << fileName);
106 LOG("The file " << fileName << " has been opened for streaming");
107
108 // pass stream to function set stream
110}
SensitivityInputStream(char delim=',', const std::string &comment="#")
Constructor.
#define LOG(text)
+ Here is the call graph for this function:

◆ ~SensitivityFileStream()

~SensitivityFileStream ( )
override

Definition at line 112 of file sensitivityfilestream.cpp.

112 {
113 // Close the file if still open
114 if (file_->is_open()) {
115 file_->close();
116 }
117 LOG("The file stream has been closed");
118}

Member Data Documentation

◆ file_

std::ifstream* file_
private

Definition at line 70 of file sensitivityfilestream.hpp.