42 const std::vector<std::string> &contexts,
44 : m_objects (objects),
45 m_contexts (contexts),
102 for (uint32_t i = 0; i <
m_objects.size (); ++i)
106 object->TraceConnect (name, ctx, cb);
125 for (uint32_t i = 0; i <
m_objects.size (); ++i)
129 object->TraceDisconnect (name, ctx, cb);
149 bool Matches (uint32_t i)
const;
157 : m_element (element)
170 std::string::size_type tmp;
172 if (tmp != std::string::npos)
174 std::string left =
m_element.substr (0, tmp-0);
191 std::string::size_type leftBracket =
m_element.find (
"[");
192 std::string::size_type rightBracket =
m_element.find (
"]");
193 std::string::size_type dash =
m_element.find (
"-");
194 if (leftBracket == 0 && rightBracket ==
m_element.size () - 1 &&
195 dash > leftBracket && dash < rightBracket)
197 std::string lowerBound =
m_element.substr (leftBracket + 1, dash - (leftBracket + 1));
198 std::string upperBound =
m_element.substr (dash + 1, rightBracket - (dash + 1));
203 i >= min && i <= max)
229 std::istringstream iss;
232 return !iss.bad () && !iss.fail ();
270 std::string::size_type tmp =
m_path.find (
"/");
276 tmp =
m_path.find_last_of (
"/");
277 if (tmp != (
m_path.size () - 1))
297 std::string fullPath =
"/";
300 fullPath += *i +
"/";
319 std::string::size_type next = path.find (
"/", 1);
321 if (next == std::string::npos)
337 std::string item = path.substr (1, next-1);
338 std::string pathLeft = path.substr (next, path.size ()-next);
349 std::string::size_type offset = path.find (
"/Names");
365 Ptr<Object> namedObject = Names::Find<Object> (root, item);
368 NS_LOG_DEBUG (
"Name system resolved item = " << item <<
" to " << namedObject);
386 std::string::size_type dollarPos = item.find (
"$");
390 std::string tidString = item.substr (1, item.size () - 1);
406 TypeId tid = root->GetInstanceTypeId ();
407 bool foundMatch =
false;
412 if (info.name != item && item !=
"*")
422 root->GetAttribute (info.name, ptr);
439 if (vectorChecker != 0)
444 root->GetAttribute (info.name, vector);
466 std::string::size_type next = path.find (
"/", 1);
467 if (next == std::string::npos)
471 std::string item = path.substr (1, next-1);
472 std::string pathLeft = path.substr (next, path.size ()-next);
476 for (it = container.
Begin (); it != container.
End (); ++it)
478 if (matcher.
Matches ((*it).first))
480 std::ostringstream oss;
507 void ParsePath (std::string path, std::string *root, std::string *leaf)
const;
508 typedef std::vector<Ptr<Object> >
Roots;
517 std::string::size_type slash = path.find_last_of (
"/");
519 *root = path.substr (0, slash);
520 *leaf = path.substr (slash+1, path.size ()-(slash+1));
529 std::string root, leaf;
532 container.
Set (leaf, value);
538 std::string root, leaf;
547 std::string root, leaf;
557 std::string root, leaf;
567 std::string root, leaf;
577 class LookupMatchesResolver :
public Resolver
580 LookupMatchesResolver (std::string path)
583 virtual void DoOne (
Ptr<Object> object, std::string path) {
584 m_objects.push_back (
object);
585 m_contexts.push_back (path);
587 std::vector<Ptr<Object> > m_objects;
588 std::vector<std::string> m_contexts;
589 } resolver = LookupMatchesResolver (path);
590 for (Roots::const_iterator i =
m_roots.begin (); i !=
m_roots.end (); i++)
592 resolver.Resolve (*i);
600 resolver.Resolve (0);
658 (*i)->ResetInitialValue ();
678 std::string::size_type pos = fullName.rfind (
"::");
679 if (pos == std::string::npos)
683 std::string tidName = fullName.substr (0, pos);
684 std::string paramName = fullName.substr (pos+2, fullName.size () - (pos+2));
694 if (tmp.
name == paramName)