Commit 41e11cc3 authored by Francois Bleibel's avatar Francois Bleibel
Browse files

Corrected typo 'dependant' -> 'dependent'

parent db50d150
......@@ -51,7 +51,7 @@ from one feature to another. There are three main types of signals,
all deriving from the common class dynamicgraph::SignalBase :
\li dynamicgraph::Signal
\li dynamicgraph::SignalPtr
\li dynamicgraph::SignalTimeDependant
\li dynamicgraph::SignalTimeDependent
Signals can be grouped together using dynamicgraph::SignalArray.
......
......@@ -22,7 +22,7 @@ signal.h
signal-array.h
signal-base.h
signal-ptr.h
signal-time-dependant.h
signal-time-dependent.h
signal-ptr.t.cpp
signal.t.cpp
time-dependency.h
......
......@@ -12,6 +12,6 @@
#include <dynamic-graph/signal.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependant.h>
#include <dynamic-graph/signal-time-dependent.h>
#endif /* ALLSIGNALS_H_ */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright Projet JRL-Japan, 2007
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: signal-time-dependant.h
* Project: DYNAMIC-GRAPH
* Author: Nicolas Mansard
*
* Version control
* ===============
*
* $Id$
*
* Description
* ============
*
*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#ifndef __DEPENDANT_SIGNAL_HH
#define __DEPENDANT_SIGNAL_HH
#include <dynamic-graph/signal.h>
#include <dynamic-graph/time-dependency.h>
namespace dynamicgraph {
template< class T,class Time >
class SignalTimeDependant
: public virtual Signal<T,Time>
, public TimeDependancy<Time>
{
//TimeDependancy<Time> timeDependancy;
public:
SignalTimeDependant( std::string name = "" );
SignalTimeDependant( const SignalArray_const<Time> & arr
,std::string name = "" );
SignalTimeDependant( boost::function2<T&,T&,Time> t
,const SignalArray_const<Time> & sig
,std::string name = "" );
virtual ~SignalTimeDependant( void ) {}
inline const T& operator() ( const Time& t1 ){ return access(t1); }
const T& access( const Time& t1 );
virtual void addDependancy( const SignalBase<Time>& signal ) ;
virtual void removeDependancy( const SignalBase<Time>& signal ) ;
virtual void clearDependancies( void );
std::ostream& writeGraph(std::ostream &os) const
{ return os;}
std::ostream& displayDependancies( std::ostream& os,const int depth=-1,
std::string space="",
std::string next1="",std::string next2="" ) const
{ return TimeDependancy<Time>::displayDependancies( os,depth,space,next1,next2 ); }
virtual bool needUpdate( const Time& t ) const;
virtual void setPeriodTime( const Time& p ) ;
virtual Time getPeriodTime( void ) const;
};
/* -------------------------------------------- */
template < class T,class Time >
SignalTimeDependant<T,Time>::
SignalTimeDependant( std::string name )
:Signal<T,Time>(name)
,TimeDependancy<Time>(this)
{}
template< class T,class Time>
SignalTimeDependant<T,Time>::
SignalTimeDependant( const SignalArray_const<Time> & arr
,std::string name )
:Signal<T,Time>(name)
,TimeDependancy<Time>(this,arr)
{}
template< class T,class Time>
SignalTimeDependant<T,Time>::
SignalTimeDependant( boost::function2<T&,T&,Time> t
,const SignalArray_const<Time> & sig
,std::string name )
:Signal<T,Time>(name)
,TimeDependancy<Time>(this,sig)
{ setFunction(t); }
template< class T,class Time>
const T& SignalTimeDependant<T,Time>::
access( const Time& t1 )
{
const bool up = TimeDependancy<Time>::needUpdate(t1);
//SignalBase<Time>::setReady(false);
/* std::cout << "Time before: "<< signalTime << " -- " */
/* << t1<< " -> Up: "<<up <<std::endl ; */
if( up )
{
TimeDependancy<Time>::lastAskForUpdate = false;
const T& Tres = Signal<T,Time>::access(t1);
SignalBase<Time>::setReady(false);
return Tres;
}
else { return Signal<T,Time>::accessCopy(); }
}
template< class T,class Time>
void SignalTimeDependant<T,Time>::
addDependancy( const SignalBase<Time>& signal )
{ TimeDependancy<Time>::addDependancy(signal); }
template< class T,class Time>
void SignalTimeDependant<T,Time>::
removeDependancy( const SignalBase<Time>& signal )
{ TimeDependancy<Time>::removeDependancy(signal); }
template< class T,class Time>
void SignalTimeDependant<T,Time>::
clearDependancies( void )
{ TimeDependancy<Time>::clearDependancy(); }
template< class T,class Time>
bool SignalTimeDependant<T,Time>::
needUpdate( const Time& t ) const
{
return TimeDependancy<Time>::needUpdate(t);
}
template< class T,class Time>
void SignalTimeDependant<T,Time>::
setPeriodTime( const Time& p )
{ TimeDependancy<Time>::setPeriodTime( p ); }
template< class T,class Time>
Time SignalTimeDependant<T,Time>::
getPeriodTime( void ) const
{ return TimeDependancy<Time>::getPeriodTime(); }
} // namespace dynamicgraph
#endif /* #ifndef __DEPENDANT_SIGNAL_HH */
......@@ -2,7 +2,7 @@
* Copyright Projet JRL-Japan, 2007
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: TimeDependancy.h
* File: TimeDependency.h
* Project: DYNAMIC-GRAPH
* Author: Nicolas Mansard
*
......@@ -33,7 +33,7 @@ namespace dynamicgraph {
template< class Time >
class TimeDependancy
class TimeDependency
{
public:
enum DependancyType
......@@ -64,12 +64,12 @@ class TimeDependancy
public:
TimeDependancy( SignalBase<Time>* sig,
TimeDependency( SignalBase<Time>* sig,
const DependancyType dep = DEPENDANCY_TYPE_DEFAULT );
TimeDependancy( SignalBase<Time>* sig,
TimeDependency( SignalBase<Time>* sig,
const SignalArray_const<Time>& arr,
const DependancyType dep = DEPENDANCY_TYPE_DEFAULT );
~TimeDependancy( void ) {}
~TimeDependency( void ) {}
void addDependancy( const SignalBase<Time>& sig );
void removeDependancy( const SignalBase<Time>& sig );
......
......@@ -2,7 +2,7 @@
* Copyright Projet JRL-Japan, 2007
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* File: TimeDependancy.t.cpp
* File: TimeDependency.t.cpp
* Project: DYNAMIC-GRAPH
* Author: Nicolas Mansard
*
......@@ -40,15 +40,15 @@ namespace dynamicgraph {
template< class Time >
TimeDependancy<Time>::
TimeDependancy( SignalBase<Time> *sig
TimeDependency<Time>::
TimeDependency( SignalBase<Time> *sig
,const DependancyType dep )
:__TIME_DEPENDANCY_INIT(sig,dep)
{}
template< class Time >
TimeDependancy<Time>::
TimeDependancy( SignalBase<Time> * sig
TimeDependency<Time>::
TimeDependency( SignalBase<Time> * sig
,const SignalArray_const<Time>& ar
,const DependancyType dep )
:__TIME_DEPENDANCY_INIT(sig,dep)
......@@ -61,27 +61,27 @@ TimeDependancy( SignalBase<Time> * sig
/* -------------------------------------------------------------------------- */
template< class Time >
void TimeDependancy<Time>::
void TimeDependency<Time>::
addDependancy( const SignalBase<Time>& sig )
{
dependancies.push_front(&sig);
}
template< class Time >
void TimeDependancy<Time>::
void TimeDependency<Time>::
removeDependancy( const SignalBase<Time>& sig )
{
dependancies.remove(&sig);
}
template< class Time >
void TimeDependancy<Time>::
void TimeDependency<Time>::
clearDependancy( void )
{
dependancies.clear();
}
template< class Time >
bool TimeDependancy<Time>::
bool TimeDependency<Time>::
needUpdate( const Time& t1 ) const
{
dgTDEBUG(15) << "# In {" << leader.getName() << " : ("<< leader.getReady()<<") "
......@@ -122,7 +122,7 @@ needUpdate( const Time& t1 ) const
template< class Time >
std::ostream& TimeDependancy<Time>::
std::ostream& TimeDependency<Time>::
writeGraph( std::ostream & os) const
{
std::string LeaderLocalName;
......@@ -143,7 +143,7 @@ writeGraph( std::ostream & os) const
}
template< class Time >
std::ostream& TimeDependancy<Time>::
std::ostream& TimeDependency<Time>::
displayDependancies( std::ostream& os,const int depth,
std::string space,
std::string next1,std::string next2 ) const
......
......@@ -23,8 +23,8 @@
/* -------------------------------------------------------------------------- */
// #include <dynamic-graph/all-signals.h>
#include <dynamic-graph/signal.h>
#include <dynamic-graph/signal-time-dependant.h>
//#include <sot/TimeDependancy.h>
#include <dynamic-graph/signal-time-dependent.h>
//#include <sot/TimeDependency.h>
#include <dynamic-graph/debug.h>
#include <iostream>
#include <string>
......@@ -40,8 +40,8 @@ class DummyClass
public:
std::string proname;
list< SignalTimeDependant<double,int>* > inputsig;
list< SignalTimeDependant<string,int>* > inputsigV;
list< SignalTimeDependent<double,int>* > inputsig;
list< SignalTimeDependent<string,int>* > inputsigV;
public:
DummyClass( const std::string& n ) : proname(n),res(),appel(0),timedata(0) {}
......@@ -52,22 +52,22 @@ public:
cout << "Inside " << proname << " -> " << this
<< endl;
for( list< SignalTimeDependant<double,int>* >::iterator it=inputsig.begin();
for( list< SignalTimeDependent<double,int>* >::iterator it=inputsig.begin();
it!=inputsig.end();++it )
{
cout << *(*it) << endl;
(*it)->access(timedata);
}
for( list< SignalTimeDependant<string,int>* >::iterator it=inputsigV.begin();
for( list< SignalTimeDependent<string,int>* >::iterator it=inputsigV.begin();
it!=inputsigV.end();++it )
{ cout << *(*it) << endl; (*it)->access(timedata);}
return res=(*this)();
}
void add( SignalTimeDependant<double,int>& sig )
void add( SignalTimeDependent<double,int>& sig )
{ inputsig.push_back(&sig); }
void add( SignalTimeDependant<string,int>& sig )
void add( SignalTimeDependent<string,int>& sig )
{ inputsigV.push_back(&sig); }
Res operator() ( void );
......@@ -101,13 +101,13 @@ int main( void )
DummyClass<double> pro1("pro1"),pro3("pro3"),pro5("pro5");
DummyClass<string> pro2("pro2"),pro4("pro4"),pro6("pro6");
SignalTimeDependant<double,int> sig5("Sig5");
SignalTimeDependant<string,int> sig6("Sig6");
SignalTimeDependent<double,int> sig5("Sig5");
SignalTimeDependent<string,int> sig6("Sig6");
SignalTimeDependant<string,int> sig4(sig5,"Sig4");
SignalTimeDependant<string,int> sig2(sig4<<sig4<<sig4<<sig6,"Sig2");
SignalTimeDependant<double,int> sig3(sig2<<sig5<<sig6,"Sig3");
SignalTimeDependant<double,int> sig1( boost::bind(&DummyClass<double>::fun,&pro1,_1,_2),
SignalTimeDependent<string,int> sig4(sig5,"Sig4");
SignalTimeDependent<string,int> sig2(sig4<<sig4<<sig4<<sig6,"Sig2");
SignalTimeDependent<double,int> sig3(sig2<<sig5<<sig6,"Sig3");
SignalTimeDependent<double,int> sig1( boost::bind(&DummyClass<double>::fun,&pro1,_1,_2),
sig2<<sig3,"Sig1");
// cout << "--- Test Array ------ "<<endl;
......@@ -133,8 +133,8 @@ int main( void )
pro3.add(sig5);
pro3.add(sig6);
sig5.setDependancyType(TimeDependancy<int>::ALWAYS_READY);
sig6.setDependancyType(TimeDependancy<int>::BOOL_DEPENDANT);
sig5.setDependancyType(TimeDependency<int>::ALWAYS_READY);
sig6.setDependancyType(TimeDependency<int>::BOOL_DEPENDANT);
sig6.setReady();
......
Supports Markdown
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