CTR Pia  4.11.3
Game Communication Engine
nn::pia::common::Watermark Class Reference

Contains member functions for profiling things like peak values in the Pia library's resource usage (unsupported). More...

+ Inheritance diagram for nn::pia::common::Watermark:

Public Member Functions

 Watermark (void)
 Instantiates the object with default parameters (default constructor). The instance is constructed with Update functionality disabled.
 
 ~Watermark (void)
 Destroys the object.
 
void DisableUpdate (void)
 Disables updating values with Update. More...
 
void EnableUpdate (void)
 Enables updating values with the Update function. More...
 
s64 GetLatestValue (void) const
 Gets the update value passed in the last call to Update. More...
 
s64 GetMaxValue (void) const
 Gets the maximum value currently being used by Update. More...
 
s64 GetMinValue (void) const
 Gets the minimum value currently being used by Update. More...
 
const char * GetName (void) const
 Gets the name of an instance. More...
 
s64 GetUpdateCount (void) const
 Gets the number of times Update has been called so far. More...
 
bool IsUpdateEnabled (void) const
 Returns whether Update functionality is enabled. More...
 
void Reset (void)
 Re-initializes the values maintained by the instance (maximum, minimum, updated values, and the number of calls to Update). More...
 
void SetName (const char *pName)
 Sets a name for the instance. More...
 
void Trace (u64 flag) const
 Prints information useful for debugging. More...
 
void Update (s64 value)
 Updates the value. More...
 

Static Public Attributes

static const size_t MAX_NAME_LENGTH = 63
 Specifies the maximum length of a name that can be set using the SetName function. More...
 

Detailed Description

Contains member functions for profiling things like peak values in the Pia library's resource usage (unsupported).


Revision History:
2012-04-04 Initial version.

Member Function Documentation

void nn::pia::common::Watermark::DisableUpdate ( void  )
inline

Disables updating values with Update.

If updating is disabled, these values (the minimum, maximum, updated value, and number of calls to the Update function) are not updated even if you call Update.

See also
EnableUpdate, IsUpdateEnabled
void nn::pia::common::Watermark::EnableUpdate ( void  )
inline

Enables updating values with the Update function.

If you call Update while updating is enabled, minimum and maximum values are updated as necessary, values that can be retrieved with GetLatestValue are updated, and the counter that tracks the number of calls to Update is incremented.

See also
DisableUpdate, IsUpdateEnabled
s64 nn::pia::common::Watermark::GetLatestValue ( void  ) const
inline

Gets the update value passed in the last call to Update.

See also
Update, GetMinValue, GetMaxValue, GetUpdateCount
s64 nn::pia::common::Watermark::GetMaxValue ( void  ) const
inline

Gets the maximum value currently being used by Update.

See also
Update, GetMinValue, GetLatestValue, GetUpdateCount
s64 nn::pia::common::Watermark::GetMinValue ( void  ) const
inline

Gets the minimum value currently being used by Update.

See also
Update, GetMaxValue, GetLatestValue, GetUpdateCount
const char* nn::pia::common::Watermark::GetName ( void  ) const
inline

Gets the name of an instance.

Returns
Returns a pointer to the character array storing the name.
See also
SetName
s64 nn::pia::common::Watermark::GetUpdateCount ( void  ) const
inline

Gets the number of times Update has been called so far.

See also
Update, GetMaxValue, GetMinValue, GetLatestValue
bool nn::pia::common::Watermark::IsUpdateEnabled ( void  ) const
inline

Returns whether Update functionality is enabled.

Returns
Returns true if updating values with Update is enabled; returns false otherwise.
See also
EnableUpdate, DisableUpdate
void nn::pia::common::Watermark::Reset ( void  )

Re-initializes the values maintained by the instance (maximum, minimum, updated values, and the number of calls to Update).

Calling this function does not change the name set using SetName or change whether Update functionality is enabled or disabled.

See also
SetName, EnableUpdate, DisableUpdate, IsUpdateEnabled
void nn::pia::common::Watermark::SetName ( const char *  pName)

Sets a name for the instance.

Parameters
[in]pNameSpecifies the name to set. The specified string must be NULL-terminated and no longer than MAX_NAME_LENGTH. The function asserts if an invalid pointer is specified or the name is too long.
See also
GetName
void nn::pia::common::Watermark::Trace ( u64  flag) const

Prints information useful for debugging.

Parameters
[in]flagSpecifies the bitwise OR of trace flags. For more information, see the TraceFlag type.
void nn::pia::common::Watermark::Update ( s64  value)

Updates the value.

If you call this function while Update functionality is enabled, the values being used so far for the maximum, minimum, update value, and number of calls to Update are all updated appropriately. If you call this function while Update functionality is disabled, it does nothing and returns.

Parameters
[in]valueSpecifies the value being monitored.
See also
EnableUpdate, DisableUpdate, IsUpdateEnabled, GetMaxValue, GetMinValue, GetLatestValue, GetUpdateCount

Member Data Documentation

const size_t nn::pia::common::Watermark::MAX_NAME_LENGTH = 63
static

Specifies the maximum length of a name that can be set using the SetName function.

See also
SetName