21 #include "ns3/pointer.h"
30 static TypeId tid =
TypeId (
"ns3::HierarchicalMobilityModel")
32 .SetGroupName (
"Mobility")
34 .AddAttribute (
"Child",
"The child mobility model.",
38 MakePointerChecker<MobilityModel> ())
39 .AddAttribute (
"Parent",
"The parent mobility model.",
43 MakePointerChecker<MobilityModel> ())
121 return Vector (parentPosition.x + childPosition.x,
122 parentPosition.y + childPosition.y,
123 parentPosition.z + childPosition.z);
137 Vector childPosition (position.x - parentPosition.x,
138 position.y - parentPosition.y,
139 position.z - parentPosition.z);
154 Vector speed (parentSpeed.x + childSpeed.x,
155 parentSpeed.y + childSpeed.y,
156 parentSpeed.z + childSpeed.z);
Hierarchical mobility model.
Ptr< MobilityModel > m_child
pointer to child mobility model
static TypeId GetTypeId(void)
Register this type with the TypeId system.
virtual void DoSetPosition(const Vector &position)
void ChildChanged(Ptr< const MobilityModel > model)
Callback for when child mobility model course change occurs.
Ptr< MobilityModel > m_parent
pointer to parent mobility model
void SetParent(Ptr< MobilityModel > model)
Sets the parent mobility model to a new one.
Ptr< MobilityModel > GetParent(void) const
HierarchicalMobilityModel()
void SetChild(Ptr< MobilityModel > model)
Sets the child mobility model to a new one.
virtual Vector DoGetPosition(void) const
virtual Vector DoGetVelocity(void) const
void ParentChanged(Ptr< const MobilityModel > model)
Callback for when parent mobility model course change occurs.
Ptr< MobilityModel > GetChild(void) const
Keep track of the current position and velocity of an object.
Vector GetVelocity(void) const
void NotifyCourseChange(void) const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
void SetPosition(const Vector &position)
Vector GetPosition(void) const
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected without a context.
Hold objects of type Ptr<T>.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...