![]() |
MAK Legion API Documentation
|
The SetView is a concrete view class that provides a view of the database for instances of a given type. More...
Inheritance diagram for Legion::SetView< SET_TYPE >:
Collaboration diagram for Legion::SetView< SET_TYPE >:Classes | |
| struct | InstanceUpdateData |
Public Types | |
| typedef Callback< void(const std::vector< SET_TYPE > &)> | InstanceCallback |
| Callback for when instances are added or removed from the view. More... | |
| typedef Callback< void(const std::vector < InstanceUpdateData > &)> | InstanceUpdateCallback |
| typedef Callback< bool(const SET_TYPE &instance)> | PredicateCallback |
Public Member Functions | |
| SetView (ViewHandle handle, SimulationDatabase &database) | |
| constructor More... | |
| virtual | ~SetView () |
| destructor More... | |
| std::vector< SET_TYPE > & | instances () |
| Returns the instances in this view. More... | |
| virtual bool | addInstanceAddedCallback (InstanceCallback cb) |
| Add/Remove Instances added callbacks. More... | |
| virtual bool | removeInstanceAddedCallback (InstanceCallback cb) |
| virtual bool | addInstanceMovedCallback (InstanceCallback cb) |
| Add/Remove Instances moved callbacks. More... | |
| virtual bool | removeInstanceMovedCallback (InstanceCallback cb) |
| virtual bool | addInstanceRemovedCallback (InstanceCallback cb) |
| Add/Remove Instances removed callbacks. More... | |
| virtual bool | removeInstanceRemovedCallback (InstanceCallback cb) |
| virtual bool | addInstanceUpdatedCallback (InstanceUpdateCallback cb, const std::vector< int > *attributeIndexFilter=nullptr) |
| Add/Remove Instances updated callbacks if attributeIndexFiter == null then all attributes will be tested and returned. More... | |
| virtual bool | removeInstanceUpdatedCallback (InstanceUpdateCallback cb) |
| virtual void | setPredicateFunction (PredicateCallback cb) |
Public Member Functions inherited from Legion::View | |
| View (ViewHandle handle, SimulationDatabase &database) | |
| constructor More... | |
| virtual | ~View () |
| destructor More... | |
| virtual void | initialize () |
| initializes the view once the derived class has installed any predicates/callbacks More... | |
| virtual std::string | name () const |
| Get the name of the view. More... | |
| virtual UInt32 | count () const |
| Get the number entities in this view. More... | |
| virtual Scope | scope () const |
| Get the scope of the view Scope determines if the view contains local, remote, or mixed instances. More... | |
| SimulationDatabase & | database () const |
| The database this view uses. More... | |
Protected Member Functions | |
| virtual void | rebuildInstanceList () |
| Rebuilds the instance list if instances are added/removed. More... | |
| void | callAddedCallbacks (const InstanceHandle *instances, UInt32 count) |
| void | callMovedCallbacks (const InstanceHandle *instances, UInt32 count) |
| void | callRemovedCallbacks (const InstanceHandle *instances, UInt32 count) |
| void | callUpdatedCallbacks (const LEG_InstanceUpdateData *instances, UInt32 count, int cbIndex) |
Protected Member Functions inherited from Legion::View | |
| virtual void | reset () |
Static Protected Member Functions | |
| static void | addedCallback (void *usr, const InstanceHandle *instances, UInt32 count) |
| static void | movedCallback (void *usr, const InstanceHandle *instances, UInt32 count) |
| static void | removedCallback (void *usr, const InstanceHandle *instances, UInt32 count) |
| static void | updatedCallback (void *usr, const LEG_InstanceUpdateData *instances, UInt32 count, int cbIndex) |
| static int | predicate (void *usr, InstanceHandle instance) |
Protected Attributes | |
| std::vector< SET_TYPE > | myInstances |
| std::mutex | myRebuildMutex |
| std::vector< InstanceCallback > | myAddedCallbacks |
| std::vector< InstanceCallback > | myMovedCallbacks |
| std::vector< InstanceCallback > | myRemovedCallbacks |
| std::vector < InstanceUpdateCallback > | myUpdatedCallbacks |
| PredicateCallback | myPredicateFunction |
Protected Attributes inherited from Legion::View | |
| ViewHandle | myHandle |
| SimulationDatabase & | myDatabase |
| std::atomic< UInt32 > | myCount |
| bool | myDirty |
The SetView is a concrete view class that provides a view of the database for instances of a given type.
Users should derive from this class and overload the predicate function to create custom views of an instance type.
| typedef Callback<void(const std::vector<SET_TYPE>&)> Legion::SetView< SET_TYPE >::InstanceCallback |
Callback for when instances are added or removed from the view.
| typedef Callback<void(const std::vector<InstanceUpdateData>&)> Legion::SetView< SET_TYPE >::InstanceUpdateCallback |
| typedef Callback<bool(const SET_TYPE& instance)> Legion::SetView< SET_TYPE >::PredicateCallback |
| Legion::SetView< SET_TYPE >::SetView | ( | ViewHandle | handle, |
| SimulationDatabase & | database | ||
| ) |
|
virtual |
destructor
|
staticprotected |
|
virtual |
Add/Remove Instances added callbacks.
Referenced by DtVehicleSim::DtVehicleSim().
|
virtual |
Add/Remove Instances moved callbacks.
|
virtual |
Add/Remove Instances removed callbacks.
Referenced by DtVehicleSim::DtVehicleSim().
|
virtual |
Add/Remove Instances updated callbacks if attributeIndexFiter == null then all attributes will be tested and returned.
References legion_view_addInstanceUpdatedCallback().
|
protected |
|
protected |
|
protected |
|
protected |
| std::vector< SET_TYPE > & Legion::SetView< SET_TYPE >::instances | ( | ) |
Returns the instances in this view.
|
staticprotected |
|
staticprotected |
References Legion::SetView< SET_TYPE >::myPredicateFunction.
|
protectedvirtual |
Rebuilds the instance list if instances are added/removed.
References legion_view_instances().
|
staticprotected |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
References legion_view_removeInstanceUpdatedCallback().
|
virtual |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by Legion::SetView< SET_TYPE >::predicate().
|
protected |
|
protected |
|
protected |