Skip to content
Snippets Groups Projects
Commit 05f765f3 authored by Mirko Wächter's avatar Mirko Wächter
Browse files

making const getter in trajectory memory allocation free

parent a90948ad
No related branches found
No related tags found
No related merge requests found
...@@ -276,7 +276,7 @@ namespace armarx ...@@ -276,7 +276,7 @@ namespace armarx
{ {
if (derivation == 0) if (derivation == 0)
{ {
return __calcBaseDataAtTimestamp(t).at(dim)->at(derivation); // interpolates and retrieves return __interpolate(t, dim, derivation);
} }
else else
{ {
...@@ -336,7 +336,7 @@ namespace armarx ...@@ -336,7 +336,7 @@ namespace armarx
return dimensionNames.at(dim); return dimensionNames.at(dim);
} }
Ice::StringSeq Trajectory::getDimensionNames() const const Ice::StringSeq& Trajectory::getDimensionNames() const
{ {
return dimensionNames; return dimensionNames;
} }
...@@ -821,7 +821,6 @@ namespace armarx ...@@ -821,7 +821,6 @@ namespace armarx
double newValue = __interpolate(t, dimension, 0); double newValue = __interpolate(t, dimension, 0);
checkValue(newValue); checkValue(newValue);
result.push_back(DoubleSeqPtr(new Ice::DoubleSeq(1, newValue))); result.push_back(DoubleSeqPtr(new Ice::DoubleSeq(1, newValue)));
} }
return result; return result;
...@@ -1210,7 +1209,7 @@ namespace armarx ...@@ -1210,7 +1209,7 @@ namespace armarx
{ {
if (derivation == 0) if (derivation == 0)
{ {
getState(t, trajDimension, derivation); return getState(t, trajDimension, derivation);
} }
typename timestamp_view::iterator it = dataMap.find(t); typename timestamp_view::iterator it = dataMap.find(t);
......
...@@ -162,7 +162,7 @@ namespace armarx ...@@ -162,7 +162,7 @@ namespace armarx
stream << rhs.timestamp << ": "; stream << rhs.timestamp << ": ";
for (size_t d = 0; d < rhs.data.size(); ++d) for (size_t d = 0; d < rhs.data.size(); ++d)
{ {
stream << (rhs.data[d]->size() > 0 ? to_string(rhs.data[d]->at(0)) : std::string("-")); stream << (rhs.data[d] && rhs.data[d]->size() > 0 ? to_string(rhs.data[d]->at(0)) : std::string("-"));
if (d <= rhs.data.size() - 1) if (d <= rhs.data.size() - 1)
{ {
stream << ", "; stream << ", ";
...@@ -296,7 +296,7 @@ namespace armarx ...@@ -296,7 +296,7 @@ namespace armarx
std::vector<Ice::DoubleSeq > getAllStates(double t, int maxDeriv = 1); std::vector<Ice::DoubleSeq > getAllStates(double t, int maxDeriv = 1);
Ice::DoubleSeq getDerivations(double t, size_t dimension, size_t derivations) const; Ice::DoubleSeq getDerivations(double t, size_t dimension, size_t derivations) const;
std::string getDimensionName(size_t dim) const; std::string getDimensionName(size_t dim) const;
Ice::StringSeq getDimensionNames() const; const Ice::StringSeq& getDimensionNames() const;
TrajDataContainer& data(); TrajDataContainer& data();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment