Crombie Tools
crombie::FileConfig::FileConfig Class Reference

A single object that holds all of the information about the files to run on. More...

#include <FileConfig.h>

Public Member Functions

 FileConfig (const std::string &inputdir, const bool onedir=true)
 
const DirectoryInfoget_dir (const std::string &dirname) const
 Read a single directory info. More...
 
const std::vector< DirectoryInfo > & get_dirs () const
 Read the directory infos. More...
 
const bool has_data () const
 Say if this object has data directories stored in it. More...
 
const bool has_mc () const
 Say if this object has MC directories stored in it. More...
 
template<typename M , typename R >
auto runfiles (MapFunc< M > map, R reduce)
 This will perform a map-reduce operation on all of the files in this configuration. More...
 

Private Attributes

bool _has_data {false}
 Tracks when data files are stored. More...
 
bool _has_mc {false}
 Tracks when MC files are stored. More...
 
std::vector< DirectoryInfodirinfos
 Internal store of DirectoryInfo objects. More...
 
const std::string inputdir
 The directory containing the files. More...
 

Friends

std::istream & operator>> (std::istream &is, FileConfig &config)
 

Detailed Description

A single object that holds all of the information about the files to run on.

This is the result of reading a single file configuration file.

Definition at line 157 of file FileConfig.h.

Constructor & Destructor Documentation

§ FileConfig()

crombie::FileConfig::FileConfig::FileConfig ( const std::string &  inputdir,
const bool  onedir = true 
)

Definition at line 206 of file FileConfig.h.

References hadd::input, and inputdir.

Member Function Documentation

§ get_dir()

const DirectoryInfo & crombie::FileConfig::FileConfig::get_dir ( const std::string &  dirname) const

Read a single directory info.

Definition at line 215 of file FileConfig.h.

References crombie_completion::dir, and dirinfos.

§ get_dirs()

const std::vector<DirectoryInfo>& crombie::FileConfig::FileConfig::get_dirs ( ) const
inline

Read the directory infos.

Definition at line 173 of file FileConfig.h.

References crombie::FileSystem::dirname().

Referenced by crombie::Plotter::Merge().

§ has_data()

const bool crombie::FileConfig::FileConfig::has_data ( ) const
inline

Say if this object has data directories stored in it.

Definition at line 181 of file FileConfig.h.

§ has_mc()

const bool crombie::FileConfig::FileConfig::has_mc ( ) const
inline

Say if this object has MC directories stored in it.

Definition at line 179 of file FileConfig.h.

Referenced by crombie::Plotter::Merge().

§ runfiles()

template<typename M , typename R >
auto crombie::FileConfig::FileConfig::runfiles ( MapFunc< M >  map,
reduce 
)

This will perform a map-reduce operation on all of the files in this configuration.

Takes two functions. One to map files to outputs and one to reduce these outputs.

Parameters
MThe type of output of the map function
RThe type of reduce
mapIs a function that takes a FileInfo as input, and outputs some object of type M
reduceis fed ToMerge<M> as input. Whatever reduce returns is returned by runfiles.

Definition at line 315 of file FileConfig.h.

References dumpfilelist::count, Debug::Debug(), dirinfos, crombie::FileConfig::FileInfo::dirname, crombie::Misc::draw_progress(), crombie::Misc::env(), crombie::FileConfig::FileInfo::name, and localslim::running.

Friends And Related Function Documentation

§ operator>>

std::istream& operator>> ( std::istream &  is,
FileConfig config 
)
friend

Definition at line 254 of file FileConfig.h.

Member Data Documentation

§ _has_data

bool crombie::FileConfig::FileConfig::_has_data {false}
private

Tracks when data files are stored.

Definition at line 188 of file FileConfig.h.

Referenced by crombie::FileConfig::operator>>().

§ _has_mc

bool crombie::FileConfig::FileConfig::_has_mc {false}
private

Tracks when MC files are stored.

Definition at line 187 of file FileConfig.h.

Referenced by crombie::FileConfig::operator>>().

§ dirinfos

std::vector<DirectoryInfo> crombie::FileConfig::FileConfig::dirinfos
private

Internal store of DirectoryInfo objects.

Definition at line 184 of file FileConfig.h.

Referenced by get_dir(), crombie::FileConfig::operator>>(), and runfiles().

§ inputdir

const std::string crombie::FileConfig::FileConfig::inputdir
private

The directory containing the files.

Definition at line 185 of file FileConfig.h.

Referenced by FileConfig(), and crombie::FileConfig::operator>>().


The documentation for this class was generated from the following file: