RenderMan  26.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RixDspy.h File Reference
#include "RixInterfaces.h"
#include "ndspy.h"

Go to the source code of this file.

Classes

class  RixDspyServer
 
class  RixDspy
 

Enumerations

enum  RixDeliveryMode { k_RixImmediate, k_RixQueued }
 The RixDspy interface provides access to dspy components accessible through librix rather than libprman.so. More...
 

Enumeration Type Documentation

The RixDspy interface provides access to dspy components accessible through librix rather than libprman.so.

RixContext* context = context->RixGetContext();
RixDspy* m_dspy = (RixDspy*) context->GetRixInterface(k_RixDspy);
// "mydriver" is the name on the Display call in the RIB, pTable contains
// the standard dspy driver entry points.
m_dspy->RegisterDriverTable("mydriver", pTable);
// You must set the mode to Queued
// via some other IPC we have been given the fifo names that prman is
// going to use to talk to the dspy server that we are implementing. We
// will need one of these per render.
RixDspyServer *ds = m_dspy->CreateServer(in.c_str(), out.c_str());
// since the messages are queued we are responsible to calling
// ProcessCallbacks, this will deliver calls back out into the driver(s)
// we registered
void
onIdle(void)
{
m_dspy->ProcessCallbacks();
}
// clean up the server once it's completed.
if (ds-> GetState() == RixDspyServer::k_DoneServing)
{
delete ds;
}

For an alternative style of programming the client may register interest in the state changes of the server. Users should be aware of the fact that RixDspy::CreateServer creates a thread to perform its work, and that the observer is called from that thread:

RixDspyServer *ds = m_dspy->CreateServer(in, out, observerCB, client);
void
observerCB(RixDspyServer const& server, void* clientData)
{
switch(server->GetState())
{
dealWithServerStop();
break;
default:
break;
}
}
Enumerator
k_RixImmediate 
k_RixQueued