Commit 5f7dd3f2 authored by Joseph Mirabel's avatar Joseph Mirabel

Add convenience function TimeDependency::addDependencies

parent 384b2078
...@@ -43,6 +43,7 @@ public: ...@@ -43,6 +43,7 @@ public:
const DependencyType dep = DEPENDENCY_TYPE_DEFAULT); const DependencyType dep = DEPENDENCY_TYPE_DEFAULT);
virtual ~TimeDependency() {} virtual ~TimeDependency() {}
void addDependencies(const SignalArray_const<Time> &arr);
void addDependency(const SignalBase<Time> &sig); void addDependency(const SignalBase<Time> &sig);
void removeDependency(const SignalBase<Time> &sig); void removeDependency(const SignalBase<Time> &sig);
void clearDependency(); void clearDependency();
......
...@@ -26,14 +26,19 @@ TimeDependency<Time>::TimeDependency(SignalBase<Time> *sig, ...@@ -26,14 +26,19 @@ TimeDependency<Time>::TimeDependency(SignalBase<Time> *sig,
const SignalArray_const<Time> &ar, const SignalArray_const<Time> &ar,
const DependencyType dep) const DependencyType dep)
: __TIME_DEPENDENCY_INIT(sig, dep) { : __TIME_DEPENDENCY_INIT(sig, dep) {
for (unsigned int i = 0; i < ar.getSize(); ++i) { addDependencies(ar);
addDependency(ar[i]);
}
return; return;
} }
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
template <class Time>
void TimeDependency<Time>::addDependencies(const SignalArray_const<Time> &ar) {
for (unsigned int i = 0; i < ar.getSize(); ++i) {
addDependency(ar[i]);
}
}
template <class Time> template <class Time>
void TimeDependency<Time>::addDependency(const SignalBase<Time> &sig) { void TimeDependency<Time>::addDependency(const SignalBase<Time> &sig) {
dependencies.push_front(&sig); dependencies.push_front(&sig);
......
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