diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2009-11-27 18:29:07 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-27 19:21:35 -0300 |
commit | 1dffc65e80f7ed87d51322de10492c7aec7106ca (patch) | |
tree | cdaa8a5d97d60881e1005381924ca8926ee9fb1c /tests/libsample/blackbox.cpp | |
parent | 5d2e5cd85ec6950f5bb848fe08e66cd8520cf29d (diff) |
Fix objects/points methods to return a list + fix example using them.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/libsample/blackbox.cpp')
-rw-r--r-- | tests/libsample/blackbox.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/libsample/blackbox.cpp b/tests/libsample/blackbox.cpp index 4cad76ad7..f917d7868 100644 --- a/tests/libsample/blackbox.cpp +++ b/tests/libsample/blackbox.cpp @@ -107,3 +107,28 @@ BlackBox::disposePoint(int ticket) delete point; } + +std::list<ObjectType*> +BlackBox::objects() +{ + std::list<ObjectType*> l; + map<int, ObjectType*>::iterator it; + + for ( it = m_objects.begin() ; it != m_objects.end(); it++ ) + l.push_back((*it).second); + + return l; +} + +std::list<Point*> +BlackBox::points() +{ + std::list<Point*> l; + map<int, Point*>::iterator it; + + for ( it = m_points.begin() ; it != m_points.end(); it++ ) + l.push_back((*it).second); + + return l; +} + |