//////////////////////////////////////////////////////////////////////// /// \class RAT::DS::MetaDB /// /// \brief All the meta information about the database is stored herein. /// /// \author Phil G Jones /// /// REVISION HISTORY:\n /// 2014-04-18 : P G Jones - New file. \n /// /// \details This class stores all the relevant information about how the /// database was setup and accessed for the processing pass. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_DS_MetaDB__ #define __RAT_DS_MetaDB__ #include #include #include #include namespace RAT { namespace DS { class MetaDB : public TObject { public: MetaDB() : TObject() { } /// Add a override command /// /// @param[in] tableField descriptor /// @param[in] value to override void AddOverrideCommand( const std::string& tableField, const std::string& value ) { overrides.push_back( std::pair( tableField, value ) ); } /// Add a loaded file's contents /// /// @param[in] file contents void AddFile( const std::string& file ) { files.push_back( file ); } /// Get a override command /// /// @param[in] index of the command to get /// @return pair of the tableField and value /// @throws out_of_range if the index is not in range std::pair GetOverrideCommand( const size_t index ) const { return overrides.at( index ); } /// Get the number of override commands /// /// @return the total number of override commands size_t GetOverrideCommandCount() const { return overrides.size(); } /// Get a loaded file's contents /// /// @param[in] index of the file to get /// @return file contents /// @throws out_of_range if the index is not in range std::string GetFile( const size_t index ) const { return files.at( index ); } /// Get the number of loaded files /// /// @return the total number of files size_t GetFileCount() const { return files.size(); } // This ROOT macro adds dictionary methods to this class. // The number should be incremented whenever this class's members are changed. // It assumes this class has no virtual methods, use ClassDef if change this. ClassDefNV( MetaDB, 1 ); protected: std::vector< std::pair > overrides; ///< Vector of override commands pair of table + field descriptor and value std::vector files; ///< Vector of files stored as string }; } // namespace DS } // namespace RAT #endif