Kaim::VisualDebugClient Class Reference

Kaim::VisualDebugClient Class Reference

#include <visualdebugclient.h>

Class Description

The VisualDebugClient class manages the retrieval of data from a VisualDebugServer running in the game engine.

This class is used internally by the NavigationLab. It can be used to integrate the visualization of debug data into your level editing or debugging tools. It has 4 exclusive modes:

  • Listening for available servers (broadcast)
  • Connected to a server
  • Writing to file
  • Reading from file If KY_BUILD_SHIPPING is defined this class is empty.

Public Types

enum  RunMode { RunSynchronously = 0, RunAsynchronously = 1 }
 

Main API

 VisualDebugClient ()
 
 ~VisualDebugClient ()
 
KyResult SetupReceiverRegistry (MessageReceiverRegistry &receiverRegistry)
 
static KyUInt32 GetInfiniteWaitDelay ()
 

Server Connection Mode

KyResult ConnectToServer (const char *ipAddress, KyUInt32 port, RunMode runMode=RunSynchronously)
 
void CloseConnection ()
 
bool IsConnected () const
 
bool IsConnectionEstablished () const
 
bool IsReceptionPipelineEmpty ()
 
KyResult Update ()
 
template<class T >
KyResult Send (BaseBlobBuilder< T > &blobBuilder)
 
KyResult SendEndOfSynchronization ()
 
KyResult Send (Kaim::BaseBlobHandler &blobHandler)
 
KyResult SendFlatBlob (KyUInt32 blobtypeId, KyUInt32 size, char *blob)
 
KyResult Send (IQuery *query)
 
bool WaitWhileEstablishingConnection (KyUInt32 maxDelayMilliseconds)
 

Broadcast Mode

void StartListeningForAvailableServers (KyUInt32 port, RunMode runMode=RunAsynchronously)
 
void ListenForAvailableServers ()
 
void GetAvailableServers (KyArray< Ptr< Net::AMP::MessagePort > > &availableServers)
 
void StopListeningForAvailableServers ()
 

File Modes

KyResult ReadFromFile (const char *readFromFile, Kaim::FileOpenerBase *fileOpener, RunMode runMode=RunSynchronously)
 
KyResult WriteToFile (const char *writeToFile, Kaim::FileOpenerBase *fileOpener, VisualDebugClientScopedFileWriter &writer, RunMode runMode=RunSynchronously)
 

For internal use only

Net::AMP::ThreadMgr * GetThreadMgr ()
 
const Net::AMP::ThreadMgr * GetThreadMgr () const
 
MemoryHeap * GetHeap ()
 
void WaitForEmptiedSendQueue ()
 
RunMode GetRunMode () const
 
File * GetFile ()
 

Member Enumeration Documentation

Enumerated the running mode of the VisualDebugClient.

Enumerator
RunSynchronously 

Operations are done in the main thread.

RunAsynchronously 

Operations are made in separate threads.

Member Function Documentation

void Kaim::VisualDebugClient::CloseConnection ( )

Closes the current network socket connection, if any.

KyResult Kaim::VisualDebugClient::ConnectToServer ( const char *  ipAddress,
KyUInt32  port,
RunMode  runMode = RunSynchronously 
)

Initiates a new connection to the VisualDebugServer listening on the specified host and port.

Parameters
ipAddressThe IP address or network name of the host running the VisualDebugServer.
portThe network port configured for use by the VisualDebugServer.
runModeone theRunMode enumeration.
Returns
A KyResult that indicates the success or failure of the request.
static KyUInt32 Kaim::VisualDebugClient::GetInfiniteWaitDelay ( )
inlinestatic

Defines a special value that can be passed to WaitWhileEstablishingConnection to block execution in the calling thread until the connection is established.

bool Kaim::VisualDebugClient::IsConnected ( ) const

Indicates whether the VisualDebugClient is connected and SendEndOfSynchronization was called.

bool Kaim::VisualDebugClient::IsConnectionEstablished ( ) const

Indicates whether ThreadMgr has established a connection.

bool Kaim::VisualDebugClient::IsReceptionPipelineEmpty ( )
inline

Check if everything was received.

KyResult Kaim::VisualDebugClient::SendEndOfSynchronization ( )

Must be send after having sent or received data for synchronization.

Otherwise, the server will be in syncing state for ever, never being seen has fully connected

KyResult Kaim::VisualDebugClient::SendFlatBlob ( KyUInt32  blobtypeId,
KyUInt32  size,
char *  blob 
)

Sends a flat blob (with no Array inside).

The blob must be in the local platform endianness. (swap will be done internally when writing data to the socket).

KyResult Kaim::VisualDebugClient::SetupReceiverRegistry ( MessageReceiverRegistry &  receiverRegistry)

Setup the internal receiver registry.

void Kaim::VisualDebugClient::StartListeningForAvailableServers ( KyUInt32  port,
RunMode  runMode = RunAsynchronously 
)

RunAsynchronously is highly recommended to run this in a seperated thread because listening for Wii U servers is slow since it is not made via a real broadcasting.

KyResult Kaim::VisualDebugClient::Update ( )

Receives all messages since the last call to Update(), and processes them by calling the receivers set up for the MessageReceiverRegistry.

bool Kaim::VisualDebugClient::WaitWhileEstablishingConnection ( KyUInt32  maxDelayMilliseconds)

For internal use.


The documentation for this class was generated from the following file: