41 const std::vector<std::string> &contexts,
43 : m_objects (objects),
44 m_contexts (contexts),
92 for (uint32_t i = 0; i <
m_objects.size (); ++i)
96 object->TraceConnect (name, ctx, cb);
112 for (uint32_t i = 0; i <
m_objects.size (); ++i)
116 object->TraceDisconnect (name, ctx, cb);
135 bool Matches (uint32_t i)
const;
143 : m_element (element)
154 std::string::size_type tmp;
156 if (tmp != std::string::npos)
158 std::string left =
m_element.substr (0, tmp-0);
175 std::string::size_type leftBracket =
m_element.find (
"[");
176 std::string::size_type rightBracket =
m_element.find (
"]");
177 std::string::size_type dash =
m_element.find (
"-");
178 if (leftBracket == 0 && rightBracket ==
m_element.size () - 1 &&
179 dash > leftBracket && dash < rightBracket)
181 std::string lowerBound =
m_element.substr (leftBracket + 1, dash - (leftBracket + 1));
182 std::string upperBound =
m_element.substr (dash + 1, rightBracket - (dash + 1));
187 i >= min && i <= max)
212 std::istringstream iss;
215 return !iss.bad () && !iss.fail ();
249 std::string::size_type tmp =
m_path.find (
"/");
255 tmp =
m_path.find_last_of (
"/");
256 if (tmp != (
m_path.size () - 1))
272 std::string fullPath =
"/";
275 fullPath += *i +
"/";
292 std::string::size_type next = path.find (
"/", 1);
294 if (next == std::string::npos)
310 std::string item = path.substr (1, next-1);
311 std::string pathLeft = path.substr (next, path.size ()-next);
322 std::string::size_type offset = path.find (
"/Names");
338 Ptr<Object> namedObject = Names::Find<Object> (root, item);
341 NS_LOG_DEBUG (
"Name system resolved item = " << item <<
" to " << namedObject);
359 std::string::size_type dollarPos = item.find (
"$");
363 std::string tidString = item.substr (1, item.size () - 1);
379 TypeId tid = root->GetInstanceTypeId ();
380 bool foundMatch =
false;
385 if (info.name != item && item !=
"*")
395 root->GetAttribute (info.name, ptr);
412 if (vectorChecker != 0)
417 root->GetAttribute (info.name, vector);
439 std::string::size_type next = path.find (
"/", 1);
440 if (next == std::string::npos)
444 std::string item = path.substr (1, next-1);
445 std::string pathLeft = path.substr (next, path.size ()-next);
449 for (it = container.
Begin (); it != container.
End (); ++it)
451 if (matcher.
Matches ((*it).first))
453 std::ostringstream oss;
480 void ParsePath (std::string path, std::string *root, std::string *leaf)
const;
481 typedef std::vector<Ptr<Object> >
Roots;
488 std::string::size_type slash = path.find_last_of (
"/");
490 *root = path.substr (0, slash);
491 *leaf = path.substr (slash+1, path.size ()-(slash+1));
498 std::string root, leaf;
501 container.
Set (leaf, value);
506 std::string root, leaf;
514 std::string root, leaf;
522 std::string root, leaf;
530 std::string root, leaf;
540 class LookupMatchesResolver :
public Resolver
543 LookupMatchesResolver (std::string path)
546 virtual void DoOne (
Ptr<Object> object, std::string path) {
547 m_objects.push_back (
object);
548 m_contexts.push_back (path);
550 std::vector<Ptr<Object> > m_objects;
551 std::vector<std::string> m_contexts;
552 } resolver = LookupMatchesResolver (path);
553 for (Roots::const_iterator i =
m_roots.begin (); i !=
m_roots.end (); i++)
555 resolver.Resolve (*i);
563 resolver.Resolve (0);
615 (*i)->ResetInitialValue ();
632 std::string::size_type pos = fullName.rfind (
"::");
633 if (pos == std::string::npos)
637 std::string tidName = fullName.substr (0, pos);
638 std::string paramName = fullName.substr (pos+2, fullName.size () - (pos+2));
648 if (tmp.
name == paramName)