ParaView
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkClientServerInterpreter Class Reference

Run-time VTK interpreter. More...

#include <vtkClientServerInterpreter.h>

Inherits vtkObject.

Classes

struct  NewCallbackInfo
 The callback data structure passed to observers looking for VTK object creation and deletion events. More...
 

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &, vtkIndent)
 
int ProcessOneMessage (const vtkClientServerStream &css, int message)
 Process the message with the given index in the given stream. More...
 
const vtkClientServerStreamGetMessageFromID (vtkClientServerID id)
 Get the message for an ID. More...
 
const vtkClientServerStreamGetLastResult () const
 Get the last result message. More...
 
vtkObjectBase * GetObjectFromID (vtkClientServerID id)
 Return a pointer to a vtkObjectBase for an ID whose message contains only the one object. More...
 
vtkObjectBase * GetObjectFromID (vtkClientServerID id, int noerror)
 
vtkClientServerID GetIDFromObject (vtkObjectBase *key)
 Return an ID given a pointer to a vtkObjectBase (or 0 if object is not found) More...
 
int NewInstance (vtkObjectBase *obj, vtkClientServerID id)
 Called by generated code to register a new class instance. More...
 
vtkObjectBase * NewInstance (const char *classname)
 Creates a new instance for the class specified using the interpreter. More...
 
int NewObserver (vtkObject *obj, const char *event, const vtkClientServerStream &css)
 Called by generated code to add an observer to a wrapped object. More...
 
void AddCommandFunction (const char *cname, vtkClientServerCommandFunction func, void *ctx=NULL, vtkContextFreeFunction ctx_free=NULL)
 Add a command function for a class. More...
 
bool HasCommandFunction (const char *cname)
 Return true if the classname has a command function, false otherwise. More...
 
int CallCommandFunction (const char *classname, vtkObjectBase *ptr, const char *method, const vtkClientServerStream &msg, vtkClientServerStream &result)
 Call a command function. More...
 
void AddNewInstanceFunction (const char *cname, vtkClientServerNewInstanceFunction f, void *ctx=NULL, vtkContextFreeFunction ctx_free=NULL)
 Add a function used to create new objects. More...
 
void ClearLastResult ()
 Resets the LastResult stream. More...
 
vtkClientServerID GetNextAvailableId ()
 Return the next available Id that can be used to create a new object. More...
 
int ProcessStream (const unsigned char *msg, size_t msgLength)
 Process all messages in a given vtkClientServerStream. More...
 
int ProcessStream (const vtkClientServerStream &css)
 Process all messages in a given vtkClientServerStream. More...
 
void SetLogFile (const char *name)
 Get/Set a stream to which an execution log is written. More...
 
virtual void SetLogStream (ostream *ostr)
 Get/Set a stream to which an execution log is written. More...
 
virtual ostream * GetLogStream ()
 Get/Set a stream to which an execution log is written. More...
 
int Load (const char *moduleName)
 Dynamically load a wrapper module into the interpreter. More...
 
int Load (const char *moduleName, const char *const *optionalPaths)
 Dynamically load a wrapper module into the interpreter. More...
 

Static Public Member Functions

static vtkClientServerInterpreterNew ()
 
static int IsTypeOf (const char *type)
 
static vtkClientServerInterpreterSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkClientServerInterpreter ()
 
 ~vtkClientServerInterpreter ()
 
int ProcessCommandNew (const vtkClientServerStream &css, int midx)
 
int ProcessCommandInvoke (const vtkClientServerStream &css, int midx)
 
int ProcessCommandDelete (const vtkClientServerStream &css, int midx)
 
int ProcessCommandAssign (const vtkClientServerStream &css, int midx)
 
int ExpandMessage (const vtkClientServerStream &in, int inIndex, int startArgument, vtkClientServerStream &out)
 
int LoadImpl (const char *moduleName)
 
int LoadInternal (const char *moduleName, const char *fullPath)
 

Protected Attributes

ostream * LogStream
 
ofstream * LogFileStream
 

Friends

class vtkClientServerInterpreterCommand
 

Detailed Description

Run-time VTK interpreter.

vtkClientServerInterpreter will process messages stored in a vtkClientServerStream. This allows run-time creation and execution of VTK programs.

Definition at line 64 of file vtkClientServerInterpreter.h.

Member Typedef Documentation

§ Superclass

Definition at line 68 of file vtkClientServerInterpreter.h.

Constructor & Destructor Documentation

§ vtkClientServerInterpreter()

vtkClientServerInterpreter::vtkClientServerInterpreter ( )
protected

§ ~vtkClientServerInterpreter()

vtkClientServerInterpreter::~vtkClientServerInterpreter ( )
protected

Member Function Documentation

§ New()

static vtkClientServerInterpreter* vtkClientServerInterpreter::New ( )
static

§ GetClassName()

virtual const char* vtkClientServerInterpreter::GetClassName ( )
virtual

§ IsTypeOf()

static int vtkClientServerInterpreter::IsTypeOf ( const char *  type)
static

§ IsA()

virtual int vtkClientServerInterpreter::IsA ( const char *  type)
virtual

§ SafeDownCast()

static vtkClientServerInterpreter* vtkClientServerInterpreter::SafeDownCast ( vtkObject *  o)
static

§ PrintSelf()

void vtkClientServerInterpreter::PrintSelf ( ostream &  ,
vtkIndent   
)

§ ProcessStream() [1/2]

int vtkClientServerInterpreter::ProcessStream ( const unsigned char *  msg,
size_t  msgLength 
)

Process all messages in a given vtkClientServerStream.

Return 1 if all messages succeeded, and 0 otherwise.

§ ProcessStream() [2/2]

int vtkClientServerInterpreter::ProcessStream ( const vtkClientServerStream css)

Process all messages in a given vtkClientServerStream.

Return 1 if all messages succeeded, and 0 otherwise.

§ ProcessOneMessage()

int vtkClientServerInterpreter::ProcessOneMessage ( const vtkClientServerStream css,
int  message 
)

Process the message with the given index in the given stream.

Returns 1 for success, 0 for failure.

§ GetMessageFromID()

const vtkClientServerStream* vtkClientServerInterpreter::GetMessageFromID ( vtkClientServerID  id)

Get the message for an ID.

ID 0 always returns a NULL message.

§ GetLastResult()

const vtkClientServerStream& vtkClientServerInterpreter::GetLastResult ( ) const

Get the last result message.

§ GetObjectFromID() [1/2]

vtkObjectBase* vtkClientServerInterpreter::GetObjectFromID ( vtkClientServerID  id)
inline

Return a pointer to a vtkObjectBase for an ID whose message contains only the one object.

Definition at line 100 of file vtkClientServerInterpreter.h.

§ GetObjectFromID() [2/2]

vtkObjectBase* vtkClientServerInterpreter::GetObjectFromID ( vtkClientServerID  id,
int  noerror 
)

§ GetIDFromObject()

vtkClientServerID vtkClientServerInterpreter::GetIDFromObject ( vtkObjectBase *  key)

Return an ID given a pointer to a vtkObjectBase (or 0 if object is not found)

§ SetLogFile()

void vtkClientServerInterpreter::SetLogFile ( const char *  name)

Get/Set a stream to which an execution log is written.

§ SetLogStream()

virtual void vtkClientServerInterpreter::SetLogStream ( ostream *  ostr)
virtual

Get/Set a stream to which an execution log is written.

§ GetLogStream()

virtual ostream* vtkClientServerInterpreter::GetLogStream ( )
virtual

Get/Set a stream to which an execution log is written.

§ NewInstance() [1/2]

int vtkClientServerInterpreter::NewInstance ( vtkObjectBase *  obj,
vtkClientServerID  id 
)

Called by generated code to register a new class instance.

Do not call directly.

§ NewInstance() [2/2]

vtkObjectBase* vtkClientServerInterpreter::NewInstance ( const char *  classname)

Creates a new instance for the class specified using the interpreter.

§ NewObserver()

int vtkClientServerInterpreter::NewObserver ( vtkObject *  obj,
const char *  event,
const vtkClientServerStream css 
)

Called by generated code to add an observer to a wrapped object.

Do not call directly.

§ AddCommandFunction()

void vtkClientServerInterpreter::AddCommandFunction ( const char *  cname,
vtkClientServerCommandFunction  func,
void *  ctx = NULL,
vtkContextFreeFunction  ctx_free = NULL 
)

Add a command function for a class.

§ HasCommandFunction()

bool vtkClientServerInterpreter::HasCommandFunction ( const char *  cname)

Return true if the classname has a command function, false otherwise.

§ CallCommandFunction()

int vtkClientServerInterpreter::CallCommandFunction ( const char *  classname,
vtkObjectBase *  ptr,
const char *  method,
const vtkClientServerStream msg,
vtkClientServerStream result 
)

Call a command function.

§ AddNewInstanceFunction()

void vtkClientServerInterpreter::AddNewInstanceFunction ( const char *  cname,
vtkClientServerNewInstanceFunction  f,
void *  ctx = NULL,
vtkContextFreeFunction  ctx_free = NULL 
)

Add a function used to create new objects.

§ ClearLastResult()

void vtkClientServerInterpreter::ClearLastResult ( )

Resets the LastResult stream.

§ Load() [1/2]

int vtkClientServerInterpreter::Load ( const char *  moduleName)

Dynamically load a wrapper module into the interpreter.

Returns 1 for success and 0 for failure.

§ Load() [2/2]

int vtkClientServerInterpreter::Load ( const char *  moduleName,
const char *const *  optionalPaths 
)

Dynamically load a wrapper module into the interpreter.

Returns 1 for success and 0 for failure.

§ GetNextAvailableId()

vtkClientServerID vtkClientServerInterpreter::GetNextAvailableId ( )

Return the next available Id that can be used to create a new object.

This only work if all class that created object into the interpretor have used this method. Basically it is just a counter available with the interpreter instance.

§ ProcessCommandNew()

int vtkClientServerInterpreter::ProcessCommandNew ( const vtkClientServerStream css,
int  midx 
)
protected

§ ProcessCommandInvoke()

int vtkClientServerInterpreter::ProcessCommandInvoke ( const vtkClientServerStream css,
int  midx 
)
protected

§ ProcessCommandDelete()

int vtkClientServerInterpreter::ProcessCommandDelete ( const vtkClientServerStream css,
int  midx 
)
protected

§ ProcessCommandAssign()

int vtkClientServerInterpreter::ProcessCommandAssign ( const vtkClientServerStream css,
int  midx 
)
protected

§ ExpandMessage()

int vtkClientServerInterpreter::ExpandMessage ( const vtkClientServerStream in,
int  inIndex,
int  startArgument,
vtkClientServerStream out 
)
protected

§ LoadImpl()

int vtkClientServerInterpreter::LoadImpl ( const char *  moduleName)
protected

§ LoadInternal()

int vtkClientServerInterpreter::LoadInternal ( const char *  moduleName,
const char *  fullPath 
)
protected

Friends And Related Function Documentation

§ vtkClientServerInterpreterCommand

friend class vtkClientServerInterpreterCommand
friend

Definition at line 224 of file vtkClientServerInterpreter.h.

Member Data Documentation

§ LogStream

ostream* vtkClientServerInterpreter::LogStream
protected

Definition at line 198 of file vtkClientServerInterpreter.h.

§ LogFileStream

ofstream* vtkClientServerInterpreter::LogFileStream
protected

Definition at line 199 of file vtkClientServerInterpreter.h.


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