Timer.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 #ifndef __TIMER_H__
00020 #define __TIMER_H__
00021 
00022 #ifdef WIN32
00023   #include <windows.h>
00024 #else
00025   #include <errno.h>
00026   #include <sys/time.h>
00027   #include <sys/types.h>
00028   #include <fcntl.h>
00029   #include <unistd.h>
00030   #include <string.h>
00031 #endif
00032 
00033 #ifndef TRUE
00034 #define TRUE 1
00035 #endif
00036 
00037 #ifndef FALSE
00038 #define FALSE 0
00039 #endif
00040 
00041 
00045 class Timer
00046 {
00047 protected:
00048 
00049 #ifndef WIN32
00050   struct timeval m_TV;
00051 #endif
00052 
00053   long           m_TimeToGo;
00054   long           m_StartTime;
00055 
00056 public:
00057   Timer();
00058   Timer(long TimeToGoMs);
00059 
00063   void Start(){Start(m_TimeToGo);}
00064   void  Start (long TimeToGoMs);
00065   void SetDelay(long delay){m_TimeToGo = delay;}
00071   int   IsDone();
00072 };
00073 
00074 
00075 
00076 
00077 
00078 
00079 class History
00080 {
00081 public:
00082   float   *m_History;
00083   int     m_DataSize;
00084   int     m_Size;
00085   int     m_Current;
00086   int     m_CurrentV;
00087 
00088 public:
00089   History();
00090   ~History();
00091 
00092   void  Init(int dataSize, int size);
00093   void  Clear();
00094   void  AddData(float *data);
00095   void  AddVertData(float *data);
00096 };
00097 
00098 #endif
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1