Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F71426874
perfs_handler.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 11, 18:00
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Jul 13, 18:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18950897
Attached To
rSPECMICP SpecMiCP / ReactMiCP
perfs_handler.hpp
View Options
/*-------------------------------------------------------
- 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
Log In to Comment