Commit c3440296 authored by Pavel Vainerman's avatar Pavel Vainerman

Переименовал xxx_template.h --> xxx.tcc

parent f4c01132
...@@ -15,7 +15,7 @@ Source: /var/ftp/pvt/Etersoft/Ourside/unstable/sources/tarball/%name-%version.ta ...@@ -15,7 +15,7 @@ Source: /var/ftp/pvt/Etersoft/Ourside/unstable/sources/tarball/%name-%version.ta
# manually removed: glibc-devel-static # manually removed: glibc-devel-static
# Automatically added by buildreq on Fri Nov 26 2010 # Automatically added by buildreq on Fri Nov 26 2010
BuildRequires: glibc-devel-static libcomedi-devel libcommoncpp2-devel libomniORB-devel libsigc++2.0-devel python-modules xsltproc BuildRequires: libcomedi-devel libcommoncpp2-devel libomniORB-devel libsigc++2.0-devel python-modules xsltproc
# Using old package name instead of libmysqlclient-devel it absent in branch 5.0 for yauza # Using old package name instead of libmysqlclient-devel it absent in branch 5.0 for yauza
BuildRequires: libMySQL-devel BuildRequires: libMySQL-devel
...@@ -138,6 +138,7 @@ rm -f %buildroot%_libdir/*.la ...@@ -138,6 +138,7 @@ rm -f %buildroot%_libdir/*.la
%dir %_includedir/%oname/ %dir %_includedir/%oname/
%_includedir/%oname/*.h %_includedir/%oname/*.h
%_includedir/%oname/*.hh %_includedir/%oname/*.hh
%_includedir/%oname/*.tcc
%_includedir/%oname/IOs/ %_includedir/%oname/IOs/
%_includedir/%oname/modbus/ %_includedir/%oname/modbus/
%_includedir/%oname/mysql/ %_includedir/%oname/mysql/
......
...@@ -145,5 +145,5 @@ class CallBackTimer ...@@ -145,5 +145,5 @@ class CallBackTimer
}; };
}; };
#include "CallBackTimer_template.h" #include "CallBackTimer.tcc"
# endif //CallBackTimer_H_ # endif //CallBackTimer_H_
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
/*! \file /*! \file
* \author Pavel Vainerman * \author Pavel Vainerman
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
# ifndef CallBackTimer_TEMPLATE_H_ # ifndef CallBackTimer_TCC_H_
# define CallBackTimer_TEMPLATE_H_ # define CallBackTimer_TCC_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <unistd.h> #include <unistd.h>
#include <sstream> #include <sstream>
#include "CallBackTimer.h" #include "CallBackTimer.h"
...@@ -69,7 +69,7 @@ void CallBackTimer<Caller>::work() ...@@ -69,7 +69,7 @@ void CallBackTimer<Caller>::work()
terminated = false; terminated = false;
while( !terminated ) while( !terminated )
{ {
usleep(UniSetTimer::MIN_QUANTITY_TIME_MKS); usleep(UniSetTimer::MIN_QUANTITY_TIME_MKS);
for( typename TimersList::iterator li=lst.begin(); li!=lst.end(); ++li ) for( typename TimersList::iterator li=lst.begin(); li!=lst.end(); ++li )
{ {
...@@ -110,9 +110,9 @@ void CallBackTimer<Caller>::add( int id, int timeMS )throw(UniSetTypes::LimitTim ...@@ -110,9 +110,9 @@ void CallBackTimer<Caller>::add( int id, int timeMS )throw(UniSetTypes::LimitTim
{ {
ostringstream err; ostringstream err;
err << "CallBackTimers: превышено максимальное количество таймеров" << MAXCallBackTimer; err << "CallBackTimers: превышено максимальное количество таймеров" << MAXCallBackTimer;
throw UniSetTypes::LimitTimers(err.str()); throw UniSetTypes::LimitTimers(err.str());
} }
PassiveTimer pt(timeMS); PassiveTimer pt(timeMS);
TimerInfo ti(id, pt); TimerInfo ti(id, pt);
lst.push_back(ti); lst.push_back(ti);
...@@ -124,7 +124,7 @@ template <class Caller> ...@@ -124,7 +124,7 @@ template <class Caller>
void CallBackTimer<Caller>::remove( int id ) void CallBackTimer<Caller>::remove( int id )
{ {
// STL - способ поиска // STL - способ поиска
typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id)); typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id));
if( li!=lst.end() ) if( li!=lst.end() )
lst.erase(li); lst.erase(li);
} }
...@@ -147,7 +147,7 @@ void CallBackTimer<Caller>::clearTimers() ...@@ -147,7 +147,7 @@ void CallBackTimer<Caller>::clearTimers()
template <class Caller> template <class Caller>
void CallBackTimer<Caller>::reset( int id ) void CallBackTimer<Caller>::reset( int id )
{ {
typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id)); typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id));
if( li!=lst.end() ) if( li!=lst.end() )
li->pt.reset(); li->pt.reset();
} }
...@@ -155,7 +155,7 @@ void CallBackTimer<Caller>::reset( int id ) ...@@ -155,7 +155,7 @@ void CallBackTimer<Caller>::reset( int id )
template <class Caller> template <class Caller>
void CallBackTimer<Caller>::setTiming( int id, int timeMS ) void CallBackTimer<Caller>::setTiming( int id, int timeMS )
{ {
typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id)); typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id));
if( li!=lst.end() ) if( li!=lst.end() )
li->pt.setTimer(timeMS); li->pt.setTimer(timeMS);
} }
...@@ -163,7 +163,7 @@ void CallBackTimer<Caller>::setTiming( int id, int timeMS ) ...@@ -163,7 +163,7 @@ void CallBackTimer<Caller>::setTiming( int id, int timeMS )
template <class Caller> template <class Caller>
int CallBackTimer<Caller>::getInterval( int id ) int CallBackTimer<Caller>::getInterval( int id )
{ {
typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id)); typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id));
if( li!=lst.end() ) if( li!=lst.end() )
return li->pt.getInterval(); return li->pt.getInterval();
return -1; return -1;
...@@ -172,12 +172,12 @@ int CallBackTimer<Caller>::getInterval( int id ) ...@@ -172,12 +172,12 @@ int CallBackTimer<Caller>::getInterval( int id )
template <class Caller> template <class Caller>
int CallBackTimer<Caller>::getCurrent( int id ) int CallBackTimer<Caller>::getCurrent( int id )
{ {
typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id)); typename TimersList::iterator li= find_if(lst.begin(),lst.end(),FindId_eq(id));
if( li!=lst.end() ) if( li!=lst.end() )
return li->pt.getCurrent(); return li->pt.getCurrent();
return -1; return -1;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
# endif //CallBackTimer_H_ # endif //CallBackTimer_TCC_H_
...@@ -7,7 +7,7 @@ include $(top_builddir)/conf/common.mk ...@@ -7,7 +7,7 @@ include $(top_builddir)/conf/common.mk
# install # install
devel_include_HEADERS = *.h *.hh devel_include_HEADERS = *.h *.hh *.tcc
devel_includedir = $(pkgincludedir) devel_includedir = $(pkgincludedir)
all-local: all-local:
......
...@@ -115,6 +115,6 @@ class TriggerAND ...@@ -115,6 +115,6 @@ class TriggerAND
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include "TriggerAND_template.h" #include "TriggerAND.tcc"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
...@@ -43,10 +43,10 @@ bool TriggerAND<Caller,InputType>::commit(InputType num, bool state) ...@@ -43,10 +43,10 @@ bool TriggerAND<Caller,InputType>::commit(InputType num, bool state)
if( it!=inputs.end() ) if( it!=inputs.end() )
{ {
inputs[num] = state; inputs[num] = state;
check(); check();
return true; return true;
} }
return false; return false;
} }
...@@ -66,7 +66,7 @@ void TriggerAND<Caller,InputType>::remove(InputType num) ...@@ -66,7 +66,7 @@ void TriggerAND<Caller,InputType>::remove(InputType num)
if( it!=inputs.end() ) if( it!=inputs.end() )
inputs.erase(it); inputs.erase(it);
check(); check();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -102,7 +102,7 @@ void TriggerAND<Caller,InputType>::check() ...@@ -102,7 +102,7 @@ void TriggerAND<Caller,InputType>::check()
return; return;
} }
} }
out = true; out = true;
if( old != out ) if( old != out )
{ {
......
...@@ -116,6 +116,6 @@ class TriggerOR ...@@ -116,6 +116,6 @@ class TriggerOR
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include "TriggerOR_template.h" #include "TriggerOR.tcc"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
...@@ -43,10 +43,10 @@ bool TriggerOR<Caller,InputType>::commit(InputType num, bool state) ...@@ -43,10 +43,10 @@ bool TriggerOR<Caller,InputType>::commit(InputType num, bool state)
if( it!=inputs.end() ) if( it!=inputs.end() )
{ {
inputs[num] = state; inputs[num] = state;
check(); check();
return true; return true;
} }
return false; return false;
} }
...@@ -66,7 +66,7 @@ void TriggerOR<Caller,InputType>::remove(InputType num) ...@@ -66,7 +66,7 @@ void TriggerOR<Caller,InputType>::remove(InputType num)
if( it!=inputs.end() ) if( it!=inputs.end() )
inputs.erase(it); inputs.erase(it);
check(); check();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -102,7 +102,7 @@ void TriggerOR<Caller,InputType>::check() ...@@ -102,7 +102,7 @@ void TriggerOR<Caller,InputType>::check()
return; return;
} }
} }
out = false; out = false;
if( old != out ) if( old != out )
......
...@@ -122,6 +122,6 @@ class TriggerOutput ...@@ -122,6 +122,6 @@ class TriggerOutput
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include "TriggerOutput_template.h" #include "TriggerOutput.tcc"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#endif #endif
...@@ -42,7 +42,7 @@ TriggerOutput<Caller,OutIdType,ValueType>::~TriggerOutput() ...@@ -42,7 +42,7 @@ TriggerOutput<Caller,OutIdType,ValueType>::~TriggerOutput()
template <class Caller, typename OutIdType, typename ValueType> template <class Caller, typename OutIdType, typename ValueType>
void TriggerOutput<Caller,OutIdType,ValueType>::add(OutIdType num, ValueType val) void TriggerOutput<Caller,OutIdType,ValueType>::add(OutIdType num, ValueType val)
{ {
outs[num] = val; outs[num] = val;
set(num,val); set(num,val);
try try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment