CTR Pia
4.11.3
Game Communication Engine
|
Represents a protocol for sharing values between stations.
More...
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... | |
AtomicSharingClone * | SearchAtomicSharingClone (CloneBase::Id cloneId) |
Searches for and gets the AtomicSharingClone object with the specified ID. More... | |
const AtomicSharingClone * | SearchAtomicSharingClone (CloneBase::Id cloneId) const |
Searches for and gets the AtomicSharingClone object with the specified ID. More... | |
ReceiveClone * | SearchReceiveClone (StationIndex sendStationIndex, CloneBase::Id cloneId) |
Searches for and gets the ReceiveClone object with the specified ID. More... | |
const ReceiveClone * | SearchReceiveClone (StationIndex sendStationIndex, CloneBase::Id cloneId) const |
Searches for and gets the ReceiveClone object with the specified ID. More... | |
SendClone * | SearchSendClone (CloneBase::Id cloneId) |
Searches for and gets the SendClone object with the specified ID. More... | |
const SendClone * | SearchSendClone (CloneBase::Id cloneId) const |
Searches for and gets the SendClone object with the specified ID. More... | |
SequentialSharingClone * | SearchSequentialSharingClone (CloneBase::Id cloneId) |
Searches for and gets the SequentialSharingClone object with the specified ID. More... | |
const SequentialSharingClone * | SearchSequentialSharingClone (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 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... | |
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 . | |
Represents a protocol for sharing values between stations.
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.
typedef int(* nn::pia::clone::CloneProtocol::ClockPriorityJudgeFunction) (ClockValue clock, StationIndex stationA, StationIndex stationB) |
Compares the order.
[in] | clock | Specifies the time of the comparison. |
[in] | stationA | Specifies the StationIndex of a station to compare. |
[in] | stationB | Specifies the StationIndex of a station to compare. |
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.
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 |
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. |
void nn::pia::clone::CloneProtocol::Finalize | ( | ) |
Finalizes the class instance.
ClockValue nn::pia::clone::CloneProtocol::GetClock | ( | ) | const |
Gets the current clock.
INVALID_CLOCK
if a valid clock does not exist because, for example, the object is not active.
|
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.
SerializePolicy::GetSize
function of the clone element to be used.
|
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.
|
inline |
Gets the maximum time to defer the sending of data.
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.
[in] | stationIndex | The StationIndex that is subject to profiling. |
CloneProfiler::LATEST_BUFFER_SIZE
times common::Scheduler::Dispatch
was called. Returns 0
if no object is configured to manage receive profiling. 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.
[in] | stationIndex | The StationIndex that is subject to profiling. |
CloneProfiler::LATEST_BUFFER_SIZE
times of common::Scheduler::Dispatch
being called. Returns 0
if no object is configured to manage receive profiling. 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.
[in] | stationIndex | The StationIndex that is subject to profiling. |
CloneProfiler::LATEST_BUFFER_SIZE
times common::Scheduler::Dispatch
was called. Returns 0
if no object is configured to manage send profiling. 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.
[in] | stationIndex | The StationIndex that is subject to profiling. |
CloneProfiler::LATEST_BUFFER_SIZE
times of common::Scheduler::Dispatch
being called. Returns 0
if no object is configured to manage send profiling. u32 nn::pia::clone::CloneProtocol::GetProfiledTotalReceiveCount | ( | StationIndex | stationIndex | ) | const |
Gets the number of times received since ResetProfiler
was called.
[in] | stationIndex | The StationIndex that is subject to profiling. |
ResetProfiler
was called. Returns 0
if no object is configured to manage receive profiling. u32 nn::pia::clone::CloneProtocol::GetProfiledTotalReceiveSize | ( | StationIndex | stationIndex | ) | const |
Gets the amount of data, in bytes, received since ResetProfiler
was called.
[in] | stationIndex | The StationIndex that is subject to profiling. |
ResetProfiler
was called. Returns 0
if no object is configured to manage receive profiling. u32 nn::pia::clone::CloneProtocol::GetProfiledTotalSendCount | ( | StationIndex | stationIndex | ) | const |
Gets the number of times sent since ResetProfiler
was called.
[in] | stationIndex | The StationIndex that is subject to profiling. |
ResetProfiler
was called. Returns 0
if no object is configured to manage send profiling. u32 nn::pia::clone::CloneProtocol::GetProfiledTotalSendSize | ( | StationIndex | stationIndex | ) | const |
Gets the amount of data, in bytes, sent since ResetProfiler
was called.
[in] | stationIndex | The StationIndex that is subject to profiling. |
ResetProfiler
was called. Returns 0
if no object is configured to manage send profiling.
|
inline |
Gets the object configured to manage receive profiling.
NULL
if nothing has been set.
|
inline |
Gets the object configured to manage send profiling.
NULL
if nothing has been set.
|
inline |
Gets the current operational state.
nn::Result nn::pia::clone::CloneProtocol::Initialize | ( | const Setting & | setting | ) |
Initialization. Make this call between the BeginSetup
and EndSetup
functions.
[in] | setting | Specifies various settings. Specify the same values on all stations. Operations are undefined when different values are specified. |
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. 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.
bool nn::pia::clone::CloneProtocol::IsActiveStation | ( | StationId | stationId | ) | const |
Determines whether the CloneProtocol
of the specified station is active.
[in] | stationId | Specifies the StationId of the station to be checked if active. |
true
if the specified station is active. bool nn::pia::clone::CloneProtocol::IsRegulatingClock | ( | ) | const |
Gets whether the clock is being regulated.
true
if the clock is being regulated..
|
inline |
Registers a AtomicSharingClone
to the specified ID.
[in] | pClone | Specifies the AtomicSharingClone to register. |
[in] | cloneId | Specifies the ID to register to. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
[in] | pClone | Specifies the ReceiveClone to register. |
[in] | sendStationIndex | Specifies the StationIndex of the sender with the SendClone . |
[in] | cloneId | Specifies the ID to register to. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
|
inline |
Registers a SendClone
to the specified ID.
[in] | pClone | Specifies the SendClone to register. |
[in] | cloneId | Specifies the ID to register to. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
|
inline |
Registers a SequentialSharingClone
to the specified ID.
[in] | pClone | Specifies the SequentialSharingClone to register. |
[in] | cloneId | Specifies the ID to register to. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
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. 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. void nn::pia::clone::CloneProtocol::ResetProfiler | ( | ) |
Resets the results of send/receive profiling.
|
inline |
Searches for and gets the AtomicSharingClone
object with the specified ID.
[in] | cloneId | Specifies the ID of the AtomicSharingClone to search for. |
AtomicSharingClone
with the specified ID. Returns NULL
when an object with the specified ID cannot be found.
|
inline |
Searches for and gets the AtomicSharingClone
object with the specified ID.
[in] | cloneId | Specifies the ID of the AtomicSharingClone to search for. |
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.
[in] | sendStationIndex | Specifies the StationIndex of the sender with the SendClone . |
[in] | cloneId | Specifies the ID of the ReceiveClone to search for. |
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.
[in] | sendStationIndex | Specifies the StationIndex of the sender with the SendClone . |
[in] | cloneId | Specifies the ID of the ReceiveClone to search for. |
ReceiveClone
with the specified ID. Returns NULL
when an object with the specified ID cannot be found.
|
inline |
|
inline |
|
inline |
Searches for and gets the SequentialSharingClone
object with the specified ID.
[in] | cloneId | Specifies the ID of the SequentialSharingClone to search for. |
SequentialSharingClone
with the specified ID. Returns NULL
when an object with the specified ID cannot be found.
|
inline |
Searches for and gets the SequentialSharingClone
object with the specified ID.
[in] | cloneId | Specifies the ID of the SequentialSharingClone to search for. |
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.
[in] | span | If 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. |
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. 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.
[in] | maxSendDelay | Specifies the maximum time to defer sending. The value is in milliseconds. The maximum value that can be specified is 10000 . |
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. 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::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.
[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. |
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. 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.
[in] | ratio | The ratio of the resend interval for the base RTT obtained from profiling Specify a value larger than 0 . |
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. 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.
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. 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
.
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. ResultInvalidState
Indicates that communication is not active. Programming error. Fix your program so that this error is not returned.
|
virtual |
Prints information that is useful for debugging.
[in] | flag | Specifies the bitwise OR of trace flags. For more information, see the TraceFlag type. |
Reimplemented from nn::pia::transport::Protocol.
|
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.)
[in] | pClone | Specifies the AtomicSharingClone to unregister. |
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. 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.
|
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.)
[in] | cloneId | Specifies the ID of the AtomicSharingClone to unregister. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
|
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.)
[in] | pClone | Specifies the ReceiveClone to unregister. |
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. 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.)
[in] | sendStationIndex | Specifies the StationIndex of the sender with the SendClone . |
[in] | cloneId | Specifies the ID of the ReceiveClone to unregister. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
|
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
.
[in] | pClone | Specifies the SendClone to unregister. |
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. 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.
|
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
.
[in] | cloneId | Specifies the ID of the SendClone to unregister. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.
|
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
.
[in] | pClone | Specifies the SequentialSharingClone to unregister. |
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. 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.
|
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
.
[in] | cloneId | Specifies the ID of the SequentialSharingClone to unregister. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. 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.