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);
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual Vector DoGetVelocity(void) const
HierarchicalMobilityModel()
Keep track of the current position and velocity of an object.
Ptr< MobilityModel > m_child
pointer to child mobility model
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Ptr< MobilityModel > m_parent
pointer to parent mobility model
bool TraceDisconnectWithoutContext(std::string name, const CallbackBase &cb)
Disconnect from a TraceSource a Callback previously connected without a context.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetChild(Ptr< MobilityModel > model)
Sets the child mobility model to a new one.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
void SetParent(Ptr< MobilityModel > model)
Sets the parent mobility model to a new one.
virtual void DoSetPosition(const Vector &position)
void SetPosition(const Vector &position)
void NotifyCourseChange(void) const
Must be invoked by subclasses when the course of the position changes to notify course change listene...
Vector GetPosition(void) const
Hierarchical mobility model.
Ptr< MobilityModel > GetChild(void) const
void ChildChanged(Ptr< const MobilityModel > model)
Callback for when child mobility model course change occurs.
virtual Vector DoGetPosition(void) const
Ptr< MobilityModel > GetParent(void) const
void ParentChanged(Ptr< const MobilityModel > model)
Callback for when parent mobility model course change occurs.
a unique identifier for an interface.
static TypeId GetTypeId(void)
Register this type with the TypeId system.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Vector GetVelocity(void) const