Cat
ProcTimer.cpp
Go to the documentation of this file.
1 // $Id: ProcTimer.cpp,v 1.1 2006/06/07 13:04:01 fmachefe Exp $
2 // Include files
3 
4 #ifdef _NETWORK_
5 
6 // Include CATProc files
7 #include "Processus.h"
8 
9 // local
10 #include "ProcTimer.h"
11 
12 //-----------------------------------------------------------------------------
13 // Implementation file for class : ProcTimer
14 //
15 // 2006-06-02 : machefert
16 //-----------------------------------------------------------------------------
17 
18 //=============================================================================
19 // Standard constructor, initializes variables
20 //=============================================================================
21 ProcTimer::ProcTimer( int time , Processus *proc ) {
22  msgSvc( INFO , "ProcTimer" , "Creating Timer [delay="+
23  itos( time ) +
24  "s] for Processus " + proc->name() );
25  m_running = true;
26  m_proc = proc ;
27  m_delay = time ;
28  start ( m_delay );
29 };
30 
31 //=============================================================================
32 // Destructor
33 //=============================================================================
34 //ProcTimer::~ProcTimer() {}
35 
36 //=========================================================================
37 //
38 //=========================================================================
39 // void ProcTimer::ignition ( ){
40 // msgSvc(INFO,"","ignition ! " + itos (int(this)));
41 // start ( m_delay );
42 // }
43 
44 
45 //=========================================================================
46 //
47 //=========================================================================
48 void ProcTimer::timeHandler() {
49  msgSvc( INFO , "ProcTimer" , "ProcTimer triggered processus update" );
50  m_proc->updateServices ();
51  if ( m_running ) {
52  msgSvc( INFO , "ProcTimer" , "running" + itos(m_delay) );
53  start ( m_delay );
54  }
55 
56 }
57 
58 #endif
std::string itos(int)
Definition: Tools.cpp:46
std::string name() const
Definition: Object.h:28
Definition: proc.py:1