Commit 4b85c815 authored by Joseph Mirabel's avatar Joseph Mirabel

Use typedef where relevant.

parent cea473e0
......@@ -12,6 +12,7 @@
#include "sot/core/api.hh"
#include "sot/core/feature-abstract.hh"
#include <dynamic-graph/value.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
/* --------------------------------------------------------------------- */
......
......@@ -160,7 +160,7 @@ TaskAbstract &Sot::pop(void) {
return *res;
}
bool Sot::exist(const TaskAbstract &key) {
std::list<TaskAbstract *>::iterator it;
StackType::iterator it;
for (it = stack.begin(); stack.end() != it; ++it) {
if (*it == &key) {
return true;
......@@ -170,7 +170,7 @@ bool Sot::exist(const TaskAbstract &key) {
}
void Sot::remove(const TaskAbstract &key) {
bool find = false;
std::list<TaskAbstract *>::iterator it;
StackType::iterator it;
for (it = stack.begin(); stack.end() != it; ++it) {
if (*it == &key) {
find = true;
......@@ -193,7 +193,7 @@ void Sot::removeDependency(const TaskAbstract &key) {
void Sot::up(const TaskAbstract &key) {
bool find = false;
std::list<TaskAbstract *>::iterator it;
StackType::iterator it;
for (it = stack.begin(); stack.end() != it; ++it) {
if (*it == &key) {
find = true;
......@@ -207,7 +207,7 @@ void Sot::up(const TaskAbstract &key) {
return;
}
std::list<TaskAbstract *>::iterator pos = it;
StackType::iterator pos = it;
pos--;
TaskAbstract *task = *it;
stack.erase(it);
......@@ -216,7 +216,7 @@ void Sot::up(const TaskAbstract &key) {
}
void Sot::down(const TaskAbstract &key) {
bool find = false;
std::list<TaskAbstract *>::iterator it;
StackType::iterator it;
for (it = stack.begin(); stack.end() != it; ++it) {
if (*it == &key) {
find = true;
......@@ -230,7 +230,7 @@ void Sot::down(const TaskAbstract &key) {
return;
}
std::list<TaskAbstract *>::iterator pos = it;
StackType::iterator pos = it;
pos++;
TaskAbstract *task = *it;
stack.erase(it);
......@@ -244,7 +244,7 @@ void Sot::down(const TaskAbstract &key) {
}
void Sot::clear(void) {
for (std::list<TaskAbstract *>::iterator it = stack.begin();
for (StackType::iterator it = stack.begin();
stack.end() != it; ++it) {
removeDependency(**it);
}
......@@ -627,7 +627,7 @@ void Sot::display(std::ostream &os) const {
os << "+-----------------" << std::endl
<< "+ SOT " << std::endl
<< "+-----------------" << std::endl;
for (std::list<TaskAbstract *>::const_iterator it = this->stack.begin();
for (StackType::const_iterator it = this->stack.begin();
this->stack.end() != it; ++it) {
os << "| " << (*it)->getName() << std::endl;
}
......@@ -648,10 +648,10 @@ std::ostream &operator<<(std::ostream &os, const Sot &sot) {
/* --------------------------------------------------------------------- */
std::ostream &Sot::writeGraph(std::ostream &os) const {
std::list<TaskAbstract *>::const_iterator iter;
StackType::const_iterator iter;
for (iter = stack.begin(); iter != stack.end(); ++iter) {
const TaskAbstract &task = **iter;
std::list<TaskAbstract *>::const_iterator nextiter = iter;
StackType::const_iterator nextiter = iter;
nextiter++;
if (nextiter != stack.end()) {
......
......@@ -110,7 +110,7 @@ void TaskConti::display(std::ostream &os) const {
<< ": " << endl;
os << "--- LIST --- " << std::endl;
for (std::list<FeatureAbstract *>::const_iterator iter = featureList.begin();
for (FeatureList_t::const_iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
os << "-> " << (*iter)->getName() << endl;
}
......
......@@ -114,7 +114,7 @@ void Task::addFeatureFromName(const std::string &featureName) {
void Task::clearFeatureList(void) {
for (std::list<FeatureAbstract *>::iterator iter = featureList.begin();
for (FeatureList_t::iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
FeatureAbstract &s = **iter;
jacobianSOUT.removeDependency(s.jacobianSOUT);
......@@ -174,7 +174,7 @@ dynamicgraph::Vector &Task::computeError(dynamicgraph::Vector &error,
int cursorError = 0;
/* For each cell of the list, recopy value of s, s_star and error. */
for (std::list<FeatureAbstract *>::iterator iter = featureList.begin();
for (FeatureList_t::iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
FeatureAbstract &feature = **iter;
......@@ -211,7 +211,7 @@ Task::computeErrorTimeDerivative(dynamicgraph::Vector &res, int time) {
res.resize(errorSOUT(time).size());
dynamicgraph::Vector::Index cursor = 0;
for (std::list<FeatureAbstract *>::iterator iter = featureList.begin();
for (FeatureList_t::iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
FeatureAbstract &feature = **iter;
......@@ -263,7 +263,7 @@ dynamicgraph::Matrix &Task::computeJacobian(dynamicgraph::Matrix &J, int time) {
// const Flags& selection = controlSelectionSIN(time);
/* For each cell of the list, recopy value of s, s_star and error. */
for (std::list<FeatureAbstract *>::iterator iter = featureList.begin();
for (FeatureList_t::iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
FeatureAbstract &feature = **iter;
sotDEBUG(25) << "Feature <" << feature.getName() << ">" << endl;
......@@ -315,14 +315,14 @@ void Task::display(std::ostream &os) const {
os << "Task " << name << ": " << endl;
os << "--- LIST --- " << std::endl;
for (std::list<FeatureAbstract *>::const_iterator iter = featureList.begin();
for (FeatureList_t::const_iterator iter = featureList.begin();
iter != featureList.end(); ++iter) {
os << "-> " << (*iter)->getName() << endl;
}
}
std::ostream &Task::writeGraph(std::ostream &os) const {
std::list<FeatureAbstract *>::const_iterator itFeatureAbstract;
FeatureList_t::const_iterator itFeatureAbstract;
itFeatureAbstract = featureList.begin();
while (itFeatureAbstract != featureList.end()) {
os << "\t\"" << (*itFeatureAbstract)->getName() << "\" -> \"" << getName()
......
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