Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::StreamBackend Class Reference

Network processing communication backend. More...

#include <mitsuba/core/sched_remote.h>

+ Inheritance diagram for mitsuba::StreamBackend:

Public Member Functions

 StreamBackend (const std::string &name, Scheduler *scheduler, const std::string &nodeName, Stream *stream, bool detach)
 Create a new stream backend. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::Thread
 Thread (const std::string &name)
 Create a new thread object. More...
 
bool setPriority (EThreadPriority priority)
 Set the thread priority. More...
 
EThreadPriority getPriority () const
 Return the thread priority. More...
 
void setCoreAffinity (int core)
 Set the core affinity. More...
 
int getCoreAffinity () const
 Return the core affinity. More...
 
void setCritical (bool critical)
 Specify whether or not this thread is critical. More...
 
bool getCritical () const
 Return the value of the critical flag. More...
 
const std::string & getName () const
 Return the name of this thread. More...
 
void setName (const std::string &name)
 Set the name of this thread. More...
 
ThreadgetParent ()
 Return the parent thread. More...
 
const ThreadgetParent () const
 Return the parent thread (const version) More...
 
void setLogger (Logger *logger)
 Set the logger instance used to process log messages from this thread. More...
 
LoggergetLogger ()
 Return the thread's logger instance. More...
 
void setFileResolver (FileResolver *fresolver)
 Set the thread's file resolver. More...
 
FileResolvergetFileResolver ()
 Return the thread's file resolver. More...
 
bool isRunning () const
 Is this thread still running? More...
 
void start ()
 Start the thread. More...
 
void detach ()
 Detach the thread and release resources. More...
 
void join ()
 Wait until the thread finishes. More...
 
virtual std::string toString () const
 Return a string representation. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Thread
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Types

enum  EMessage {
  EUnknown = 0, ENewProcess, ENewResource, ENewMultiResource,
  EBindResource, EWorkUnit, EWorkResult, ECancelledWorkResult,
  EProcessTerminated, EProcessCancelled, EEnsurePluginLoaded, EResourceExpired,
  EQuit, EIncompatible, EHello = 0x1bcd
}
 

Protected Member Functions

virtual ~StreamBackend ()
 Virtual destructor. More...
 
virtual void run ()
 The thread's run method. More...
 
void sendWorkResult (int id, const WorkResult *result, bool cancelled)
 
void sendCancellation (int id, int numLost)
 
- Protected Member Functions inherited from mitsuba::Thread
virtual ~Thread ()
 Virtual destructor. More...
 
void exit ()
 
void yield ()
 Yield to another processor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Friends

class RemoteProcess
 
class RemoteWorker
 
class RemoteWorkerReader
 

Additional Inherited Members

- Public Types inherited from mitsuba::Thread
enum  EThreadPriority {
  EIdlePriority = 0, ELowestPriority, ELowPriority, ENormalPriority,
  EHighPriority, EHighestPriority, ERealtimePriority
}
 Possible priority values for Thread::setPriority() More...
 
- Static Public Member Functions inherited from mitsuba::Thread
static int getID ()
 Return the thread ID. More...
 
static ThreadgetThread ()
 Return the current thread. More...
 
static void sleep (unsigned int ms)
 Sleep for a certain amount of time. More...
 
static void staticInitialization ()
 Initialize the threading system. More...
 
static void staticShutdown ()
 Shut down the threading system. More...
 
static void initializeOpenMP (size_t threadCount)
 Initialize Mitsuba's threading system for simultaneous use of OpenMP. More...
 
static ThreadregisterUnmanagedThread (const std::string &name)
 Register an unmanaged thread with Mitsuba (i.e. one that doesn't derive from mitsuba::Thread) More...
 
static void registerCrashHandler (bool(*handler)(void))
 Register a thread crash handler. More...
 
- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 
- Static Protected Member Functions inherited from mitsuba::Thread
static void dispatch (Thread *thread)
 Thread dispatch function. More...
 

Detailed Description

Network processing communication backend.

Attaches to the end of a stream, accepts work units and forwards them to the local scheduler. Can be used to create network processing nodes.

Member Enumeration Documentation

Enumerator
EUnknown 
ENewProcess 
ENewResource 
ENewMultiResource 
EBindResource 
EWorkUnit 
EWorkResult 
ECancelledWorkResult 
EProcessTerminated 
EProcessCancelled 
EEnsurePluginLoaded 
EResourceExpired 
EQuit 
EIncompatible 
EHello 

Constructor & Destructor Documentation

mitsuba::StreamBackend::StreamBackend ( const std::string &  name,
Scheduler scheduler,
const std::string &  nodeName,
Stream stream,
bool  detach 
)

Create a new stream backend.

Parameters
nameName of the created thread
schedulerScheduler instance used to process work units
nodeNameExposed name of this node
streamStream used for communications
detachShould the associated thread be joinable or detach instead?
virtual mitsuba::StreamBackend::~StreamBackend ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual const Class* mitsuba::StreamBackend::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::Thread.

virtual void mitsuba::StreamBackend::run ( )
protectedvirtual

The thread's run method.

Implements mitsuba::Thread.

void mitsuba::StreamBackend::sendCancellation ( int  id,
int  numLost 
)
protected
void mitsuba::StreamBackend::sendWorkResult ( int  id,
const WorkResult result,
bool  cancelled 
)
protected

Friends And Related Function Documentation

friend class RemoteProcess
friend
friend class RemoteWorker
friend
friend class RemoteWorkerReader
friend

Member Data Documentation

Class* mitsuba::StreamBackend::m_theClass
static

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