xoreos  0.0.5
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
Aurora::NWScript::ObjectContainer Class Reference

#include <objectcontainer.h>

Inheritance diagram for Aurora::NWScript::ObjectContainer:
Inheritance graph
[legend]
Collaboration diagram for Aurora::NWScript::ObjectContainer:
Collaboration graph
[legend]

Public Member Functions

 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (Object &object)
 Add an object to this container. More...
 
void removeObject (Object &object)
 Remove an object from this container. More...
 
ObjectgetObjectByID (uint32 id) const
 Find a specific object by ID. More...
 
ObjectgetFirstObject () const
 Return the first object. More...
 
ObjectgetFirstObjectByTag (const Common::UString &tag) const
 Return the first object with this tag. More...
 
ObjectSearchfindObjects () const
 Return a search context to iterate over all objects. More...
 
ObjectSearchfindObjectsByTag (const Common::UString &tag) const
 Return a search context to iterate over all objects with this tag. More...
 

Protected Member Functions

void lock ()
 
void unlock ()
 

Private Types

typedef std::map< uint32, Object * > ObjectIDMap
 
typedef SearchList::type ObjectList
 
typedef SearchTagMap::type ObjectTagMap
 

Private Attributes

Common::Mutex _mutex
 
ObjectList _objects
 
ObjectIDMap _objectsByID
 
ObjectTagMap _objectsByTag
 

Detailed Description

Definition at line 100 of file objectcontainer.h.

Member Typedef Documentation

◆ ObjectIDMap

Definition at line 132 of file objectcontainer.h.

◆ ObjectList

Definition at line 133 of file objectcontainer.h.

◆ ObjectTagMap

Definition at line 134 of file objectcontainer.h.

Constructor & Destructor Documentation

◆ ObjectContainer()

Aurora::NWScript::ObjectContainer::ObjectContainer ( )

Definition at line 37 of file objectcontainer.cpp.

◆ ~ObjectContainer()

Aurora::NWScript::ObjectContainer::~ObjectContainer ( )

Definition at line 40 of file objectcontainer.cpp.

Member Function Documentation

◆ addObject()

void Aurora::NWScript::ObjectContainer::addObject ( Object object)

◆ clearObjects()

void Aurora::NWScript::ObjectContainer::clearObjects ( )

◆ findObjects()

ObjectSearch * Aurora::NWScript::ObjectContainer::findObjects ( ) const

◆ findObjectsByTag()

ObjectSearch * Aurora::NWScript::ObjectContainer::findObjectsByTag ( const Common::UString tag) const

◆ getFirstObject()

Object * Aurora::NWScript::ObjectContainer::getFirstObject ( ) const

Return the first object.

Definition at line 86 of file objectcontainer.cpp.

References _objects, and Aurora::NWScript::SearchRange< T >::get().

Referenced by Engines::DragonAge::Area::getEntryLocation(), and Engines::DragonAge2::Area::getEntryLocation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFirstObjectByTag()

Object * Aurora::NWScript::ObjectContainer::getFirstObjectByTag ( const Common::UString tag) const

Return the first object with this tag.

Definition at line 92 of file objectcontainer.cpp.

References _objectsByTag, and Aurora::NWScript::SearchRange< T >::get().

Referenced by Engines::NWN2::Door::evaluateLink(), Engines::NWN::Door::evaluateLink(), Engines::DragonAge2::Area::getEntryLocation(), Engines::DragonAge::Area::getEntryLocation(), and Engines::NWN::Dialog::getSpeaker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObjectByID()

Object * Aurora::NWScript::ObjectContainer::getObjectByID ( uint32  id) const

Find a specific object by ID.

Definition at line 78 of file objectcontainer.cpp.

References _objectsByID.

◆ lock()

void Aurora::NWScript::ObjectContainer::lock ( )
protected

Definition at line 106 of file objectcontainer.cpp.

References _mutex, and Common::Mutex::lock().

Referenced by Engines::Sonic::ObjectContainer::addObject(), Engines::Jade::ObjectContainer::addObject(), Engines::KotOR2::ObjectContainer::addObject(), Engines::NWN::ObjectContainer::addObject(), Engines::KotOR::ObjectContainer::addObject(), Engines::NWN2::ObjectContainer::addObject(), Engines::Witcher::ObjectContainer::addObject(), Engines::DragonAge2::ObjectContainer::addObject(), Engines::DragonAge::ObjectContainer::addObject(), Engines::Sonic::ObjectContainer::clearObjects(), Engines::Jade::ObjectContainer::clearObjects(), Engines::KotOR2::ObjectContainer::clearObjects(), Engines::NWN::ObjectContainer::clearObjects(), Engines::NWN2::ObjectContainer::clearObjects(), Engines::Witcher::ObjectContainer::clearObjects(), Engines::KotOR::ObjectContainer::clearObjects(), Engines::DragonAge2::ObjectContainer::clearObjects(), Engines::DragonAge::ObjectContainer::clearObjects(), Engines::Sonic::ObjectContainer::removeObject(), Engines::Jade::ObjectContainer::removeObject(), Engines::KotOR2::ObjectContainer::removeObject(), Engines::NWN2::ObjectContainer::removeObject(), Engines::Witcher::ObjectContainer::removeObject(), Engines::NWN::ObjectContainer::removeObject(), Engines::KotOR::ObjectContainer::removeObject(), Engines::DragonAge2::ObjectContainer::removeObject(), and Engines::DragonAge::ObjectContainer::removeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeObject()

void Aurora::NWScript::ObjectContainer::removeObject ( Object object)

◆ unlock()

void Aurora::NWScript::ObjectContainer::unlock ( )
protected

Definition at line 110 of file objectcontainer.cpp.

References _mutex, and Common::Mutex::unlock().

Referenced by Engines::Sonic::ObjectContainer::addObject(), Engines::Jade::ObjectContainer::addObject(), Engines::KotOR2::ObjectContainer::addObject(), Engines::NWN::ObjectContainer::addObject(), Engines::KotOR::ObjectContainer::addObject(), Engines::NWN2::ObjectContainer::addObject(), Engines::Witcher::ObjectContainer::addObject(), Engines::DragonAge2::ObjectContainer::addObject(), Engines::DragonAge::ObjectContainer::addObject(), Engines::Sonic::ObjectContainer::clearObjects(), Engines::Jade::ObjectContainer::clearObjects(), Engines::KotOR2::ObjectContainer::clearObjects(), Engines::NWN::ObjectContainer::clearObjects(), Engines::NWN2::ObjectContainer::clearObjects(), Engines::Witcher::ObjectContainer::clearObjects(), Engines::KotOR::ObjectContainer::clearObjects(), Engines::DragonAge2::ObjectContainer::clearObjects(), Engines::DragonAge::ObjectContainer::clearObjects(), Engines::Sonic::ObjectContainer::removeObject(), Engines::Jade::ObjectContainer::removeObject(), Engines::KotOR2::ObjectContainer::removeObject(), Engines::NWN2::ObjectContainer::removeObject(), Engines::Witcher::ObjectContainer::removeObject(), Engines::NWN::ObjectContainer::removeObject(), Engines::KotOR::ObjectContainer::removeObject(), Engines::DragonAge2::ObjectContainer::removeObject(), and Engines::DragonAge::ObjectContainer::removeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _mutex

Common::Mutex Aurora::NWScript::ObjectContainer::_mutex
private

Definition at line 136 of file objectcontainer.h.

Referenced by addObject(), clearObjects(), lock(), removeObject(), and unlock().

◆ _objects

ObjectList Aurora::NWScript::ObjectContainer::_objects
private

Definition at line 138 of file objectcontainer.h.

Referenced by addObject(), clearObjects(), findObjects(), getFirstObject(), and removeObject().

◆ _objectsByID

ObjectIDMap Aurora::NWScript::ObjectContainer::_objectsByID
private

Definition at line 139 of file objectcontainer.h.

Referenced by addObject(), clearObjects(), getObjectByID(), and removeObject().

◆ _objectsByTag

ObjectTagMap Aurora::NWScript::ObjectContainer::_objectsByTag
private

The documentation for this class was generated from the following files: