Open 3D Engine GridMate API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GridMate::DataSet< DataType, MarshalerType, ThrottlerType > Class Template Reference

#include <DataSet.h>

Inherits GridMate::DataSetBase.

Inherited by GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::BindInterface< C, FuncPtr, CallbackTraits >.

Classes

class  BindInterface
 
class  BindOverrideInterface
 
struct  StampedBuffer
 

Public Member Functions

 DataSet (const char *debugName, const DataType &value=DataType(), const MarshalerType &marshaler=MarshalerType(), const ThrottlerType &throttler=ThrottlerType())
 
void Set (const DataType &v)
 
void Set (DataType &&v)
 
template<class ... Args>
void SetEmplace (Args &&... args)
 
template<typename FuncPtr >
bool Modify (FuncPtr func)
 
const DataType & Get () const
 
MarshalerType & GetMarshaler ()
 
ThrottlerType & GetThrottler ()
 
bool operator== (const DataType &other) const
 
bool operator== (const DataSet &other) const
 
bool operator!= (const DataType &other) const
 
bool operator!= (const DataSet &other) const
 
- Public Member Functions inherited from GridMate::DataSetBase
void SetMaxIdleTime (float dt)
 
float GetMaxIdleTime () const
 
bool CanSet () const
 
bool IsDefaultValue () const
 
void MarkAsDefaultValue ()
 
void MarkAsNonDefaultValue ()
 
unsigned int GetLastUpdateTime () const
 
ReplicaChunkBaseGetReplicaChunkBase () const
 
AZ::u64 GetRevision () const
 
void SetDispatchOverride (DispatchCallback callback)
 Delta compressed DataSets use an intermediary to catch dispatches of changed DataSets in their logic. More...
 
const DispatchCallback & GetDispatchOverride () const
 Delta compressed fields override a dispatch. More...
 

Protected Member Functions

 DataSet (const DataSet &rhs)=delete
 
DataSetoperator= (const DataSet &)=delete
 
void SetDirty () override
 
PrepareDataResult PrepareData (EndianType endianType, AZ::u32 marshalFlags) override
 
void Unmarshal (UnmarshalContext &mc) override
 
void ResetDirty () override
 
bool IsWithinToleranceThreshold ()
 
void DispatchChangedEvent (const TimeContext &tc) override
 
- Protected Member Functions inherited from GridMate::DataSetBase
 DataSetBase (const char *debugName)
 
ReadBuffer GetMarshalData () const
 

Protected Attributes

DataType m_value
 
ThrottlerType m_throttler
 
MarshalerType m_marshaler
 
float m_idleTicks
 
- Protected Attributes inherited from GridMate::DataSetBase
float m_maxIdleTicks
 
WriteBufferDynamic m_streamCache
 
ReplicaChunkBasem_replicaChunk
 raw pointer, assuming datasets do not exists without replica chunk
 
unsigned int m_lastUpdateTime
 
bool m_isDefaultValue
 
AZ::u64 m_revision
 Latest revision number; 0 means unset.
 
DispatchCallback m_override
 

Additional Inherited Members

- Public Types inherited from GridMate::DataSetBase
using DispatchCallback = AZStd::function< void(const TimeContext &tc)>
 

Detailed Description

template<typename DataType, typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
class GridMate::DataSet< DataType, MarshalerType, ThrottlerType >

Declares a networked DataSet of type DataType. Optionally pass in a marshaler that can write the data to a stream. Otherwise the DataSet will expect to find a ForwardMarshaler specialized on type DataType. Optionally pass in a throttler that can decide when the data has changed enough to send to the downstream proxies.

Constructor & Destructor Documentation

◆ DataSet()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::DataSet ( const char *  debugName,
const DataType &  value = DataType(),
const MarshalerType &  marshaler = MarshalerType(),
const ThrottlerType &  throttler = ThrottlerType() 
)
inline

Constructs a DataSet.

Member Function Documentation

◆ Get()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
const DataType& GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::Get ( ) const
inline

Returns the current value of the DataSet.

◆ GetMarshaler()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
MarshalerType& GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::GetMarshaler ( )
inline

Returns the marshaler instance.

◆ GetThrottler()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
ThrottlerType& GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::GetThrottler ( )
inline

Returns the throttler instance.

◆ Modify()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
template<typename FuncPtr >
bool GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::Modify ( FuncPtr  func)
inline

Modify the DataSet directly without copying it. Call this on the Primary node, passing in a function object that takes the value by reference, optionally modifies the data, and returns true if the data was changed.

◆ operator==()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
bool GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::operator== ( const DataType &  other) const
inline

Returns equality for values of the same type

◆ Set() [1/2]

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
void GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::Set ( const DataType &  v)
inline

Modify the DataSet. Call this on the Primary node to change the data, which will be propagated to all proxies.

◆ Set() [2/2]

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
void GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::Set ( DataType &&  v)
inline

Modify the DataSet. Call this on the Primary node to change the data, which will be propagated to all proxies.

◆ SetEmplace()

template<typename DataType , typename MarshalerType = Marshaler<DataType>, typename ThrottlerType = BasicThrottle<DataType>>
template<class ... Args>
void GridMate::DataSet< DataType, MarshalerType, ThrottlerType >::SetEmplace ( Args &&...  args)
inline

Modify the DataSet. Call this on the Primary node to change the data, which will be propagated to all proxies.


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