src/mobility/hierarchical-mobility-model.cc
changeset 2542 a9b88fdc09d6
parent 2458 e8f7c4960576
child 2543 401bfe8c0176
equal deleted inserted replaced
2541:91020a8d4264 2542:a9b88fdc09d6
    54   if (notifier == 0)
    54   if (notifier == 0)
    55     {
    55     {
    56       notifier = CreateObject<MobilityModelNotifier> ();
    56       notifier = CreateObject<MobilityModelNotifier> ();
    57       m_child->AggregateObject (notifier);
    57       m_child->AggregateObject (notifier);
    58     }
    58     }
    59   notifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
    59   notifier->TraceSourceConnect ("CourseChanged", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
    60 }
    60 }
    61 
    61 
    62 void 
    62 void 
    63 HierarchicalMobilityModel::SetParent (Ptr<MobilityModel> model)
    63 HierarchicalMobilityModel::SetParent (Ptr<MobilityModel> model)
    64 {
    64 {
    68   if (notifier == 0)
    68   if (notifier == 0)
    69     {
    69     {
    70       notifier = CreateObject<MobilityModelNotifier> ();
    70       notifier = CreateObject<MobilityModelNotifier> ();
    71       m_parent->AggregateObject (notifier);
    71       m_parent->AggregateObject (notifier);
    72     }
    72     }
    73   notifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
    73   notifier->TraceSourceConnect ("CourseChanged", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
    74 }
    74 }
    75 
    75 
    76 
    76 
    77 Ptr<MobilityModel> 
    77 Ptr<MobilityModel> 
    78 HierarchicalMobilityModel::GetChild (void) const
    78 HierarchicalMobilityModel::GetChild (void) const
   116                parentSpeed.z + childSpeed.z);
   116                parentSpeed.z + childSpeed.z);
   117   return speed;
   117   return speed;
   118 }
   118 }
   119 
   119 
   120 void 
   120 void 
   121 HierarchicalMobilityModel::ParentChanged (const TraceContext &context, Ptr<const MobilityModel> model)
   121 HierarchicalMobilityModel::ParentChanged (Ptr<const MobilityModel> model)
   122 {
   122 {
   123   MobilityModel::NotifyCourseChange ();
   123   MobilityModel::NotifyCourseChange ();
   124 }
   124 }
   125 
   125 
   126 void 
   126 void 
   127 HierarchicalMobilityModel::ChildChanged (const TraceContext &context, Ptr<const MobilityModel> model)
   127 HierarchicalMobilityModel::ChildChanged (Ptr<const MobilityModel> model)
   128 {
   128 {
   129   MobilityModel::NotifyCourseChange ();
   129   MobilityModel::NotifyCourseChange ();
   130 }
   130 }
   131 
   131 
   132 
   132