7 #ifndef __FWDATACAMP_VISITOR_GETOBJECT_HPP__ 8 #define __FWDATACAMP_VISITOR_GETOBJECT_HPP__ 10 #include <boost/algorithm/string/split.hpp> 11 #include <boost/algorithm/string/classification.hpp> 13 #include <fwCamp/camp/ExtendedClassVisitor.hpp> 15 #include "fwDataCamp/config.hpp" 31 typedef std::shared_ptr<PathVisitor> sptr;
32 typedef std::vector<std::string> ObjectsNamesType;
42 ::boost::split( m_vectObj, path, ::boost::is_any_of(
"."));
48 void merge(PathVisitor::sptr pathVisitor)
50 const ObjectsNamesType& vectObjFound = pathVisitor->m_vectObjFound;
51 m_vectObjFound.reserve(m_vectObjFound.size() + vectObjFound.size());
52 m_vectObjFound.insert(m_vectObjFound.end(), vectObjFound.begin(), vectObjFound.end());
58 m_vectObjFound.push_back(objPath);
64 return m_vectObj == m_vectObjFound;
70 ObjectsNamesType m_vectObj;
73 ObjectsNamesType m_vectObjFound;
91 FWDATACAMP_API
GetObject( ::fwData::Object::csptr
object,
const std::string& subObjPath );
93 FWDATACAMP_API
virtual ~GetObject();
98 FWDATACAMP_API
void visit(
const camp::SimpleProperty& property);
99 FWDATACAMP_API
void visit(
const camp::EnumProperty& property);
100 FWDATACAMP_API
void visit(
const camp::UserProperty& property);
101 FWDATACAMP_API
void visit(
const camp::ArrayProperty& property);
102 FWDATACAMP_API
void visit(
const camp::Function&
function);
106 FWDATACAMP_API ::fwData::Object::sptr
get();
112 FWDATACAMP_API
bool objectsFound()
const;
119 return m_pathVisitor;
128 std::string getNextPropertyName();
131 ::fwData::Object::csptr m_object;
134 const std::string m_subObjPath;
137 std::string m_newSubObjPath;
140 std::string m_propertyName;
143 ::camp::UserObject m_campObj;
146 ::fwData::Object::sptr m_subObject;
159 #endif // __FWDATACAMP_VISITOR_GETOBJECT_HPP__ void merge(PathVisitor::sptr pathVisitor)
Appends the path elements of the given path visitor.
PathVisitor::sptr getPathVisitor() const
Returns pointer to associated path visitor.
bool allObjectsFound() const
Returns true if all path elements were found during an introspection process.
PathVisitor(const std::string &path)
Constructor.
void addObject(const std::string &objPath)
Appends a path element.
Check if object introspection process mathes a given path.
This namespace contains data object descriptions used for introspection.
PathVisitor::sptr m_pathVisitor
Path visitor.
This class is an helper to introspect a data and find an object (contained into this data) from a nor...