Rebel Fork Framework
Urho3D::NetworkValue< T, Traits > Class Template Reference

#include <Urho3D/Replica/NetworkValue.h>

Inheritance diagram for Urho3D::NetworkValue< T, Traits >:
Urho3D::Detail::NetworkValueBase

Public Types

using InternalType = typename Traits::InternalType
 
using ReturnType = typename Traits::ReturnType
 

Public Member Functions

 NetworkValue (const Traits &traits)
 
void Resize (unsigned capacity)
 
void Set (NetworkFrame frame, const InternalType &value)
 Set value for given frame if possible.
 
bool Has (NetworkFrame frame) const
 Return whether the frame is present.
 
ea::optional< InternalType > GetRaw (NetworkFrame frame) const
 Return raw value at given frame.
 
const InternalType & GetRawUnchecked (NetworkFrame frame) const
 Return raw valid value at given frame.
 
ea::optional< ea::pair< InternalType, NetworkFrame > > GetRawOrPrior (NetworkFrame frame) const
 Return raw value at the given or prior frame.
 
InternalType GetClosestRaw (NetworkFrame frame) const
 Return closest valid raw value. Prior values take precedence.
 
InternalType SampleValid (const NetworkTime &time, float snapThreshold=M_LARGE_VALUE) const
 Interpolate between two frames or return value of the closest valid frame.
 
ea::optional< InternalType > SamplePrecise (const NetworkTime &time, float snapThreshold=M_LARGE_VALUE) const
 Interpolate between two valid frames if possible.
 

Private Member Functions

ea::pair< InternalType, bool > CalculateInterpolatedValue (const NetworkTime &time, float snapThreshold) const
 Calculate exact, interpolated or nearest valid value. Return whether the result is precise.
 
- Private Member Functions inherited from Urho3D::Detail::NetworkValueBase
bool IsInitialized () const
 
unsigned GetCapacity () const
 
NetworkFrame GetFirstFrame () const
 
NetworkFrame GetLastFrame () const
 
void Resize (unsigned capacity)
 
ea::optional< unsigned > FrameToIndex (NetworkFrame frame) const
 
unsigned FrameToIndexUnchecked (NetworkFrame frame) const
 
ea::optional< unsigned > AllocatedFrameToIndex (NetworkFrame frame) const
 
bool AllocateFrame (NetworkFrame frame)
 
bool HasFrame (NetworkFrame frame) const
 
ea::optional< NetworkFrameFindClosestAllocatedFrame (NetworkFrame frame, bool searchPast, bool searchFuture) const
 
NetworkFrame GetClosestAllocatedFrame (NetworkFrame frame) const
 
InterpolationBase GetValidFrameInterpolation (const NetworkTime &time) const
 

Private Attributes

ea::vector< InternalType > values_
 

Detailed Description

template<class T, class Traits = NetworkValueTraits<T>>
class Urho3D::NetworkValue< T, Traits >

Value stored at multiple points of time in ring buffer. If value was set at least once, it will have at least one valid value forever. Value can be sampled raw or interpolated. No extrapolation is performed.


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