Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_DataLogControl.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 
00020 #ifndef _CPP_C_DATALOGCONTROL_H_
00021 #define _CPP_C_DATALOGCONTROL_H_
00022 
00023 #include "list_t.hpp"
00024 #include "fstream_t.hpp"
00025 #include <sys/time.h>
00026 
00027 #include "C_TaskControl.hpp"
00028 #include "C_LogValue.hpp"
00029 #include "C_SemaphoreTimed.hpp"
00030 
00031 class C_DataLogControl : public C_TaskControl {
00032 
00033 public:
00034 
00035   C_DataLogControl(size_t         P_max_data,
00036                    size_t         P_max_data_log,
00037                    char          *P_file_name, 
00038                    unsigned long  P_period);
00039   ~C_DataLogControl();
00040 
00041   int data (char *P_data);
00042   virtual void do_log () ;
00043   virtual void do_log_cumul () ;
00044 
00045   virtual int data (double P_time, double P_data);
00046 
00047   int time_data (struct timeval *P_begin, struct timeval *P_end);
00048   
00049 
00050 protected:
00051 
00052   typedef list_t<C_LogValue *> T_LogValuePList, *T_pLogValuePList ;
00053 
00054   T_GeneratorError TaskProcedure () ;
00055   T_GeneratorError InitProcedure () ;
00056   T_GeneratorError EndProcedure () ;
00057   T_GeneratorError StoppingProcedure () ;
00058   T_GeneratorError ForcedStoppingProcedure () ;
00059 
00060 
00061 
00062   C_SemaphoreTimed  *m_sem ;
00063   C_Semaphore       *m_available_sem, *m_values_sem ;
00064   size_t             m_size, m_size_log ;
00065   double             m_time_ref ;
00066 
00067   C_LogValue       **m_data_values ;
00068 
00069   T_pLogValuePList   m_values, m_available, m_log ;
00070   fstream_output    *m_output_stream ;
00071 
00072 } ;
00073 
00074 
00075 #endif // _CPP_C_DATALOGCONTROL_H_
00076 
00077 
00078 
00079 
00080 
00081 

Generated on Wed Mar 7 14:44:49 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002