Jlm
Public Member Functions | Private Attributes | List of all members
jlm::util::StatisticsCollectorSettings Class Referencefinal

#include <Statistics.hpp>

Collaboration diagram for jlm::util::StatisticsCollectorSettings:
Collaboration graph
[legend]

Public Member Functions

 StatisticsCollectorSettings ()
 
 StatisticsCollectorSettings (HashSet< Statistics::Id > demandedStatistics)
 
 StatisticsCollectorSettings (HashSet< Statistics::Id > demandedStatistics, std::optional< FilePath > directory, std::string moduleName)
 
void SetDemandedStatistics (HashSet< Statistics::Id > demandedStatistics)
 
size_t NumDemandedStatistics () const noexcept
 
const HashSet< Statistics::Id > & GetDemandedStatistics () const noexcept
 
bool isDemanded (Statistics::Id id) const noexcept
 Checks if a statistics is demanded. More...
 
bool HasOutputDirectory () const noexcept
 
const FilePathGetOutputDirectory () const noexcept
 
const FilePathGetOrCreateOutputDirectory () const noexcept
 
void SetOutputDirectory (FilePath directory)
 
const std::string & GetModuleName () const noexcept
 
void SetModuleName (std::string moduleName)
 
const std::string & GetUniqueString () const noexcept
 
void SetUniqueString (std::string uniqueString)
 

Private Attributes

HashSet< Statistics::IdDemandedStatistics_
 
std::optional< FilePathDirectory_
 
std::string ModuleName_
 
std::string UniqueString_ = CreateRandomAlphanumericString(6)
 

Detailed Description

Determines the settings of a StatisticsCollector.

Definition at line 254 of file Statistics.hpp.

Constructor & Destructor Documentation

◆ StatisticsCollectorSettings() [1/3]

jlm::util::StatisticsCollectorSettings::StatisticsCollectorSettings ( )
inline

Creates settings for a StatisticsCollector that does not demand any statistics. Uses the current working directory for any output files.

Definition at line 261 of file Statistics.hpp.

◆ StatisticsCollectorSettings() [2/3]

jlm::util::StatisticsCollectorSettings::StatisticsCollectorSettings ( HashSet< Statistics::Id demandedStatistics)
inlineexplicit

Creates settings for a StatisticsCollector that demands the given statistics be collected. Uses the current working directory for any output files.

Parameters
demandedStatisticsa hash set of statistics ids to collect

Definition at line 271 of file Statistics.hpp.

◆ StatisticsCollectorSettings() [3/3]

jlm::util::StatisticsCollectorSettings::StatisticsCollectorSettings ( HashSet< Statistics::Id demandedStatistics,
std::optional< FilePath directory,
std::string  moduleName 
)
inline

Creates settings for a StatisticsCollector that demands the given statistics be collected, and specifies the output directory to place statistics and debug output.

The directory does not need to exist, but its parent directory must exist. The output directory is only created if output files are created.

Output files get the given module name as a prefix, in addition to a unique random string generated per StatisticsCollectorSettings.

Parameters
demandedStatisticsa hash set of statistics ids to collect
directorythe directory where statistics and debug output should be placed
moduleNamea prefix given to all files created in the given directory

Definition at line 291 of file Statistics.hpp.

Member Function Documentation

◆ GetDemandedStatistics()

const HashSet<Statistics::Id>& jlm::util::StatisticsCollectorSettings::GetDemandedStatistics ( ) const
inlinenoexcept
Returns
a hash set containing the Ids of statistics that should be collected

Definition at line 323 of file Statistics.hpp.

◆ GetModuleName()

const std::string& jlm::util::StatisticsCollectorSettings::GetModuleName ( ) const
inlinenoexcept
Returns
the module name used as a prefix for all output files

Definition at line 388 of file Statistics.hpp.

◆ GetOrCreateOutputDirectory()

const FilePath& jlm::util::StatisticsCollectorSettings::GetOrCreateOutputDirectory ( ) const
inlinenoexcept
Returns
the directory used for outputting statistics and debug output files.
Note
If no output directory path is given, an assertion failure occurs. If the directory does not exist yet, it is created.

Definition at line 366 of file Statistics.hpp.

◆ GetOutputDirectory()

const FilePath& jlm::util::StatisticsCollectorSettings::GetOutputDirectory ( ) const
inlinenoexcept
Returns
the directory used for outputting statistics and debug output files.

Definition at line 353 of file Statistics.hpp.

◆ GetUniqueString()

const std::string& jlm::util::StatisticsCollectorSettings::GetUniqueString ( ) const
inlinenoexcept
Returns
the unique string included in the name of all created files

Definition at line 406 of file Statistics.hpp.

◆ HasOutputDirectory()

bool jlm::util::StatisticsCollectorSettings::HasOutputDirectory ( ) const
inlinenoexcept
Returns
true if a directory for outputting statistics and debug output files is specified, otherwise false

Definition at line 344 of file Statistics.hpp.

◆ isDemanded()

bool jlm::util::StatisticsCollectorSettings::isDemanded ( Statistics::Id  id) const
inlinenoexcept

Checks if a statistics is demanded.

Parameters
idThe Id of the statistics.
Returns
True if a statistics is demanded, otherwise false.

Definition at line 334 of file Statistics.hpp.

◆ NumDemandedStatistics()

size_t jlm::util::StatisticsCollectorSettings::NumDemandedStatistics ( ) const
inlinenoexcept
Returns
the number of demanded statistics

Definition at line 314 of file Statistics.hpp.

◆ SetDemandedStatistics()

void jlm::util::StatisticsCollectorSettings::SetDemandedStatistics ( HashSet< Statistics::Id demandedStatistics)
inline

Sets the hash set containing the Ids of statistics that should be collected

Parameters
demandedStatisticsthe new hash set of demanded statistics

Definition at line 305 of file Statistics.hpp.

◆ SetModuleName()

void jlm::util::StatisticsCollectorSettings::SetModuleName ( std::string  moduleName)
inline

Sets the module name used as a prefix for all output files

Definition at line 397 of file Statistics.hpp.

◆ SetOutputDirectory()

void jlm::util::StatisticsCollectorSettings::SetOutputDirectory ( FilePath  directory)
inline

Sets the directory used for outputting statistics and debug output files. It does not need to exist, but its parent directory must always exist.

Parameters
directorythe directory to place statistics and debug output files in

Definition at line 379 of file Statistics.hpp.

◆ SetUniqueString()

void jlm::util::StatisticsCollectorSettings::SetUniqueString ( std::string  uniqueString)
inline

Sets the unique string to be included in the name of all created files

Parameters
uniqueStringthe new unique string

Definition at line 416 of file Statistics.hpp.

Member Data Documentation

◆ DemandedStatistics_

HashSet<Statistics::Id> jlm::util::StatisticsCollectorSettings::DemandedStatistics_
private

Definition at line 422 of file Statistics.hpp.

◆ Directory_

std::optional<FilePath> jlm::util::StatisticsCollectorSettings::Directory_
private

Definition at line 423 of file Statistics.hpp.

◆ ModuleName_

std::string jlm::util::StatisticsCollectorSettings::ModuleName_
private

Definition at line 424 of file Statistics.hpp.

◆ UniqueString_

std::string jlm::util::StatisticsCollectorSettings::UniqueString_ = CreateRandomAlphanumericString(6)
private

Definition at line 425 of file Statistics.hpp.


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