VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros
stateComponentImplementationTemplate.h File Reference

Go to the source code of this file.

Classes

class  DtStateComponentNextFrameTemplate< T_BaseComponent, V_Data >
 
class  DtStateComponentImplementationTemplate< T_BaseComponent, U_CurrentFrame, V_NextFrame >
 
class  DtStateComponentCurrentFrameTemplate< T_BaseComponent, V_NextFrame, W_Data >
 

Macros

#define SCOPED_WRITE_LOCK_BEGIN
 
#define SCOPED_READ_LOCK_BEGIN
 
#define SCOPED_LOCK_END   delete lock;
 
#define DEFINE_FIELD(MemberType, Member)
 
#define ACCESSOR_MUTATOR_MEMBER(MemberType, Accessor, MutatorAndMember)
 
#define FRAME_ACCESSOR(MemberType, Accessor)   const MemberType Accessor() const override { return frameState().Accessor(); };
 
#define FRAME_ACCESSOR_BY_REF(MemberType, Accessor)   const MemberType& Accessor() const override { return frameState().Accessor(); };
 
#define FRAME_MUTATOR(MemberType, MutatorAndMember)   void set##MutatorAndMember(const MemberType& v) override { frameState().set##MutatorAndMember(v); };
 
#define FRAME_ACCESSOR_WITHLOCK(MemberType, Accessor)   const MemberType Accessor() const override { SCOPED_READ_LOCK_BEGIN MemberType mt = frameState().Accessor(); SCOPED_LOCK_END return mt; };
 
#define FRAME_ACCESSOR_BY_REF_WITHLOCK(MemberType, Accessor)   const MemberType& Accessor() const override { SCOPED_READ_LOCK_BEGIN const MemberType& mt = frameState().Accessor(); SCOPED_LOCK_END return mt; };
 
#define NEXT_FRAME_MUTATOR(MemberType, MutatorAndMember, Accessor)   void set##MutatorAndMember(const MemberType& v) override { if (frameState().Accessor() != v) { markModified(); frameState().set##MutatorAndMember(v); } };
 
#define NEXT_FRAME_MUTATOR_WITHLOCK(MemberType, MutatorAndMember, Accessor)   void set##MutatorAndMember(const MemberType& v) override { if (frameState().Accessor() != v) { SCOPED_WRITE_LOCK_BEGIN markModified(); frameState().set##MutatorAndMember(v); SCOPED_LOCK_END } };
 
#define NEXTFRAME_ACCESSOR_MUTATOR(MemberType, Accessor, MutatorAndMember)
 
#define NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK(MemberType, Accessor, MutatorAndMember)
 
#define NEXTFRAME_ACCESSOR_BY_REF_MUTATOR(MemberType, Accessor, MutatorAndMember)
 
#define CURRENTFRAME_ACCESSOR(MemberType, Accessor, MutatorAndMember)   FRAME_ACCESSOR(MemberType, Accessor)
 
#define CURRENTFRAME_ACCESSOR_BY_REF(MemberType, Accessor, MutatorAndMember)   FRAME_ACCESSOR_BY_REF(MemberType, Accessor)
 

Macro Definition Documentation

#define SCOPED_WRITE_LOCK_BEGIN
Value:
tbb::spin_rw_mutex::scoped_lock* lock = nullptr; \
if (myIsRemoteComponent) { lock = new tbb::spin_rw_mutex::scoped_lock(myMutex, true); }

Begins a scoped exclusive (write) lock on the component mutex for remote components.

#define SCOPED_READ_LOCK_BEGIN
Value:
tbb::spin_rw_mutex::scoped_lock* lock = nullptr; \
if (myIsRemoteComponent) { lock = new tbb::spin_rw_mutex::scoped_lock(myMutex, false); }

Begins a scoped shared (read) lock on the component mutex for remote components.

#define SCOPED_LOCK_END   delete lock;

Ends a scoped lock begun by SCOPED_WRITE_LOCK_BEGIN or SCOPED_READ_LOCK_BEGIN.

#define DEFINE_FIELD (   MemberType,
  Member 
)
Value:
protected: \
MemberType my##Member{};

Declares a protected member field named my##Member of the given type, zero-initialized.

#define ACCESSOR_MUTATOR_MEMBER (   MemberType,
  Accessor,
  MutatorAndMember 
)
Value:
public: \
DEFINE_REF_ACCESSORS(MemberType, Accessor, MutatorAndMember); \
DEFINE_MUTATOR(MemberType, MutatorAndMember); \
DEFINE_FIELD(MemberType, MutatorAndMember)
#define DEFINE_REF_ACCESSORS(ReturnType, Method, Member)
Defines const and non-const reference accessors for a member variable.
Definition: doubleBufferedDataStorage.h:17
#define DEFINE_MUTATOR(Type, Mutator)
Defines an inline setter method that assigns a value to a member variable.
Definition: doubleBufferedDataStorage.h:24
#define DEFINE_FIELD(MemberType, Member)
Declares a protected member field named my##Member of the given type, zero-initialized.
Definition: stateComponentImplementationTemplate.h:25

Declares a public accessor (by value and reference), a public mutator, and a protected member field.

#define FRAME_ACCESSOR (   MemberType,
  Accessor 
)    const MemberType Accessor() const override { return frameState().Accessor(); };

Declares a const accessor that returns a value forwarded from the frame state.

#define FRAME_ACCESSOR_BY_REF (   MemberType,
  Accessor 
)    const MemberType& Accessor() const override { return frameState().Accessor(); };

Declares a const accessor that returns a const reference forwarded from the frame state.

#define FRAME_MUTATOR (   MemberType,
  MutatorAndMember 
)    void set##MutatorAndMember(const MemberType& v) override { frameState().set##MutatorAndMember(v); };

Declares a mutator that writes a value directly into the frame state.

#define FRAME_ACCESSOR_WITHLOCK (   MemberType,
  Accessor 
)    const MemberType Accessor() const override { SCOPED_READ_LOCK_BEGIN MemberType mt = frameState().Accessor(); SCOPED_LOCK_END return mt; };

Declares a thread-safe const accessor (by value) that holds a shared lock while reading the frame state.

#define FRAME_ACCESSOR_BY_REF_WITHLOCK (   MemberType,
  Accessor 
)    const MemberType& Accessor() const override { SCOPED_READ_LOCK_BEGIN const MemberType& mt = frameState().Accessor(); SCOPED_LOCK_END return mt; };

Declares a thread-safe const accessor (by const reference) that holds a shared lock while reading the frame state.

#define NEXT_FRAME_MUTATOR (   MemberType,
  MutatorAndMember,
  Accessor 
)    void set##MutatorAndMember(const MemberType& v) override { if (frameState().Accessor() != v) { markModified(); frameState().set##MutatorAndMember(v); } };

Declares a mutator that updates the next-frame state and marks the component modified when the value changes.

#define NEXT_FRAME_MUTATOR_WITHLOCK (   MemberType,
  MutatorAndMember,
  Accessor 
)    void set##MutatorAndMember(const MemberType& v) override { if (frameState().Accessor() != v) { SCOPED_WRITE_LOCK_BEGIN markModified(); frameState().set##MutatorAndMember(v); SCOPED_LOCK_END } };

Declares a thread-safe mutator that updates the next-frame state under an exclusive write lock when the value changes.

#define NEXTFRAME_ACCESSOR_MUTATOR (   MemberType,
  Accessor,
  MutatorAndMember 
)
Value:
public: \
FRAME_ACCESSOR(MemberType, Accessor) \
NEXT_FRAME_MUTATOR(MemberType, MutatorAndMember, Accessor)
#define NEXT_FRAME_MUTATOR(MemberType, MutatorAndMember, Accessor)
Declares a mutator that updates the next-frame state and marks the component modified when the value ...
Definition: stateComponentImplementationTemplate.h:54
#define FRAME_ACCESSOR(MemberType, Accessor)
Declares a const accessor that returns a value forwarded from the frame state.
Definition: stateComponentImplementationTemplate.h:37

Declares a public next-frame accessor (by value) and next-frame mutator pair.

#define NEXTFRAME_ACCESSOR_MUTATOR_WITHLOCK (   MemberType,
  Accessor,
  MutatorAndMember 
)
Value:
public: \
FRAME_ACCESSOR_WITHLOCK(MemberType, Accessor) \
NEXT_FRAME_MUTATOR_WITHLOCK(MemberType, MutatorAndMember, Accessor)
#define NEXT_FRAME_MUTATOR_WITHLOCK(MemberType, MutatorAndMember, Accessor)
Declares a thread-safe mutator that updates the next-frame state under an exclusive write lock when t...
Definition: stateComponentImplementationTemplate.h:58
#define FRAME_ACCESSOR_WITHLOCK(MemberType, Accessor)
Declares a thread-safe const accessor (by value) that holds a shared lock while reading the frame sta...
Definition: stateComponentImplementationTemplate.h:47

Declares a public thread-safe next-frame accessor (by value) and next-frame mutator pair.

#define NEXTFRAME_ACCESSOR_BY_REF_MUTATOR (   MemberType,
  Accessor,
  MutatorAndMember 
)
Value:
public: \
FRAME_ACCESSOR_BY_REF(MemberType, Accessor) \
NEXT_FRAME_MUTATOR(MemberType, MutatorAndMember, Accessor)
#define FRAME_ACCESSOR_BY_REF(MemberType, Accessor)
Declares a const accessor that returns a const reference forwarded from the frame state...
Definition: stateComponentImplementationTemplate.h:40
#define NEXT_FRAME_MUTATOR(MemberType, MutatorAndMember, Accessor)
Declares a mutator that updates the next-frame state and marks the component modified when the value ...
Definition: stateComponentImplementationTemplate.h:54

Declares a public next-frame accessor (by const reference) and next-frame mutator pair.

#define CURRENTFRAME_ACCESSOR (   MemberType,
  Accessor,
  MutatorAndMember 
)    FRAME_ACCESSOR(MemberType, Accessor)

Declares a read-only current-frame accessor (by value). The MutatorAndMember parameter is unused.

#define CURRENTFRAME_ACCESSOR_BY_REF (   MemberType,
  Accessor,
  MutatorAndMember 
)    FRAME_ACCESSOR_BY_REF(MemberType, Accessor)

Declares a read-only current-frame accessor (by const reference). The MutatorAndMember parameter is unused.


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)