|
typedef u16 | Id |
| Specifies the type of the ID for identifying clone elements.
|
|
typedef ReckoningStrategy_ | ReckoningStrategy |
| Defines the type of the dead reckoning algorithm.
|
|
typedef ReckoningStrategy::Sample | Sample |
| Defines the type of the sample.
|
|
typedef SerializePolicy_ | SerializePolicy |
| Specifies the algorithm to use for serializing Sample .
|
|
typedef ReckoningStrategy::SetValueArg | SetValueArg |
| Specifies the type of value that is passed to ReckoningStrategy::CheckSample and ReckoningStrategy::MakeSample from SetValue .
|
|
typedef ReckoningStrategy::Value | Value |
| Specifies the type of value managed by this object.
|
|
typedef ReckoningStrategy::Work | Work |
| Defines the type of the working buffer.
|
|
|
| ReckoningCloneElement (ReckoningStrategy *pReckoningStrategy=NULL) |
| Instantiates the object (constructor). More...
|
|
virtual | ~ReckoningCloneElement () |
| Destroys the object (destructor).
|
|
const CloneBase * | GetCloneBase () const |
| Gets the CloneBase this object is registered to. More...
|
|
Id | GetId () const |
| Gets the ID. More...
|
|
const CloneProtocol * | GetProtocol () const |
| Gets the CloneProtocol of the CloneBase this object is registered to. More...
|
|
const Value & | GetValue () |
| Gets a value. More...
|
|
bool | IsReadyToSetValue () const |
| Determines whether a value can be set. More...
|
|
bool | IsRegisteredWithCloneBase () const |
| Determines whether the object is registered with CloneBase . More...
|
|
bool | IsRegisteredWithProtocol () const |
| Determines whether the object is registered with CloneProtocol . More...
|
|
bool | IsValidValue () |
| Gets whether a valid value can be obtained using GetValue . More...
|
|
nn::Result | ResetReckoningStrategy () |
| Resets the currently set instance of the dead reckoning algorithm. More...
|
|
nn::Result | SetReckoningStrategy (ReckoningStrategy *pReckoningStrategy) |
| Sets an instance of the dead reckoning algorithm. More...
|
|
nn::Result | SetValue (const Value &value, const SetValueArg *cpSetValueArg=NULL) |
| Sets values. More...
|
|
void | Trace (u64 flag) const |
| Prints information that is useful for debugging. More...
|
|
|
nn::Result | SetProfiler (CloneProfilerBase *pSendProfiler, CloneProfilerBase *pReceiveProfiler) |
| Sets an object to manage send/receive profiling. More...
|
|
const CloneProfilerBase * | GetSendProfiler () const |
| Gets the object configured to manage send profiling. More...
|
|
const CloneProfilerBase * | GetReceiveProfiler () const |
| Gets the object configured to manage receive profiling. More...
|
|
void | ResetProfiler () |
| Resets the results of send/receive profiling. More...
|
|
u32 | GetProfiledLatestSendCount (StationIndex stationIndex) const |
| Gets the send count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called. More...
|
|
u32 | GetProfiledLatestSendSize (StationIndex stationIndex) const |
| Gets the total amount of data, in bytes, sent during the last CloneProfiler::LATEST_BUFFER_SIZE times of common::Scheduler::Dispatch being called. More...
|
|
u32 | GetProfiledTotalSendCount (StationIndex stationIndex) const |
| Gets the number of times sent since ResetProfiler was called. More...
|
|
u32 | GetProfiledTotalSendSize (StationIndex stationIndex) const |
| Gets the amount of data, in bytes, sent since ResetProfiler was called. More...
|
|
u32 | GetProfiledLatestReceiveCount (StationIndex stationIndex) const |
| Gets the receive count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called. More...
|
|
u32 | GetProfiledLatestReceiveSize (StationIndex stationIndex) const |
| Gets the total amount of data, in bytes, received during the last CloneProfiler::LATEST_BUFFER_SIZE times of common::Scheduler::Dispatch being called. More...
|
|
u32 | GetProfiledTotalReceiveCount (StationIndex stationIndex) const |
| Gets the number of times received since ResetProfiler was called. More...
|
|
u32 | GetProfiledTotalReceiveSize (StationIndex stationIndex) const |
| Gets the amount of data, in bytes, received since ResetProfiler was called. More...
|
|
template<typename ReckoningStrategy_, typename SerializePolicy_ = clone::HostByteOrderSerializePolicy<typename ReckoningStrategy_::Sample>>
class nn::pia::reckoning::ReckoningCloneElement< ReckoningStrategy_, SerializePolicy_ >
Manages the sending and receiving of values while using dead reckoning.
- Template Parameters
-
ReckoningStrategy_ | Specifies the type of class that defines the reckoning algorithm. |
SerializePolicy_ | Specifies the algorithm to use for serializing ReckoningStrategy::Sample . |
Some of the configured values are saved and sent as a sample on which to predict the current value, eliminating the need to send all of the configured values.
The following members must be defined in the class specified for ReckoningStrategy
.
Types
- Specifies the type of value that is set and retrieved using
SetValue
and GetValue
.
- Specifies the type of the sample. The value is actually sent and received using this type.
- Specifies the type of value that is set when calling
SetValue
, and is passed to the ReckoningStrategy::CheckSample
and ReckoningStrategy::MakeSample
functions. Specify void
if this is not required.
- Specifies the type that stores the pre-calculated result for prediction. Specify
void
if this is not required.
Constants
- Specifies the number of samples to retain.
Functions
- Calculate the prediction. If the prediction could be calculated, set the value in
*pValue
and return true
. If it could not be calculated, return false
.
bool CheckSample(
bool* pIsReliable,
Determine whether to use the value
set with SetValue
as a sample. Return true
to use it as a sample. If you want to use reliable communication when sending the sample, set *pIsReliable
to true
.
- Calculate the value to save as a sample. This is called when
CheckSample
determines the value is to be used as a sample and the buffer was successfully allocated. Set the sample in *pSample
.
void OnUpdateSample(
int index,
This is called when a sample is added. Update the pWork
value as necessary.
For more information, see the Programming Manual.
- Revision History:
- 2013-10-28 Initial version.
Sets an object to manage send/receive profiling.
Clone element send/receive tasks can be profiled by configuring CloneProfiler
. This calculation includes all exchanges of data between this clone element and other clone elements, so the data exchanges between clone elements on the local station are also included in the value.
Even when compression is enabled, the uncompressed size is used in the calculation.
A CloneProfiler
instance that is already configured can be released by specifying NULL
in the arguments.
- Parameters
-
[in] | pSendProfiler | Specifies the CloneProfiler that manages the send profiling. Specify NULL if not necessary. |
[in] | pReceiveProfiler | Specifies the CloneProfiler that manages the receive profiling. Specify NULL if not necessary. |
- Returns
- Returns a
Result
value for which the IsSuccess
function returns true
if execution succeeds. You must make sure that the implementation of this function in your application does not return any errors.
- Error Return Values:
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.