time-dependency.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 // Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
3 // JRL, CNRS/AIST.
4 //
5 
6 #ifndef DYNAMIC_GRAPH_TIME_DEPENDENCY_H
7 #define DYNAMIC_GRAPH_TIME_DEPENDENCY_H
10 
11 #include <dynamic-graph/fwd.hh>
12 #include <list>
13 
14 namespace dynamicgraph {
18 template <class Time>
19 class TimeDependency {
20  public:
22 
23  mutable Time lastAskForUpdate;
24 
25  public:
27 
28  typedef std::list<const SignalBase<Time> *> Dependencies;
30 
33  static const bool ALL_READY_DEFAULT = false;
34 
36 
37  Time periodTime;
38  static const Time PERIOD_TIME_DEFAULT = 1;
39 
40  public:
45  virtual ~TimeDependency() {}
46 
48  void addDependency(const SignalBase<Time> &sig);
50  void clearDependency();
51 
52  virtual std::ostream &writeGraph(std::ostream &os) const;
53  std::ostream &displayDependencies(std::ostream &os, const int depth = -1,
54  std::string space = "",
55  std::string next1 = "",
56  std::string next2 = "") const;
57 
58  bool needUpdate(const Time &t1) const;
59 
61 
62  void setNeedUpdateFromAllChildren(const bool b = true) {
64  }
66 
67  void setPeriodTime(const Time &p) { periodTime = p; }
68  Time getPeriodTime() const { return periodTime; }
69 };
70 
71 } // end of namespace dynamicgraph
72 
74 #endif
signal-array.h
dynamicgraph::TimeDependency::setPeriodTime
void setPeriodTime(const Time &p)
Definition: time-dependency.h:67
dynamicgraph::TimeDependency::~TimeDependency
virtual ~TimeDependency()
Definition: time-dependency.h:45
dynamicgraph::TimeDependency::PERIOD_TIME_DEFAULT
static const Time PERIOD_TIME_DEFAULT
Definition: time-dependency.h:38
dynamicgraph::TimeDependency::writeGraph
virtual std::ostream & writeGraph(std::ostream &os) const
Definition: time-dependency.t.cpp:116
dynamicgraph::TimeDependency::needUpdate
bool needUpdate(const Time &t1) const
Definition: time-dependency.t.cpp:58
dynamicgraph::TimeDependency::clearDependency
void clearDependency()
Definition: time-dependency.t.cpp:53
dynamicgraph::TimeDependency::getPeriodTime
Time getPeriodTime() const
Definition: time-dependency.h:68
time-dependency.t.cpp
dynamicgraph
dynamicgraph::TimeDependency::displayDependencies
std::ostream & displayDependencies(std::ostream &os, const int depth=-1, std::string space="", std::string next1="", std::string next2="") const
Definition: time-dependency.t.cpp:121
dynamicgraph::TimeDependency::setDependencyType
void setDependencyType(DependencyType dep)
Definition: time-dependency.h:60
dynamicgraph::SignalArray_const
TODO.
Definition: fwd.hh:50
dynamicgraph::TimeDependency::setNeedUpdateFromAllChildren
void setNeedUpdateFromAllChildren(const bool b=true)
Definition: time-dependency.h:62
dynamicgraph::TimeDependency::getNeedUpdateFromAllChildren
bool getNeedUpdateFromAllChildren() const
Definition: time-dependency.h:65
fwd.hh
dynamicgraph::TimeDependency::lastAskForUpdate
Time lastAskForUpdate
Definition: time-dependency.h:23
dynamicgraph::TimeDependency::leader
SignalBase< Time > & leader
Definition: time-dependency.h:26
signal-base.h
dynamicgraph::TimeDependency::BOOL_DEPENDENT
@ BOOL_DEPENDENT
Definition: time-dependency.h:21
dynamicgraph::TimeDependency::dependencyType
DependencyType dependencyType
Definition: time-dependency.h:35
dynamicgraph::TimeDependency::TimeDependency
TimeDependency(SignalBase< Time > *sig, const DependencyType dep=DEPENDENCY_TYPE_DEFAULT)
Definition: time-dependency.t.cpp:20
dynamicgraph::TimeDependency::ALWAYS_READY
@ ALWAYS_READY
Definition: time-dependency.h:21
dynamicgraph::TimeDependency::DependencyType
DependencyType
Definition: time-dependency.h:21
dynamicgraph::TimeDependency::removeDependency
void removeDependency(const SignalBase< Time > &sig)
Definition: time-dependency.t.cpp:48
dynamicgraph::TimeDependency::periodTime
Time periodTime
Definition: time-dependency.h:37
sig
dynamicgraph::SignalArray_const< double > sig
Definition: signal-all.cpp:25
dynamicgraph::TimeDependency::addDependencies
void addDependencies(const SignalArray_const< Time > &arr)
Definition: time-dependency.t.cpp:36
dynamicgraph::TimeDependency::ALL_READY_DEFAULT
static const bool ALL_READY_DEFAULT
Definition: time-dependency.h:33
dynamicgraph::TimeDependency::Dependencies
std::list< const SignalBase< Time > * > Dependencies
Definition: time-dependency.h:28
dynamicgraph::TimeDependency::updateFromAllChildren
bool updateFromAllChildren
Definition: time-dependency.h:32
dynamicgraph::TimeDependency::addDependency
void addDependency(const SignalBase< Time > &sig)
Definition: time-dependency.t.cpp:43
dynamicgraph::TimeDependency::TIME_DEPENDENT
@ TIME_DEPENDENT
Definition: time-dependency.h:21
dynamicgraph::SignalBase
The base class for signals: not to be used as such.
Definition: fwd.hh:53
dynamicgraph::TimeDependency::DEPENDENCY_TYPE_DEFAULT
static const DependencyType DEPENDENCY_TYPE_DEFAULT
Definition: time-dependency.h:29
dynamicgraph::TimeDependency::dependencies
Dependencies dependencies
Definition: time-dependency.h:31


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38