Katana Plug-in APIs 0.1
Public Member Functions | Static Public Member Functions

Foundry::Katana::KatanaPipe Class Reference

The KatanaPipe is used to send messages to the specified Katana Catalog Server. More...

#include <KatanaPipe.h>

List of all members.

Public Member Functions

 KatanaPipe (const std::string &hostName, unsigned int portNumber, size_t maxQueueSize, int linger=-1)
 Create a new instance of the KatanaPipe which will be connected to the specified host name and port number.
 ~KatanaPipe ()
 Destroy this Katana Pipe.
int connect ()
 Initiate the connection to the end-point specified by the host name and port number provided at construction.
int send (const Message &message)
 Send a message to the end-point this pipe is connected to.
void flushPipe (const NewChannelMessage &channel)
 This is an important synchronisation function that you should called when your renderer has sent all image data to the driver for a given channel.
void closeChannel (const NewChannelMessage &channel)
 This is an important function that you should call from your driver when there is no more data to be sent for this channel, ever.

Static Public Member Functions

static FnPlugStatus setHost (FnPluginHost *host)
 Set the Display Driver Host to delegate all communication details to the suite.
static const
FnDisplayDriverHostSuite_v1
getSuite ()
 Get the Display Driver host suite for communication pipes. If invalid, an error message is output to the standard error stream.

Detailed Description

The KatanaPipe is used to send messages to the specified Katana Catalog Server.

It is a uni-directional communication pipe that allows a message to be sent to the end-point specified in the constructor. The end-point will usually be Katana however any process implementing the Render Data Protocol could serve as the end-point.

Very important The pipe is not thread safe. If you require communication capabilities from more than a single thread you should create an instance of the KatanaPipe for each thread however you should find this is not necessary.


Constructor & Destructor Documentation

Foundry::Katana::KatanaPipe::KatanaPipe ( const std::string &  hostName,
unsigned int  portNumber,
size_t  maxQueueSize,
int  linger = -1 
)

Create a new instance of the KatanaPipe which will be connected to the specified host name and port number.

The constructor will not attempt to create the actual connection to the specified host name and port number. To do this you must call connect()

Parameters:
[in]hostNamea host name that specifies the end point to be connected to. This must be network visible from the host you are connecting from.
[in]portNumberthe TCP port which the end-point on the specified hostName is listening for messages on.
[in]maxQueueSizethe maximum number of messages we can store in the outgoing thread safe queue and control queue.
[in]lingerthe linger period (in milliseconds) for socket shutdown. Default is -1 (infinite).
See also:
connect()
Foundry::Katana::KatanaPipe::~KatanaPipe ( )

Destroy this Katana Pipe.

This will close the connection to the end-point, any unsent messages in the buffer will be sent.


Member Function Documentation

void Foundry::Katana::KatanaPipe::closeChannel ( const NewChannelMessage channel)

This is an important function that you should call from your driver when there is no more data to be sent for this channel, ever.

Once this message has been sent Katana will ignore any further image data.

int Foundry::Katana::KatanaPipe::connect ( )

Initiate the connection to the end-point specified by the host name and port number provided at construction.

connect() must be called before any messages are sent. Calling connect() after the pipe has been connected will not have any effect.

Returns:
0 if the pipe connects successfully to the end-point otherwise nonzero.
void Foundry::Katana::KatanaPipe::flushPipe ( const NewChannelMessage channel)

This is an important synchronisation function that you should called when your renderer has sent all image data to the driver for a given channel.

It will block until all data has been cleared from this end of the pipe.

static const FnDisplayDriverHostSuite_v1* Foundry::Katana::KatanaPipe::getSuite ( ) [static]

Get the Display Driver host suite for communication pipes. If invalid, an error message is output to the standard error stream.

Returns:
the Display Driver host suite.
int Foundry::Katana::KatanaPipe::send ( const Message message)

Send a message to the end-point this pipe is connected to.

send() pushes a message down the pipe to the end-point this pipe is connected to. send() ensures the message is either sent in its entirety or not at all.

Parameters:
[in]messagethe message to be send.
Returns:
0 if the message is sent successfully - otherwise nonzero.
static FnPlugStatus Foundry::Katana::KatanaPipe::setHost ( FnPluginHost host) [static]

Set the Display Driver Host to delegate all communication details to the suite.

The KatanaPipeSingleton bootstraps and sets the host suite, and is recommended to initialize a communication pipe.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator