12 #ifndef ECL_TIME_SLEEP_POS_HPP_ 13 #define ECL_TIME_SLEEP_POS_HPP_ 20 #if defined(ECL_IS_POSIX) 82 Sleep(
const unsigned long &seconds = 0);
92 void operator()() ecl_assert_throw_decl(StandardException);
124 timespec required, remaining;
153 MilliSleep(
const unsigned long &milliseconds = 0);
155 virtual ~MilliSleep() {}
164 void operator()() ecl_assert_throw_decl(StandardException);
185 timespec required, remaining;
214 MicroSleep(
const unsigned long µseconds = 0);
216 virtual ~MicroSleep() {}
226 void operator()() ecl_assert_throw_decl(StandardException);
246 timespec required, remaining;
275 NanoSleep(
const unsigned long &nanoseconds = 0);
277 virtual ~NanoSleep() {}
287 void operator()() ecl_assert_throw_decl(StandardException);
307 timespec required, remaining;
317 #if defined(ECL_HAS_EXCEPTIONS) 332 int error_result = errno;
333 switch (error_result) {
334 case ( EINTR ) :
return StandardException(loc,
ecl::InterruptedError,
"A posix signal interrupted the sleep.");
335 case ( EINVAL ) :
return StandardException(loc,
ecl::InvalidInputError,
"Specified value was negative or exceeded resolution range.\n\n Sleep: [N/A]\n MilliSleep: [0-1000]\n MicroSleep: [0-1x10^6]\n NanoSleep: [0-1x10^9]\n");
336 case ( EFAULT ) :
return StandardException(loc,
ecl::MemoryError,
"Internal posix issue copying information from user space.");
339 std::ostringstream ostream;
340 ostream <<
"Unknown posix error " << error_result <<
": " << strerror(error_result) <<
".";
341 return StandardException(loc,
UnknownError, ostream.str());
Embedded control libraries.
Cross-platform header inclusions for the duration typedefs.
#define ecl_assert_throw_decl(exception)
TimeStamp Duration
Convenience typedef to associate timestamps with the concept of durations.