ATLAS Offline Software
CSVWrapper.h
Go to the documentation of this file.
1 #ifndef CSV_WRAPPER_H
2 #define CSV_WRAPPER_H
3 
4 #include <vector>
5 #include <memory>
6 #include <fstream>
7 
8 class CSVWrapper {
9  public:
10  using tableline = std::vector<std::string>;
11  //Empty Constructor For initialisation
13  //Constructor
14  CSVWrapper(std::ifstream& inputfile);
15  std::shared_ptr<tableline> FindLine(const std::vector<std::pair<int,std::string>>&
16  argumentpairs);
17  std::vector<std::shared_ptr<tableline>> FindLines(const std::vector<std::pair<int,std::string>>&
18  argumentpairs);
19 
20  tableline GetLine(const int element) const;
21  void PrintTable(bool sample = false) const;
22  private:
23  std::vector<CSVWrapper::tableline> QueryTable(const std::vector<std::pair<int,std::string>>&
24  argumentpairs);
25  std::vector<bool> ComparePreviousSearch(const std::vector<std::pair<int,std::string>>&
26  argumentpairs);
27  bool m_valid;
29  std::vector<tableline> m_table;
30  size_t m_columnwidth;
31  std::vector<std::pair<int,std::string>> m_prevsearch;
32  std::vector<std::vector<tableline>> m_previousresults;
33 };
34 #endif
CSVWrapper::m_columnwidth
size_t m_columnwidth
Definition: CSVWrapper.h:30
CSVWrapper::tableline
std::vector< std::string > tableline
Definition: CSVWrapper.h:10
CSVWrapper::QueryTable
std::vector< CSVWrapper::tableline > QueryTable(const std::vector< std::pair< int, std::string >> &argumentpairs)
Definition: CSVWrapper.cxx:144
CSVWrapper::PrintTable
void PrintTable(bool sample=false) const
Definition: CSVWrapper.cxx:110
CSVWrapper::FindLine
std::shared_ptr< tableline > FindLine(const std::vector< std::pair< int, std::string >> &argumentpairs)
Definition: CSVWrapper.cxx:45
CSVWrapper::m_table
std::vector< tableline > m_table
Definition: CSVWrapper.h:29
CSVWrapper::m_previousresults
std::vector< std::vector< tableline > > m_previousresults
Definition: CSVWrapper.h:32
CSVWrapper::m_firstsearch
bool m_firstsearch
Definition: CSVWrapper.h:28
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
CSVWrapper::m_valid
bool m_valid
Definition: CSVWrapper.h:27
CSVWrapper
Definition: CSVWrapper.h:8
CSVWrapper::GetLine
tableline GetLine(const int element) const
Definition: CSVWrapper.cxx:100
CSVWrapper::FindLines
std::vector< std::shared_ptr< tableline > > FindLines(const std::vector< std::pair< int, std::string >> &argumentpairs)
Definition: CSVWrapper.cxx:78
CSVWrapper::m_prevsearch
std::vector< std::pair< int, std::string > > m_prevsearch
Definition: CSVWrapper.h:31
FullCPAlgorithmsTest_CA.inputfile
dictionary inputfile
Definition: FullCPAlgorithmsTest_CA.py:62
CSVWrapper::ComparePreviousSearch
std::vector< bool > ComparePreviousSearch(const std::vector< std::pair< int, std::string >> &argumentpairs)
Definition: CSVWrapper.cxx:126
CSVWrapper::CSVWrapper
CSVWrapper()