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

This is the base class for managing sending and receiving.
. More...

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

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 CloneProtocolGetProtocol () 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...
 
CloneElementBaseSearchElement (CloneElementBase::Id elementId)
 Searches for the clone element of the specified ID. More...
 
const CloneElementBaseSearchElement (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 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...
 

Detailed Description

This is the base class for managing sending and receiving.
.

Revision History:

2013-11-25 Added a profiling feature.

2013-07-18 Initial version.

Member Function Documentation

Id nn::pia::clone::CloneBase::GetId ( ) const
inline

Gets the ID.

Returns
Returns the ID specified when registering the object with 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.

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::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.

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::CloneBase::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::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.

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::CloneBase::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::CloneBase::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::CloneBase::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::CloneBase::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 CloneProtocol* nn::pia::clone::CloneBase::GetProtocol ( ) const
inline

Gets the CloneProtocol this object is registered to.

Returns
Returns the CloneProtocol this object is registered to.
const CloneProfilerBase* nn::pia::clone::CloneBase::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::CloneBase::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
bool nn::pia::clone::CloneBase::IsActive ( ) const
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.

Returns
Returns true if active.
bool nn::pia::clone::CloneBase::IsRegisteredWithProtocol ( ) const
inline

Determines whether the object is registered with CloneProtocol.

Returns
Returns 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.

Parameters
[in]pElementSpecifies the clone element to register.
[in]elementIdSpecifies the ID of the clone element to register.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

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.

See also
SetProfiler
CloneElementBase* nn::pia::clone::CloneBase::SearchElement ( CloneElementBase::Id  elementId)
inline

Searches for the clone element of the specified ID.

Parameters
[in]elementIdSpecifies the clone element to search for.
Returns
Returns the clone element with the specified ID. Returns NULL if it does not exist.
const CloneElementBase* nn::pia::clone::CloneBase::SearchElement ( CloneElementBase::Id  elementId) const
inline

Searches for the clone element of the specified ID.

Parameters
[in]elementIdSpecifies the clone element to search for.
Returns
Returns the clone element with the specified ID. Returns 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.

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:
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.

Parameters
[in]pElementSpecifies the clone element 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:

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.

Parameters
[in]elementIdSpecifies the ID of the clone element 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:

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.