VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
DtSimObjectReferenceList Class Reference

This is a convenience list that will add DtSimObjectReference objects and modify the list as objects are deleted. Note that if the sim object manager is not supplied, this will be a static list and will be up to the user to, when iterating over the list, determine if the object is valid or not. If the sim object manager is not supplied the addUUID method will throw an exception for an unimplemented method Lists that are assigned via the assignment operator will not keep track of the goings of objects in the list.

Note that the adding of a UUID to this list does not mean the DtSimObjectReference will be valid when looked it (it might not have been discovered yet), so, when iterating over the list and using the DtSimObjectReference, best to check with isValid()

Classes

struct  ObjectInformation
 

Public Types

typedef std::list
< DtSimObjectReference
SimObjectReferenceList
 
typedef std::list
< DtSimObjectReference >
::iterator 
iterator
 
typedef std::list
< DtSimObjectReference >
::const_iterator 
const_iterator
 
typedef std::list
< DtSimObjectReference >
::reverse_iterator 
reverse_iterator
 
typedef std::list
< DtSimObjectReference >
::const_reverse_iterator 
const_reverse_iterator
 

Public Member Functions

 DtSimObjectReferenceList (const DtSimulationServices *mgr=0)
 
 DtSimObjectReferenceList (const DtSimObjectReferenceList &orig)
 
virtual ~DtSimObjectReferenceList ()
 
void addUUID (const DtUUID &, int index=-1)
 
void add (DtSimObjectReference, int index=-1)
 
DtSimObjectReferenceListoperator= (const DtSimObjectReferenceList &orig)
 
bool removeUUID (const DtUUID &)
 
bool remove (DtSimObjectReference)
 
void clear ()
 
int size () const
 
virtual void disconnect ()
 
virtual void connect ()
 
virtual void copyWithoutConnect (const DtSimObjectReferenceList &)
 
DtSimObjectReference simObject (const DtUUID &) const
 
const SimObjectReferenceListsimObjectReferenceList () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
iterator insert (iterator, DtSimObjectReference)
 
void erase (iterator)
 

Public Attributes

boost::signals2::signal< void(const
DtUUID &)> 
signal_simObjectRemoved
 

Protected Types

typedef std::map< DtUUID,
ObjectInformation
QuickLookupMap
 

Protected Member Functions

void simObjectRemoved (const DtSimObject *)
 

Protected Attributes

QuickLookupMap myQuickLookupMap
 
const DtSimulationServicesmySimulationServices
 
bool myConnectedForRemoval
 
SimObjectReferenceList mySimObjectReferenceList
 
tbb::spin_rw_mutex myQuickLookupMapMutex
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtSimObjectReferenceList::DtSimObjectReferenceList ( const DtSimulationServices mgr = 0)
DtSimObjectReferenceList::DtSimObjectReferenceList ( const DtSimObjectReferenceList orig)
virtual DtSimObjectReferenceList::~DtSimObjectReferenceList ( )
virtual

Member Function Documentation

void DtSimObjectReferenceList::addUUID ( const DtUUID ,
int  index = -1 
)

Will keep track of the goings of this object in the list. This call is not thread safe, so, lock around this call if you think this is called in multiple threads.

void DtSimObjectReferenceList::add ( DtSimObjectReference  ,
int  index = -1 
)
DtSimObjectReferenceList& DtSimObjectReferenceList::operator= ( const DtSimObjectReferenceList orig)
bool DtSimObjectReferenceList::removeUUID ( const DtUUID )

The remove UUID will also remove a UUID from the list. If it is not found in the quick lookup map it will iterate over the list to find the item and remove it. This call is not thread safe, so, lock around this call if you think this is called in multiple threads.

bool DtSimObjectReferenceList::remove ( DtSimObjectReference  )
void DtSimObjectReferenceList::clear ( )
int DtSimObjectReferenceList::size ( ) const

Number of items in the list.

virtual void DtSimObjectReferenceList::disconnect ( )
virtual

Disconnect from current and furture removals. Call connect() to turn back on.

virtual void DtSimObjectReferenceList::connect ( )
virtual
virtual void DtSimObjectReferenceList::copyWithoutConnect ( const DtSimObjectReferenceList )
virtual

Copies the list and turns off connections.

DtSimObjectReference DtSimObjectReferenceList::simObject ( const DtUUID ) const
const SimObjectReferenceList& DtSimObjectReferenceList::simObjectReferenceList ( ) const

Accessors.

iterator DtSimObjectReferenceList::begin ( )
iterator DtSimObjectReferenceList::end ( )
const_iterator DtSimObjectReferenceList::begin ( ) const
const_iterator DtSimObjectReferenceList::end ( ) const
reverse_iterator DtSimObjectReferenceList::rbegin ( )
reverse_iterator DtSimObjectReferenceList::rend ( )
const_reverse_iterator DtSimObjectReferenceList::rbegin ( ) const
const_reverse_iterator DtSimObjectReferenceList::rend ( ) const
iterator DtSimObjectReferenceList::insert ( iterator  ,
DtSimObjectReference   
)
void DtSimObjectReferenceList::erase ( iterator  )
void DtSimObjectReferenceList::simObjectRemoved ( const DtSimObject )
protected

Member Data Documentation

boost::signals2::signal<void (const DtUUID&)> DtSimObjectReferenceList::signal_simObjectRemoved
mutable

Signal sent when an object is removed either by directly calling removeUUID or when the object is deleted.

QuickLookupMap DtSimObjectReferenceList::myQuickLookupMap
protected
const DtSimulationServices* DtSimObjectReferenceList::mySimulationServices
protected
bool DtSimObjectReferenceList::myConnectedForRemoval
protected
SimObjectReferenceList DtSimObjectReferenceList::mySimObjectReferenceList
protected
tbb::spin_rw_mutex DtSimObjectReferenceList::myQuickLookupMapMutex
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)