Update of /cvsroot/objecthandler/ObjectHandler/oh
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21526/oh
Modified Files:
object.hpp
Log Message:
add support for retrieving a vector of objects from a vector of objectIDs
Index: object.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** object.hpp 28 Jul 2006 12:21:24 -0000 1.15
--- object.hpp 5 Oct 2006 17:02:33 -0000 1.16
***************
*** 39,42 ****
--- 39,55 ----
ObjHandler::ObjectHandler::instance().retrieveObject(NAME, ID);
+ // convert a vector of strings to a vector of objects
+ template <class ObjectClass>
+ std::vector<boost::shared_ptr<ObjectClass> > getObjectVector(
+ std::vector<std::string> objectIDs) {
+ std::vector<boost::shared_ptr<ObjectClass> > ret;
+ for (std::vector<std::string>::const_iterator i = objectIDs.begin();
+ i != objectIDs.end(); i++) {
+ OH_GET_OBJECT(objectPointer, *i, ObjectClass);
+ ret.push_back(objectPointer);
+ }
+ return ret;
+ }
+
// get a boost shared pointer to the client library object referenced by an ObjHandler::Object
#define OH_GET_REFERENCE( NAME, ID, OBJECT_CLASS, LIBRARY_CLASS ) \
|