22 #include <agrum/PRM/utils_prm.h> 28 void decomposePath(
const std::string& path, std::vector< std::string >& v) {
31 size_t idx_1 = path.find(
".");
32 size_t idx_2 = path.find(PRMObject::LEFT_CAST());
34 if (idx_2 == std::string::npos) {
38 while (idx != std::string::npos) {
40 v.push_back(path.substr(prev, length));
42 idx = path.find(
".", prev);
47 while (idx_1 != std::string::npos) {
49 length = idx_1 - prev;
50 v.push_back(path.substr(prev, length));
52 idx_1 = path.find(
".", prev);
53 }
else if (idx_2 < idx_1) {
54 tmp = path.find(PRMObject::RIGHT_CAST(), idx_2);
55 idx_1 = path.find(
".", tmp);
56 idx_2 = path.find(PRMObject::LEFT_CAST(), tmp);
61 v.push_back(path.substr(prev, std::string::npos));
INLINE void emplace(Args &&... args)
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
NodeId nextNodeId()
Returns the next value of an unique counter for PRM's node id.
void decomposePath(const std::string &path, std::vector< std::string > &v)
Decompose a string in a vector of strings using "." as separators.