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

Service which provides managed lists of simulation objects that are filtered based on a given predicate. These lists can be updated periodically as objects change and get added/removed from the scenario. Use getList() to retrieve a new managed list.

Public Member Functions

 DtManagedObjectListManager (const DtSimulationServices *services)
 
virtual ~DtManagedObjectListManager ()
 
virtual void init ()
 
DtManagedObjectListConstPtr getList (const DtVrfObjectPredicate &predicate=DtVrfObjectPredicate::nullPredicate(), bool reevaluateFlag=false, DtTime evaluationPeriod=0, const DtString &listName="")
 
DtManagedObjectListConstPtr nullList ()
 
virtual void printCurrentLists ()
 
virtual void tick (DtVrfCallbackQueue *=0)
 

Protected Types

typedef std::list
< DtBoost::weak_ptr
< DtManagedObjectList > > 
DtManagedObjectListStdList
 

Protected Member Functions

 DtManagedObjectListManager ()
 
void removeExpiredLists ()
 

Protected Attributes

const DtSimulationServicesmySimulationServices
 
tbb::spin_mutex myListsMutex
 
DtManagedObjectListStdList myLists
 
std::list< DtConsoleCommand * > myConsoleCommands
 

Member Typedef Documentation

typedef std::list<DtBoost::weak_ptr<DtManagedObjectList> > DtManagedObjectListManager::DtManagedObjectListStdList
protected

Constructor & Destructor Documentation

DtManagedObjectListManager::DtManagedObjectListManager ( )
protected

Default constructor; do not call.

DtManagedObjectListManager::DtManagedObjectListManager ( const DtSimulationServices services)

Constructor.

virtual DtManagedObjectListManager::~DtManagedObjectListManager ( )
virtual

Destructor.

Member Function Documentation

virtual void DtManagedObjectListManager::init ( )
virtual
DtManagedObjectListConstPtr DtManagedObjectListManager::getList ( const DtVrfObjectPredicate predicate = DtVrfObjectPredicate::nullPredicate(),
bool  reevaluateFlag = false,
DtTime  evaluationPeriod = 0,
const DtString listName = "" 
)

Returns a list based on the given predicate which gets evaluated at the given evaluationPeriod. Lists are returned inside shared pointers. The manager will hand out pointers to the same list to multiple requesters of the same list. The list will be deleted when all shared pointers go out of scope. This function can be called from thread safe components.

DtManagedObjectListConstPtr DtManagedObjectListManager::nullList ( )

Return an empty list.

virtual void DtManagedObjectListManager::printCurrentLists ( )
virtual

Prints the string reps for the predicates of the current lists to DtInfo.

virtual void DtManagedObjectListManager::tick ( DtVrfCallbackQueue = 0)
virtual

Ticks lists that are re-evaluated. If queue is given runs in parallel.

void DtManagedObjectListManager::removeExpiredLists ( )
protected

Removes any expired elements from myLists. These are elements that no longer have any references outside this class, and have been deleted by shared_ptr.

Member Data Documentation

const DtSimulationServices* DtManagedObjectListManager::mySimulationServices
protected
tbb::spin_mutex DtManagedObjectListManager::myListsMutex
mutableprotected
DtManagedObjectListStdList DtManagedObjectListManager::myLists
protected
std::list<DtConsoleCommand*> DtManagedObjectListManager::myConsoleCommands
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)