CTR Pia
4.11.3
Game Communication Engine
|
This is the base class for managing sending and receiving.
.
More...
Public Types | |
typedef u32 | Id |
Specifies the type of the ID for identifying clones. | |
Public Member Functions | |
virtual | ~CloneBase () |
Destroys the object. | |
Id | GetId () const |
Gets the ID. More... | |
const CloneProtocol * | GetProtocol () const |
Gets the CloneProtocol this object is registered to. More... | |
bool | IsActive () const |
Determines whether this object is active. More... | |
bool | IsRegisteredWithProtocol () const |
Determines whether the object is registered with CloneProtocol . More... | |
nn::Result | RegisterElement (CloneElementBase *pElement, CloneElementBase::Id elementId) |
Registers a clone element. More... | |
CloneElementBase * | SearchElement (CloneElementBase::Id elementId) |
Searches for the clone element of the specified ID. More... | |
const CloneElementBase * | SearchElement (CloneElementBase::Id elementId) const |
Searches for the clone element of the specified ID. More... | |
nn::Result | UnregisterElement (CloneElementBase *pElement) |
Unregisters a clone element. More... | |
nn::Result | UnregisterElement (CloneElementBase::Id elementId) |
Unregisters a clone element. 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... | |
This is the base class for managing sending and receiving.
.
2013-11-25 Added a profiling feature.
2013-07-18 Initial version.
|
inline |
Gets the ID.
CloneProtocol
. Returns 0
if not registered with CloneProtocol
. u32 nn::pia::clone::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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 CloneProtocol
this object is registered to.
CloneProtocol
this object is registered to.
|
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 |
Determines whether this object is active.
An object is treated as active when it is registered with CloneProtocol
and can actually send and receive data. An object is not active when it is in the process of being registered or unregistered with CloneProtocol
, or when CloneProtocol
is starting up or being finalized.
true
if active.
|
inline |
Determines whether the object is registered with CloneProtocol
.
true
if it is registered with CloneProtocol
. nn::Result nn::pia::clone::CloneBase::RegisterElement | ( | CloneElementBase * | pElement, |
CloneElementBase::Id | elementId | ||
) |
Registers a clone element.
This function must be called while the object is not registered with CloneProtocol
.
[in] | pElement | Specifies the clone element to register. |
[in] | elementId | Specifies the ID of the clone element to register. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. ResultInvalidState
Indicates that this object is already registered with CloneProtocol
. 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 a clone element is already registered to the specified ID. Programming error. Fix your program so that this error is not returned.
void nn::pia::clone::CloneBase::ResetProfiler | ( | ) |
Resets the results of send/receive profiling.
|
inline |
Searches for the clone element of the specified ID.
[in] | elementId | Specifies the clone element to search for. |
NULL
if it does not exist.
|
inline |
Searches for the clone element of the specified ID.
[in] | elementId | Specifies the clone element to search for. |
NULL
if it does not exist. nn::Result nn::pia::clone::CloneBase::SetProfiler | ( | CloneProfilerBase * | pSendProfiler, |
CloneProfilerBase * | pReceiveProfiler | ||
) |
Sets an object to manage send/receive profiling.
Send/receive tasks carried out by registered clone elements and clones themselves can be profiled by configuring CloneProfiler
. This calculation includes all exchanges of data between this clone and other clones, so the data exchanges between clones on the local station are also included in the value.
When multiple clone elements are sending data at the same time, it gets calculated on a per-clone basis. In most cases, the total send/receive count of the clones is less than that of the clone elements.
When compression is enabled, the compressed size is used in the calculation. For this reason, calculations may result in a value that is small relative to the total amount of data sent or received that was measured for registered clone elements.
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. ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.nn::Result nn::pia::clone::CloneBase::UnregisterElement | ( | CloneElementBase * | pElement | ) |
Unregisters a clone element.
This function must be called while the object is not registered with CloneProtocol
.
[in] | pElement | Specifies the clone element 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. ResultInvalidState
Indicates that this object is already registered with CloneProtocol
. 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::CloneBase::UnregisterElement | ( | CloneElementBase::Id | elementId | ) |
Unregisters a clone element.
This function must be called while the object is not registered with CloneProtocol
.
[in] | elementId | Specifies the ID of the clone element 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. ResultInvalidState
Indicates that this object is already registered with CloneProtocol
. Programming error. Fix your program so that this error is not returned.
ResultNotSet
Indicates that a clone element is not registered to the specified ID. Programming error. Fix your program so that this error is not returned.