CTR Pia  4.11.3
Game Communication Engine
nn::pia::clone::CloneProtocol Class Reference

Represents a protocol for sharing values between stations.
More...

+ Inheritance diagram for nn::pia::clone::CloneProtocol:

Classes

struct  Setting
 Stores settings specified during initialization. More...
 

Public Types

typedef int(* ClockPriorityJudgeFunction) (ClockValue clock, StationIndex stationA, StationIndex stationB)
 Compares the order. More...
 

Public Member Functions

void Finalize ()
 Finalizes the class instance. More...
 
ClockValue GetClock () const
 Gets the current clock. More...
 
size_t GetElementSizeMax () const
 Gets the maximum value that can be retrieved from the SerializePolicy::GetSize function of the clone element to be used. More...
 
ErrorType GetError () const
 Gets the error state. More...
 
u16 GetMaxSendDelay () const
 Gets the maximum time to defer the sending of data. More...
 
State GetState () const
 Gets the current operational state. More...
 
nn::Result Initialize (const Setting &setting)
 Initialization. Make this call between the BeginSetup and EndSetup functions. More...
 
bool IsActiveStation (StationId stationId) const
 Determines whether the CloneProtocol of the specified station is active. More...
 
bool IsRegulatingClock () const
 Gets whether the clock is being regulated. More...
 
nn::Result RegisterAtomicSharingClone (AtomicSharingClone *pClone, CloneBase::Id cloneId)
 Registers a AtomicSharingClone to the specified ID. More...
 
nn::Result RegisterReceiveClone (ReceiveClone *pClone, StationIndex sendStationIndex, CloneBase::Id cloneId)
 Registers a ReceiveClone to the specified ID. More...
 
nn::Result RegisterSendClone (SendClone *pClone, CloneBase::Id cloneId)
 Registers a SendClone to the specified ID. More...
 
nn::Result RegisterSequentialSharingClone (SequentialSharingClone *pClone, CloneBase::Id cloneId)
 Registers a SequentialSharingClone to the specified ID. More...
 
nn::Result RegulateClock ()
 Starts re-regulating the clock. More...
 
AtomicSharingCloneSearchAtomicSharingClone (CloneBase::Id cloneId)
 Searches for and gets the AtomicSharingClone object with the specified ID. More...
 
const AtomicSharingCloneSearchAtomicSharingClone (CloneBase::Id cloneId) const
 Searches for and gets the AtomicSharingClone object with the specified ID. More...
 
ReceiveCloneSearchReceiveClone (StationIndex sendStationIndex, CloneBase::Id cloneId)
 Searches for and gets the ReceiveClone object with the specified ID. More...
 
const ReceiveCloneSearchReceiveClone (StationIndex sendStationIndex, CloneBase::Id cloneId) const
 Searches for and gets the ReceiveClone object with the specified ID. More...
 
SendCloneSearchSendClone (CloneBase::Id cloneId)
 Searches for and gets the SendClone object with the specified ID. More...
 
const SendCloneSearchSendClone (CloneBase::Id cloneId) const
 Searches for and gets the SendClone object with the specified ID. More...
 
SequentialSharingCloneSearchSequentialSharingClone (CloneBase::Id cloneId)
 Searches for and gets the SequentialSharingClone object with the specified ID. More...
 
const SequentialSharingCloneSearchSequentialSharingClone (CloneBase::Id cloneId) const
 Searches for and gets the SequentialSharingClone object with the specified ID. More...
 
nn::Result SetClockOverFlowSpanForDebug (u32 span)
 (For debugging.) Sets the time until the clock value overflows. More...
 
nn::Result SetMaxSendDelay (u16 maxSendDelay)
 Sets the maximum time to defer the sending of data. More...
 
nn::Result SetResendSpanRatio (f32 ratio)
 Specifies the ratio of the resend interval for the base RTT obtained from profiling. More...
 
nn::Result Start ()
 Starts operation of CloneProtocol. More...
 
nn::Result Stop ()
 Stops operation of CloneProtocol. More...
 
virtual void Trace (u64 flag) const
 Prints information that is useful for debugging. More...
 
nn::Result UnregisterAtomicSharingClone (AtomicSharingClone *pClone)
 Unregisters a AtomicSharingClone. More...
 
nn::Result UnregisterAtomicSharingClone (CloneBase::Id cloneId)
 Unregisters a AtomicSharingClone. More...
 
nn::Result UnregisterReceiveClone (ReceiveClone *pClone)
 Unregisters a ReceiveClone. More...
 
nn::Result UnregisterReceiveClone (StationIndex sendStationIndex, CloneBase::Id cloneId)
 Unregisters a ReceiveClone. More...
 
nn::Result UnregisterSendClone (SendClone *pClone)
 Unregisters a SendClone. More...
 
nn::Result UnregisterSendClone (CloneBase::Id cloneId)
 Unregisters a SendClone. More...
 
nn::Result UnregisterSequentialSharingClone (SequentialSharingClone *pClone)
 Unregisters a SequentialSharingClone. More...
 
nn::Result UnregisterSequentialSharingClone (CloneBase::Id cloneId)
 Unregisters a SequentialSharingClone. More...
 
void UpdateClock ()
 Advances the clock by one frame. More...
 
Profiling
nn::Result SetProfiler (CloneProfilerBase *pSendProfiler, CloneProfilerBase *pReceiveProfiler)
 Sets an object to manage send/receive profiling. More...
 
const CloneProfilerBaseGetSendProfiler () const
 Gets the object configured to manage send profiling. More...
 
const CloneProfilerBaseGetReceiveProfiler () 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...
 

Static Public Attributes

static const u32 COMPRESSION_LEVEL_HIGH = 9
 Specifies the compression level (compression rate emphasized) for the data to send specified in Setting::dataCompressionLevel.
 
static const u32 COMPRESSION_LEVEL_LOW = 1
 Specifies the compression level (speed emphasized) for the data to send specified in Setting::dataCompressionLevel.
 
static const u32 COMPRESSION_LEVEL_MIDDLE = 5
 Specifies the compression level for the data to send specified in Setting::dataCompressionLevel.
 
static const u32 COMPRESSION_LEVEL_NONE = 0
 Specifies the compression level (no compression) for the data to send specified in Setting::dataCompressionLevel.
 

Detailed Description

Represents a protocol for sharing values between stations.


Revision History:

2014-08-01 Changed specifications specific to the arguments and success conditions for the RegisterReceiveClone, UnregisterReceiveClone, and SearchReceiveClone functions.

2014-07-17 Changed specifications specific to success conditions for the RegisterReceiveClone, UnregisterReceiveClone, and SearchReceiveClone functions.

2014-07-17 Changed the names of the SetDefermentPeriod and GetDefermentPeriod functions to the SetMaxSendDelay and GetMaxSendDelay functions, respectively.

2014-01-30 Added constants to specify the compression level of synchronization data, and made any other compression levels unsupported.

2013-11-25 Added a profiling feature.

2013-11-19 Corrected the spelling of Setting::m_RegulationRate.

2013-07-18 Initial version.

Member Typedef Documentation

typedef int(* nn::pia::clone::CloneProtocol::ClockPriorityJudgeFunction) (ClockValue clock, StationIndex stationA, StationIndex stationB)

Compares the order.

Parameters
[in]clockSpecifies the time of the comparison.
[in]stationASpecifies the StationIndex of a station to compare.
[in]stationBSpecifies the StationIndex of a station to compare.
Returns
When the time is clock, returns a negative value when stationB is treated as if it occurred before stationA. Returns a positive value when stationB is treated as if it occurred after stationA.

This function is never called when stationA and stationB are the same value.

This function must never give contradictory order relationships at any particular time. For example, if ClockPriorityJudgeFunction(clock, stationA, stationB) < 0 is true, ClockPriorityJudgeFunction(clock, stationB, stationA) > 0 must also be true. When ClockPriorityJudgeFunction(clock, stationA, stationB) < 0 and ClockPriorityJudgeFunction(clock, stationB, stationC) < 0 are both true, ClockPriorityJudgeFunction(clock, stationA, stationC) < 0 must also be true.

At different times, however, the order relationship does not need to match. Just because ClockPriorityJudgeFunction(clock1, stationA, stationB) < 0 is true does not mean it is a problem for ClockPriorityJudgeFunction(clock2, stationA, stationB) > 0 to also be true.

Member Enumeration Documentation

Enumerates the error state.

Enumerator
ERROR_TYPE_NOTHING 

Specifies no error.

ERROR_TYPE_DROP_EVENT 

Specifies an inconsistency in event management.

Some event notifications may not have been sent. This error can occur when EventCloneElement is used with AtomicSharingClone.

ERROR_TYPE_CLOCK_OVERFLOW 

Specifies the clock value overflowed. Widespread inconsistencies may be occurring.

Enumerates the operational states of CloneProtocol.

Enumerator
STATE_INACTIVE 

Specifies inactive.

STATE_START 

Specifies starting up.

STATE_ACTIVE 

Specifies active.

STATE_STOP 

Specifies stopping.

Member Function Documentation

void nn::pia::clone::CloneProtocol::Finalize ( )

Finalizes the class instance.

See also
Initialize
ClockValue nn::pia::clone::CloneProtocol::GetClock ( ) const

Gets the current clock.

Returns
Returns the current clock. Returns INVALID_CLOCK if a valid clock does not exist because, for example, the object is not active.
See also
UpdateClock
size_t nn::pia::clone::CloneProtocol::GetElementSizeMax ( ) const
inline

Gets the maximum value that can be retrieved from the SerializePolicy::GetSize function of the clone element to be used.

If a clone with a registered clone element larger than this value is passed to the RegisterXXXClone function, ResultInvalidArgument is returned.

This value is the maximum size that can fit in a single packet. The value differs depending on the communication module being used and the MTU setting. This value can be retrieved after the Initialize function has been called.

Returns
Returns the maximum value that can be retrieved from the SerializePolicy::GetSize function of the clone element to be used.
ErrorType nn::pia::clone::CloneProtocol::GetError ( ) const
inline

Gets the error state.

When an error occurs, the values being sent or received may be invalid. We recommend stopping the match and ending the session with the Stop function. This value is reset when the Start function is called again. When multiple error types occur, the one with the highest ErrorType takes precedence.

Returns
Returns the error state.
u16 nn::pia::clone::CloneProtocol::GetMaxSendDelay ( ) const
inline

Gets the maximum time to defer the sending of data.

Returns
Returns the maximum time to defer the sending of data. The value is in milliseconds.
See also
SetMaxSendDelay
u32 nn::pia::clone::CloneProtocol::GetProfiledLatestReceiveCount ( StationIndex  stationIndex) const

Gets the receive count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The receive count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called. Returns 0 if no object is configured to manage receive profiling.
See also
SetProfiler
u32 nn::pia::clone::CloneProtocol::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.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The total amount of data, in bytes, received during the last CloneProfiler::LATEST_BUFFER_SIZE times of common::Scheduler::Dispatch being called. Returns 0 if no object is configured to manage receive profiling.
See also
SetProfiler
u32 nn::pia::clone::CloneProtocol::GetProfiledLatestSendCount ( StationIndex  stationIndex) const

Gets the send count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The send count for the last CloneProfiler::LATEST_BUFFER_SIZE times common::Scheduler::Dispatch was called. Returns 0 if no object is configured to manage send profiling.
See also
SetProfiler
u32 nn::pia::clone::CloneProtocol::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.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The total amount of data, in bytes, sent during the last CloneProfiler::LATEST_BUFFER_SIZE times of common::Scheduler::Dispatch being called. Returns 0 if no object is configured to manage send profiling.
See also
SetProfiler
u32 nn::pia::clone::CloneProtocol::GetProfiledTotalReceiveCount ( StationIndex  stationIndex) const

Gets the number of times received since ResetProfiler was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The number of times received since ResetProfiler was called. Returns 0 if no object is configured to manage receive profiling.
See also
SetProfiler, ResetProfiler
u32 nn::pia::clone::CloneProtocol::GetProfiledTotalReceiveSize ( StationIndex  stationIndex) const

Gets the amount of data, in bytes, received since ResetProfiler was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The amount of data, in bytes, received since ResetProfiler was called. Returns 0 if no object is configured to manage receive profiling.
See also
SetProfiler, ResetProfiler
u32 nn::pia::clone::CloneProtocol::GetProfiledTotalSendCount ( StationIndex  stationIndex) const

Gets the number of times sent since ResetProfiler was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The number of times sent since ResetProfiler was called. Returns 0 if no object is configured to manage send profiling.
See also
SetProfiler, ResetProfiler
u32 nn::pia::clone::CloneProtocol::GetProfiledTotalSendSize ( StationIndex  stationIndex) const

Gets the amount of data, in bytes, sent since ResetProfiler was called.

Parameters
[in]stationIndexThe StationIndex that is subject to profiling.
Returns
The amount of data, in bytes, sent since ResetProfiler was called. Returns 0 if no object is configured to manage send profiling.
See also
SetProfiler, ResetProfiler
const CloneProfilerBase* nn::pia::clone::CloneProtocol::GetReceiveProfiler ( ) const
inline

Gets the object configured to manage receive profiling.

Returns
The object configured to manage receive profiling. Returns NULL if nothing has been set.
See also
SetProfiler
const CloneProfilerBase* nn::pia::clone::CloneProtocol::GetSendProfiler ( ) const
inline

Gets the object configured to manage send profiling.

Returns
The object configured to manage send profiling. Returns NULL if nothing has been set.
See also
SetProfiler
State nn::pia::clone::CloneProtocol::GetState ( ) const
inline

Gets the current operational state.

Returns
Returns the current operational state.
nn::Result nn::pia::clone::CloneProtocol::Initialize ( const Setting setting)

Initialization. Make this call between the BeginSetup and EndSetup functions.

Parameters
[in]settingSpecifies various settings. Specify the same values on all stations. Operations are undefined when different values are specified.
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:

ResultAlreadyInitialized Indicates that the instance is already initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

See also
Finalize
bool nn::pia::clone::CloneProtocol::IsActiveStation ( StationId  stationId) const

Determines whether the CloneProtocol of the specified station is active.

Parameters
[in]stationIdSpecifies the StationId of the station to be checked if active.
Returns
Returns true if the specified station is active.
bool nn::pia::clone::CloneProtocol::IsRegulatingClock ( ) const

Gets whether the clock is being regulated.

Returns
Returns true if the clock is being regulated..
See also
RegulateClock
nn::Result nn::pia::clone::CloneProtocol::RegisterAtomicSharingClone ( AtomicSharingClone pClone,
CloneBase::Id  cloneId 
)
inline

Registers a AtomicSharingClone to the specified ID.

Parameters
[in]pCloneSpecifies the AtomicSharingClone to register.
[in]cloneIdSpecifies the ID to register to.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

ResultAlreadyExists Indicates that the object is already registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::RegisterReceiveClone ( ReceiveClone pClone,
StationIndex  sendStationIndex,
CloneBase::Id  cloneId 
)

Registers a ReceiveClone to the specified ID.

Parameters
[in]pCloneSpecifies the ReceiveClone to register.
[in]sendStationIndexSpecifies the StationIndex of the sender with the SendClone.
[in]cloneIdSpecifies the ID to register to.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

ResultAlreadyExists Indicates that the object is already registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::RegisterSendClone ( SendClone pClone,
CloneBase::Id  cloneId 
)
inline

Registers a SendClone to the specified ID.

Parameters
[in]pCloneSpecifies the SendClone to register.
[in]cloneIdSpecifies the ID to register to.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

ResultAlreadyExists Indicates that the object is already registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::RegisterSequentialSharingClone ( SequentialSharingClone pClone,
CloneBase::Id  cloneId 
)
inline

Registers a SequentialSharingClone to the specified ID.

Parameters
[in]pCloneSpecifies the SequentialSharingClone to register.
[in]cloneIdSpecifies the ID to register to.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

ResultAlreadyExists Indicates that the object is already registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::RegulateClock ( )

Starts re-regulating the clock.

The clock managed by the CloneProtocol for this station is re-adjusted to be in line with the average clock of the other stations. Discrepancies are fixed by advancing the clock at a faster or slower rate than usual after examining the clocks of the other stations. The rate itself is set in the Setting::clockRegulationRate member of the Setting object that is specified when the Initialize function is called.

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:
ResultInvalidState Indicates that the state is not STATE_ACTIVE or the clock is already being regulated. Programming error. Fix your program so that this error is not returned.
See also
IsRegulatingClock
void nn::pia::clone::CloneProtocol::ResetProfiler ( )

Resets the results of send/receive profiling.

See also
SetProfiler
AtomicSharingClone* nn::pia::clone::CloneProtocol::SearchAtomicSharingClone ( CloneBase::Id  cloneId)
inline

Searches for and gets the AtomicSharingClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the AtomicSharingClone to search for.
Returns
Returns the AtomicSharingClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
const AtomicSharingClone* nn::pia::clone::CloneProtocol::SearchAtomicSharingClone ( CloneBase::Id  cloneId) const
inline

Searches for and gets the AtomicSharingClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the AtomicSharingClone to search for.
Returns
Returns the AtomicSharingClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
ReceiveClone* nn::pia::clone::CloneProtocol::SearchReceiveClone ( StationIndex  sendStationIndex,
CloneBase::Id  cloneId 
)

Searches for and gets the ReceiveClone object with the specified ID.

Parameters
[in]sendStationIndexSpecifies the StationIndex of the sender with the SendClone.
[in]cloneIdSpecifies the ID of the ReceiveClone to search for.
Returns
Returns the ReceiveClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
const ReceiveClone* nn::pia::clone::CloneProtocol::SearchReceiveClone ( StationIndex  sendStationIndex,
CloneBase::Id  cloneId 
) const

Searches for and gets the ReceiveClone object with the specified ID.

Parameters
[in]sendStationIndexSpecifies the StationIndex of the sender with the SendClone.
[in]cloneIdSpecifies the ID of the ReceiveClone to search for.
Returns
Returns the ReceiveClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
SendClone* nn::pia::clone::CloneProtocol::SearchSendClone ( CloneBase::Id  cloneId)
inline

Searches for and gets the SendClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the SendClone to search for.
Returns
Returns the SendClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
const SendClone* nn::pia::clone::CloneProtocol::SearchSendClone ( CloneBase::Id  cloneId) const
inline

Searches for and gets the SendClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the SendClone to search for.
Returns
Returns the SendClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
SequentialSharingClone* nn::pia::clone::CloneProtocol::SearchSequentialSharingClone ( CloneBase::Id  cloneId)
inline

Searches for and gets the SequentialSharingClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the SequentialSharingClone to search for.
Returns
Returns the SequentialSharingClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
const SequentialSharingClone* nn::pia::clone::CloneProtocol::SearchSequentialSharingClone ( CloneBase::Id  cloneId) const
inline

Searches for and gets the SequentialSharingClone object with the specified ID.

Parameters
[in]cloneIdSpecifies the ID of the SequentialSharingClone to search for.
Returns
Returns the SequentialSharingClone with the specified ID. Returns NULL when an object with the specified ID cannot be found.
nn::Result nn::pia::clone::CloneProtocol::SetClockOverFlowSpanForDebug ( u32  span)

(For debugging.) Sets the time until the clock value overflows.

Sets the time from when synchronous communication starts until the clock value overflows.

This function is for debugging. Do not include it in retail products.

Parameters
[in]spanIf the Setting::ClockType is Setting::CLOCK_TYPE_RTC, this is the time (in seconds). If it is Setting::CLOCK_TYPE_FRAME, this is the number of frames.
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:
ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::clone::CloneProtocol::SetMaxSendDelay ( u16  maxSendDelay)

Sets the maximum time to defer the sending of data.

In some clone elements, you can specify whether to send data immediately after it is set, or to wait until there is other data to send. Even if you defer the sending, the data is sent by itself when the time specified here elapses. Deferring the sending of data can be expected to reduce the number of packets sent, but it takes longer for the data to arrive after it is set.

Parameters
[in]maxSendDelaySpecifies the maximum time to defer sending. The value is in milliseconds. The maximum value that can be specified is 10000.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

See also
GetMaxSendDelay
nn::Result nn::pia::clone::CloneProtocol::SetProfiler ( CloneProfilerBase pSendProfiler,
CloneProfilerBase pReceiveProfiler 
)

Sets an object to manage send/receive profiling.

CloneProtocol send/receive tasks can be profiled by configuring CloneProfiler. This calculation includes the data CloneProtocol actually sends through and receives from the communication pathway. In clone profiling, the data the local station sends and receives is included in the calculation, but this data is resolved in CloneProtocol and is not included in the CloneProtocol profiling calculations.

When compression is enabled, the compressed size is used in the calculation.

A CloneProfiler instance that is already configured can be released by specifying NULL in the arguments.

Parameters
[in]pSendProfilerSpecifies the CloneProfiler that manages the send profiling. Specify NULL if not necessary.
[in]pReceiveProfilerSpecifies 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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::SetResendSpanRatio ( f32  ratio)

Specifies the ratio of the resend interval for the base RTT obtained from profiling.

The default value of the ratio is 1.25. The resend interval is the value of (RTT * ratio). The maximum value of the resend interval is 2500 milliseconds.

Parameters
[in]ratioThe ratio of the resend interval for the base RTT obtained from profiling Specify a value larger than 0.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::Start ( )

Starts operation of CloneProtocol.

This function can be called when the operational state is STATE_INACTIVE after communication starts. When this function succeeds, the object state changes to STATE_START and begins the startup process, after which it transitions to STATE_ACTIVE. After calling this function, you must periodically call the UpdateClock function.

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:
ResultInvalidState Indicates that the station is not communicating or the state is not STATE_INACTIVE. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::clone::CloneProtocol::Stop ( )

Stops operation of CloneProtocol.

When this function is called while the operational state is STATE_START or STATE_ACTIVE, the state changes to STATE_STOP and then to STATE_INACTIVE after finalization is complete. You must continue to call the UpdateClock function while the state is STATE_STOP. This function does nothing if called while the state is STATE_INACTIVE or STATE_STOP.

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:
ResultInvalidState Indicates that communication is not active. Programming error. Fix your program so that this error is not returned.
virtual void nn::pia::clone::CloneProtocol::Trace ( u64  flag) const
virtual

Prints information that is useful for debugging.

Parameters
[in]flagSpecifies the bitwise OR of trace flags. For more information, see the TraceFlag type.

Reimplemented from nn::pia::transport::Protocol.

nn::Result nn::pia::clone::CloneProtocol::UnregisterAtomicSharingClone ( AtomicSharingClone pClone)
inline

Unregisters a AtomicSharingClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, pClone cannot be reused or re-registered to the same ID until pClone->IsRegisteredWithProtocol returns false. (The object may send without acquiring a lock for other reasons, for example when serving as a proxy when a station is improperly disconnected.)

Parameters
[in]pCloneSpecifies the AtomicSharingClone to unregister.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. The specified AtomicSharingClone is not registered to this CloneProtocol. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterAtomicSharingClone ( CloneBase::Id  cloneId)
inline

Unregisters a AtomicSharingClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, AtomicSharingClone cannot be reused or reregistered to the same ID until AtomicSharingClone::IsRegisteredWithProtocol returns false. (The object may send without acquiring a lock for other reasons, for example when serving as a proxy when a station is improperly disconnected.)

Parameters
[in]cloneIdSpecifies the ID of the AtomicSharingClone to unregister.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultNotSet Indicates that the object is not registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterReceiveClone ( ReceiveClone pClone)
inline

Unregisters a ReceiveClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, pClone cannot be reused or re-registered to the same ID until pClone->IsRegisteredWithProtocol returns false. (ReceiveClone may also send for other reasons, for example when serving as a proxy when a station is improperly disconnected.)

Parameters
[in]pCloneSpecifies the ReceiveClone to unregister.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. The specified ReceiveClone is not registered to this CloneProtocol. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterReceiveClone ( StationIndex  sendStationIndex,
CloneBase::Id  cloneId 
)

Unregisters a ReceiveClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, ReceiveClone cannot be reused or reregistered to the same ID until ReceiveClone::IsRegisteredWithProtocol returns false. (ReceiveClone may also send for other reasons, for example when serving as a proxy when a station is improperly disconnected.)

Parameters
[in]sendStationIndexSpecifies the StationIndex of the sender with the SendClone.
[in]cloneIdSpecifies the ID of the ReceiveClone to unregister.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

ResultNotSet Indicates that the object is not registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterSendClone ( SendClone pClone)
inline

Unregisters a SendClone.

If a send is in progress, this function waits until the send is complete before unregistering. Therefore, even if this function succeeds, pClone cannot be reused or re-registered to the same ID until pClone->IsRegisteredWithProtocol returns false.

Parameters
[in]pCloneSpecifies the SendClone to unregister.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. The specified SendClone is not registered to this CloneProtocol. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterSendClone ( CloneBase::Id  cloneId)
inline

Unregisters a SendClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, SendClone cannot be reused or reregistered to the same ID until SendClone::IsRegisteredWithProtocol returns false.

Parameters
[in]cloneIdSpecifies the ID of the SendClone to unregister.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultNotSet Indicates that the object is not registered to the specified ID. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterSequentialSharingClone ( SequentialSharingClone pClone)
inline

Unregisters a SequentialSharingClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, pClone cannot be reused or re-registered to the same ID until pClone->IsRegisteredWithProtocol returns false.

Parameters
[in]pCloneSpecifies the SequentialSharingClone to unregister.
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:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidArgument Indicates that an argument is invalid. The specified AtomicSharingClone is not registered to this CloneProtocol. Programming error. Fix your program so that this error is not returned.

nn::Result nn::pia::clone::CloneProtocol::UnregisterSequentialSharingClone ( CloneBase::Id  cloneId)
inline

Unregisters a SequentialSharingClone.

If a send is in progress, this function waits until the send is complete before unregistering. Even if this function succeeds, SequentialSharingClone cannot be reused or reregistered to the same ID until SequentialSharingClone::IsRegisteredWithProtocol returns false.

Parameters
[in]cloneIdSpecifies the ID of the SequentialSharingClone to unregister.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultNotInitialized Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultNotSet Indicates that the object is not registered to the specified ID. Programming error. Fix your program so that this error is not returned.

void nn::pia::clone::CloneProtocol::UpdateClock ( )

Advances the clock by one frame.

The clock managed by CloneProtocol only advances when this function is called. Be sure to call this function periodically while the operational state is either STATE_START, STATE_ACTIVE, or STATE_STOP. Set the amount each call advances the clock in the Setting object that is specified when calling the Initialize function. If the interval between calls is shorter than the precision of the clock value, the clock may stay the same but it never goes backward.

See also
GetClock