The base for all class that can have (and can be) an owner. More...
Classes | |
struct | Owned |
The structure with information about the owned object. More... | |
Public Types | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
Public Member Functions | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
Detailed Description
The base for all class that can have (and can be) an owner.
When an object has an owner, the owner is responsible of freeing the owned classes when it is deleted. This can be done automatically by this class destructor or can be left to the owner implementation (for example when there must be a precise order in destroying owned objects). This class models both owner and ownable classes
Member Typedef Documentation
Constructor & Destructor Documentation
Ownable | ( | ) |
Constructor.
Definition at line 24 of file ownable.cpp.
|
virtual |
Destructor.
This deletes all owned object marked to be automatically destroyed
Definition at line 30 of file ownable.cpp.
References Ownable::Owned::destroy, and Ownable::Owned::object.
Member Function Documentation
|
inline |
|
inline |
Returns the owner of this object.
- Returns
- the owner of this object
Definition at line 115 of file ownable.h.
Referenced by RenderCamera::paintGL(), Ownable::setOwner(), RenderWObjectContainer::setupColorTexture(), and World::~World().
void setOwner | ( | Ownable * | owner, |
bool | destroy = true |
||
) |
Sets the owner of this object.
- Parameters
-
owner the owner of this object destroy if true this object is automatically destroyed by the owner destructor
Definition at line 47 of file ownable.cpp.
References Ownable::owner().
Referenced by GraphicalWObject::attachToObject(), PhyMarXbot::enableAttachmentDevice(), PhyEpuck::PhyEpuck(), PhyiCub::PhyiCub(), PhyKhepera::PhyKhepera(), and PhyMarXbot::PhyMarXbot().
The documentation for this class was generated from the following files:
- worldsim/include/ownable.h
- worldsim/src/ownable.cpp