Page MenuHomec4science

perfs_handler.hpp
No OneTemporary

File Metadata

Created
Thu, Jul 11, 18:00

perfs_handler.hpp

/*-------------------------------------------------------
- Module : utils
- File : perfs_handler.hpp
- Author : Fabien Georget
Copyright (c) 2014, Fabien Georget, Princeton University
---------------------------------------------------------*/
#ifndef SPECMICP_UTILS_PERFSHANDLER_HPP
#define SPECMICP_UTILS_PERFSHANDLER_HPP
namespace specmicp {
//! \brief Handle a performance struct for the algorithms
//!
//! Like options handler but for the performance
template <class PerformanceStruct>
class PerformanceHandler
{
public:
//! \brief Return the performance (read-only)
const PerformanceStruct& get_perfs() const {return m_perfs;}
//! \brief Reset the performance
void reset_perfs() {m_perfs = PerformanceStruct();}
//! \brief Return a reference to the performance
PerformanceStruct& get_perfs() {return m_perfs;}
protected:
//! \brief Swap the performance with another
void swap(PerformanceStruct& other) {std::swap(m_perfs, other);}
private:
PerformanceStruct m_perfs;
};
} // end namespace specmicp
#endif // SPECMICP_UTILS_PERFSHANDLER_HPP

Event Timeline