Program Listing for File snooze_win.hpp
↰ Return to documentation for file (include/ecl/time/snooze_win.hpp
)
/*****************************************************************************
** Ifdefs
*****************************************************************************/
#ifndef ECL_TIME_SNOOZE_WIN_HPP_
#define ECL_TIME_SNOOZE_WIN_HPP_
/*****************************************************************************
** Platform Check
*****************************************************************************/
#include <ecl/config.hpp>
#if defined(ECL_IS_WIN32)
/*****************************************************************************
** Includes
*****************************************************************************/
#include "duration.hpp"
#include <ecl/config/macros.hpp>
#include <ecl/time_lite/types.hpp>
#include "macros.hpp"
/*****************************************************************************
** Namespaces
*****************************************************************************/
namespace ecl {
/*****************************************************************************
** Classes [Snooze]
*****************************************************************************/
class ecl_time_PUBLIC Snooze {
public:
/*********************
** C&D's
**********************/
Snooze();
Snooze (const Duration &time, const bool& validate = false );
virtual ~Snooze() {}
/*********************
** Usage Methods
**********************/
void period(const Duration &time, const bool& validate = false);
Duration period() { return Duration(time_period.tv_sec,time_period.tv_nsec); }
void initialise();
void operator()();
protected:
/*********************
** Internal Methods
**********************/
void add_period();
void validate();
/*********************
** Internal Variables
**********************/
TimeStructure time_value;
TimeStructure time_period;
long wrap_value_ns;
bool validate_times;
};
} // namespace ecl
#endif /* ECL_IS_WIN32 */
#endif /* ECL_TIME_SNOOZE_WIN_HPP_ */