CTR Pia  4.11.3
Game Communication Engine
nn::pia::transport::StationManager Class Reference

Represents a class for unifying multiple Station instances. More...

+ Inheritance diagram for nn::pia::transport::StationManager:

Classes

class  ConstIterator
 Represents an iterator for referring to the Stations participating in a session (const version). More...
 
class  Iterator
 Represents an iterator for referring to the Stations participating in a session (non-const version). More...
 

Public Member Functions

Iterator Begin (void)
 Returns the iterator of the Station instance (non-const version). More...
 
ConstIterator Begin (void) const
 Returns the iterator of the Station instance ( const version). More...
 
Iterator End (void)
 Returns the iterator of the Station instance (non-const version). More...
 
ConstIterator End (void) const
 Returns the iterator of the Station instance ( const version). More...
 
StationGetLocalStation (void)
 Gets the local station (non-const version). More...
 
const StationGetLocalStation (void) const
 Gets the local station ( const version). More...
 
StationGetStation (StationId id)
 Gets the Station corresponding to the StationId (non-const version). More...
 
const StationGetStation (StationId id) const
 Gets the Station corresponding to the StationId ( const version). More...
 
StationGetStation (const common::StationAddress &addr)
 Gets the Station corresponding to the StationAddress (non-const version). More...
 
const StationGetStation (const common::StationAddress &addr) const
 Gets the Station corresponding to the StationAddress ( const version). More...
 
nn::Result GetStationAddress (common::StationAddress *pAddr, StationId id) const
 Gets the StationAddress for the Station corresponding to the StationId. More...
 
StationGetStationByAddress (const common::InetAddress &addr)
 Gets the station with the specified Internet address (non-const version). More...
 
const StationGetStationByAddress (const common::InetAddress &addr) const
 Gets the Station corresponding to the Internet address ( const version). More...
 
virtual void Trace (u64 flag) const
 Prints information that is useful for debugging. More...
 

Static Public Member Functions

static nn::Result CreateInstance (void)
 Creates the StationManager class instance (singleton pattern). More...
 
static void DestroyInstance (void)
 Destroys the StationManager class instance (singleton pattern). More...
 
static StationManagerGetInstance (void)
 Gets the StationManager class instance (singleton pattern). This function returns a NULL pointer if the instance has not yet been created using the CreateInstance function. This function is thread-safe. More...
 

Detailed Description

Represents a class for unifying multiple Station instances.

The Transport class constructs and destroys the StationManager instance. There is no need for the application to call the CreateInstance or DestroyInstance functions of the StationManager class.

Revision History:

2014-09-18 Changed the specifications so that ResultAlreadyExists is returned if you call CreateInstance when an instance already exists.

2014-07-15 Changed how the GetStationAddress and GetStation functions operate when they are passed invalid arguments.

2012-06-28 Clearly indicated which functions are thread-safe.

2012-04-06 Initial version.

Member Function Documentation

Iterator nn::pia::transport::StationManager::Begin ( void  )
inline

Returns the iterator of the Station instance (non-const version).

Returns
Returns the iterator for the first element of Station instances managed by StationManager.
See also
End
ConstIterator nn::pia::transport::StationManager::Begin ( void  ) const
inline

Returns the iterator of the Station instance ( const version).

Returns
Returns the iterator for the first element of Station instances managed by StationManager.
See also
End
static nn::Result nn::pia::transport::StationManager::CreateInstance ( void  )
static

Creates the StationManager class instance (singleton pattern).

Returns
Returns a Result value that indicates success if the instance is created successfully.
Error Return Values:

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

ResultInvalidState Indicates that the timing at which the CreateInstance function was called is incorrect. Make this call between the BeginSetup and EndSetup functions. Programming error. Fix your program so that this error is not returned.

ResultAlreadyExists Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.

See also
DestroyInstance, GetInstance
static void nn::pia::transport::StationManager::DestroyInstance ( void  )
static

Destroys the StationManager class instance (singleton pattern).

See also
CreateInstance, GetInstance
Iterator nn::pia::transport::StationManager::End ( void  )
inline

Returns the iterator of the Station instance (non-const version).

Returns
Returns the iterator for the last element of Station instances managed by StationManager.
See also
Begin
ConstIterator nn::pia::transport::StationManager::End ( void  ) const
inline

Returns the iterator of the Station instance ( const version).

Returns
Returns the iterator for the last element of Station instances managed by StationManager.
See also
Begin
static StationManager* nn::pia::transport::StationManager::GetInstance ( void  )
inlinestatic

Gets the StationManager class instance (singleton pattern). This function returns a NULL pointer if the instance has not yet been created using the CreateInstance function. This function is thread-safe.

Returns
Returns a pointer to the instance.
See also
CreateInstance, DestroyInstance
Station* nn::pia::transport::StationManager::GetLocalStation ( void  )
inline

Gets the local station (non-const version).

This function is thread-safe.

Returns
Returns a valid pointer if a local station exists. If none exists, a NULL pointer is returned.
const Station* nn::pia::transport::StationManager::GetLocalStation ( void  ) const
inline

Gets the local station ( const version).

This function is thread-safe.

Returns
Returns a valid pointer if a local station exists. If none exists, a NULL pointer is returned.
Station* nn::pia::transport::StationManager::GetStation ( StationId  id)

Gets the Station corresponding to the StationId (non-const version).

Parameters
[in]idSpecifies the StationId.
Returns
If the Station corresponding to the specified StationId exists, a pointer to that Station is returned. A NULL pointer is returned if the StationId does not exist or is invalid.
See also
GetStationByAddress
const Station* nn::pia::transport::StationManager::GetStation ( StationId  id) const

Gets the Station corresponding to the StationId ( const version).

Parameters
[in]idSpecifies the StationId.
Returns
If the Station corresponding to the specified StationId exists, a pointer to that Station is returned. A NULL pointer is returned if the StationId does not exist or is invalid.
See also
GetStationByAddress
Station* nn::pia::transport::StationManager::GetStation ( const common::StationAddress addr)

Gets the Station corresponding to the StationAddress (non-const version).

Parameters
[in]addrSpecifies the station address.
Returns
If the Station with the specified station address exists, a pointer to that Station is returned. If none exists, a NULL pointer is returned.
See also
GetStationByAddress
const Station* nn::pia::transport::StationManager::GetStation ( const common::StationAddress addr) const

Gets the Station corresponding to the StationAddress ( const version).

Parameters
[in]addrSpecifies the station address.
Returns
If the Station with the specified station address exists, a pointer to that Station is returned. If none exists, a NULL pointer is returned.
See also
GetStationByAddress
nn::Result nn::pia::transport::StationManager::GetStationAddress ( common::StationAddress pAddr,
StationId  id 
) const

Gets the StationAddress for the Station corresponding to the StationId.

Parameters
[out]pAddrSpecifies a pointer to a StationAddress instance that will hold the result.
[in]idSpecifies the StationId.
Returns
Returns a Result value for which the IsSuccess function returns true if execution succeeds.
Error Return Values:

ResultInvalidArgument Specifies that one or more arguments are invalid. This Result is returned if the StationId is invalid. Programming error. Fix your program so that this error is not returned.

ResultNotFound Indicates that the Station specified in the arguments was not found. Handle appropriately in the application.

Station* nn::pia::transport::StationManager::GetStationByAddress ( const common::InetAddress addr)

Gets the station with the specified Internet address (non-const version).

Parameters
[in]addrSpecifies the Internet address.
Returns
If the Station corresponding to the specified Internet address exists, a pointer to that Station is returned. If none exists, a NULL pointer is returned.
Error Return Values:
ResultInvalidArgument Specifies that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
See also
GetStation
const Station* nn::pia::transport::StationManager::GetStationByAddress ( const common::InetAddress addr) const

Gets the Station corresponding to the Internet address ( const version).

Parameters
[in]addrSpecifies the Internet address.
Returns
If the Station corresponding to the specified Internet address exists, a pointer to that Station is returned. If none exists, a NULL pointer is returned.
Error Return Values:
ResultInvalidArgument Specifies that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
See also
GetStation
virtual void nn::pia::transport::StationManager::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.