Libbarrett  1.2.4
include/barrett/os.h
00001 /*
00002         Copyright 2009-2014 Barrett Technology <support@barrett.com>
00003 
00004         This file is part of libbarrett.
00005 
00006         This version of libbarrett is free software: you can redistribute it
00007         and/or modify it under the terms of the GNU General Public License as
00008         published by the Free Software Foundation, either version 3 of the
00009         License, or (at your option) any later version.
00010 
00011         This version of libbarrett is distributed in the hope that it will be
00012         useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014         GNU General Public License for more details.
00015 
00016         You should have received a copy of the GNU General Public License along
00017         with this version of libbarrett.  If not, see
00018         <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00028 #ifndef BARRETT_OS_H_
00029 #define BARRETT_OS_H_
00030 
00031 
00032 #include <string>
00033 #include <barrett/detail/os.h>
00034 
00035 
00036 namespace barrett {
00037 
00041 void btsleep(double duration_s);
00042 void btsleepRT(double duration_s);
00043 void btsleep(double duration_s, bool realtime);
00044 
00048 double highResolutionSystemTime();
00049 
00050 class PeriodicLoopTimer {
00051 public:
00052         explicit PeriodicLoopTimer(double period_, int threadPriority = 10);
00053 
00054         unsigned long wait();
00055 
00056 protected:
00057         bool firstRun;
00058         double period;
00059         double releasePoint;
00060 };
00061 
00062 
00072 detail::LogFormatter logMessage(const std::string& message,
00073                 bool outputToStderr = false);
00074 
00075 
00076 }
00077 
00078 
00079 #endif /* BARRETT_OS_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines