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 Member Functions | Protected Attributes | Friends
makVrf::DtExternalNextFrameState Class Reference

Write-access view of the next-frame state components within a DtStateData. Only the simulation (controller) thread should use this to write state.

Inheritance diagram for makVrf::DtExternalNextFrameState:
Inheritance graph
[legend]

Public Member Functions

 DtExternalNextFrameState (DtStateData *sd)
 
virtual ~DtExternalNextFrameState () override
 
virtual void addStateComponent (DtFrameStateInterface *) override
 
DtFrameStateInterface * addStateComponent (DtStateComponent::StateComponentType type, const DtVrfObjectParameters *=nullptr)
 
template<typename T_Component >
T_Component * addStateComponent (bool checkWritable=false, bool isRemote=false)
 
std::set< int > modifiedStateComponentTypes () const
 
bool isModified () const
 
void nextFrameRemoveStateComponent (const DtFrameStateInterface *component)
 
template<typename T_Component >
void removeStateComponents ()
 
virtual int numComponents (DtStateComponent::StateComponentType scType) const override
 
template<typename T_Component >
const T_Component * getStateComponent (int index=0) const
 
template<typename T_Component >
std::vector< T_Component * > getStateComponentList () const
 
virtual const
DtFrameStateInterface * 
getStateComponent (DtStateComponent::StateComponentType scType, int index=0) const override
 
DtFrameStateInterface * getStateComponent (DtStateComponent::StateComponentType scType, int index=0)
 
virtual bool hasStateComponentType (DtStateComponent::StateComponentType scType) const override
 
virtual void addStateComponent (const DtFrameStateInterface *comp) override
 
template<typename T_Component >
bool isWritable ()
 
template<typename T_Component >
T_Component * getStateComponent (int index=0, bool checkWritable=true)
 
void takeControlOfComponent (DtStateComponent *)
 
virtual const DtString & markingText () const override
 
int numberOfFrameStates () const
 
- Public Member Functions inherited from makVrf::DtExternalFrameStateInterface
 DtExternalFrameStateInterface (DtStateData *sd)
 
virtual ~DtExternalFrameStateInterface ()
 
template<typename T_Component >
bool hasStateComponent () const
 
template<typename T_Component >
const T_Component * getStateComponent () const
 
template<typename T_Component >
std::vector< const T_Component * > getStateComponentList () const
 
virtual void aboutToBeDeleted ()
 
unsigned long long legionGlobalId () const
 

Protected Member Functions

virtual void removeStateComponent (const DtFrameStateInterface *component) override
 

Protected Attributes

std::vector< std::vector
< DtFrameStateInterface * > > 
myFrameState {}
 
- Protected Attributes inherited from makVrf::DtExternalFrameStateInterface
DtStateData * myStateData
 
bool myCleared
 

Friends

class DtStateData
 

Additional Inherited Members

- Public Attributes inherited from makVrf::DtExternalFrameStateInterface
boost::signals2::signal< void(const
DtExternalFrameStateInterface *)> 
signal_externalFrameStateToBeDestroyed
 

Constructor & Destructor Documentation

makVrf::DtExternalNextFrameState::DtExternalNextFrameState ( DtStateData *  sd)
inline

Constructs the next-frame state view for the given state data.

Parameters
sdThe owning state data object.
virtual makVrf::DtExternalNextFrameState::~DtExternalNextFrameState ( )
overridevirtual

Member Function Documentation

virtual void makVrf::DtExternalNextFrameState::addStateComponent ( DtFrameStateInterface *  )
overridevirtual

Adds a writable state component interface to this next-frame view.

Parameters
compThe writable frame state interface to add.

Reimplemented from makVrf::DtExternalFrameStateInterface.

DtFrameStateInterface* makVrf::DtExternalNextFrameState::addStateComponent ( DtStateComponent::StateComponentType  type,
const DtVrfObjectParameters *  = nullptr 
)

Creates and adds a state component of the given type using the component factory.

Parameters
typeThe state component type to create.
paramsOptional object parameters used to initialize the component.
Returns
Pointer to the newly created writable frame state interface.
template<typename T_Component >
T_Component* makVrf::DtExternalNextFrameState::addStateComponent ( bool  checkWritable = false,
bool  isRemote = false 
)

Using the global state component factory, creates and adds a new state of the given type.

std::set<int> makVrf::DtExternalNextFrameState::modifiedStateComponentTypes ( ) const
Returns
A set of state component type integers that have been modified in the next frame.
bool makVrf::DtExternalNextFrameState::isModified ( ) const
Returns
True if any next-frame state component has been modified.
void makVrf::DtExternalNextFrameState::nextFrameRemoveStateComponent ( const DtFrameStateInterface *  component)

Goes to the state data to remove this for the next frame. This is queued, so, the state component is still available.

template<typename T_Component >
void makVrf::DtExternalNextFrameState::removeStateComponents ( )

Queues the removal of all next-frame state components of the given type.

Template Parameters
T_ComponentThe state component type to remove.
virtual int makVrf::DtExternalNextFrameState::numComponents ( DtStateComponent::StateComponentType  ) const
inlineoverridevirtual
Returns
The number of components of the given type registered in this frame state.
Parameters
scTypeThe state component type enum value.

Implements makVrf::DtExternalFrameStateInterface.

template<typename T_Component >
const T_Component* makVrf::DtExternalNextFrameState::getStateComponent ( int  index = 0) const
inline

Returns a const pointer to the next-frame state component of the given type. Throws DtUnknownStateComponent if the component is not found or the cast fails.

Template Parameters
T_ComponentThe specific state component type to retrieve.
Parameters
indexZero-based index when multiple components of the same type exist.
Returns
Const pointer to the component.
template<typename T_Component >
std::vector<T_Component*> makVrf::DtExternalNextFrameState::getStateComponentList ( ) const
inline

Returns a vector of writable pointers to all next-frame components of the given type.

Template Parameters
T_ComponentThe specific state component type to collect.
Returns
A vector of pointers (entries may be nullptr if a cast fails).
virtual const DtFrameStateInterface* makVrf::DtExternalNextFrameState::getStateComponent ( DtStateComponent::StateComponentType  scType,
int  index = 0 
) const
inlineoverridevirtual

Returns a const pointer to the next-frame state component of the given type at the specified index.

Parameters
scTypeThe state component type enum value.
indexZero-based index.
Returns
Const pointer to the interface, or nullptr if not found.

Implements makVrf::DtExternalFrameStateInterface.

DtFrameStateInterface* makVrf::DtExternalNextFrameState::getStateComponent ( DtStateComponent::StateComponentType  scType,
int  index = 0 
)
inline

Returns a writable pointer to the next-frame state component of the given type at the specified index.

Parameters
scTypeThe state component type enum value.
indexZero-based index.
Returns
Writable pointer to the interface, or nullptr if not found.
virtual bool makVrf::DtExternalNextFrameState::hasStateComponentType ( DtStateComponent::StateComponentType  ) const
overridevirtual
Returns
True if a state component of the given type is registered.
Parameters
scTypeThe state component type enum value.

Implements makVrf::DtExternalFrameStateInterface.

virtual void makVrf::DtExternalNextFrameState::addStateComponent ( const DtFrameStateInterface *  comp)
overridevirtual

Adds a read-only state component to the next-frame view (used during frame commit).

Parameters
compThe read-only component interface to register.

Implements makVrf::DtExternalFrameStateInterface.

template<typename T_Component >
bool makVrf::DtExternalNextFrameState::isWritable ( )
inline
Returns
True if the next-frame state component of the given type is writable.
Template Parameters
T_ComponentThe state component type to check.
template<typename T_Component >
T_Component* makVrf::DtExternalNextFrameState::getStateComponent ( int  index = 0,
bool  checkWritable = true 
)
inline

Returns a writable pointer to the next-frame state component of the given type. Throws DtUnknownStateComponent if the component is not found, the cast fails, or checkWritable is true and the component is not writable.

Template Parameters
T_ComponentThe specific state component type to retrieve.
Parameters
indexZero-based index when multiple components of the same type exist.
checkWritableIf true, throws if the component is not writable.
Returns
Writable pointer to the component.
void makVrf::DtExternalNextFrameState::takeControlOfComponent ( DtStateComponent *  )

Transfers ownership of this state component to this frame state view.

Parameters
compThe state component whose ownership is being transferred.
virtual const DtString& makVrf::DtExternalNextFrameState::markingText ( ) const
overridevirtual
Returns
The marking text of the entity owning this state data.

Reimplemented from makVrf::DtExternalFrameStateInterface.

int makVrf::DtExternalNextFrameState::numberOfFrameStates ( ) const
inline
Returns
The total number of state component type slots currently allocated.
virtual void makVrf::DtExternalNextFrameState::removeStateComponent ( const DtFrameStateInterface *  component)
overrideprotectedvirtual

Removes the state component from the next list such that in an apply frame it will not be applied and removed from the current list. It is still current until the frame advances. Should never be called by developer directly.

Implements makVrf::DtExternalFrameStateInterface.

Friends And Related Function Documentation

friend class DtStateData
friend

Member Data Documentation

std::vector<std::vector<DtFrameStateInterface*> > makVrf::DtExternalNextFrameState::myFrameState {}
protected

The table of writable next-frame state component interfaces, indexed by state component type.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)