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

Run-time VTK interpreter. More...

#include <vtkClientServerInterpreter.h>

Inheritance diagram for vtkClientServerInterpreter:
Inheritance graph
[legend]
Collaboration diagram for vtkClientServerInterpreter:
Collaboration graph
[legend]

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 &os, vtkIndent indent) override
 
 vtkClientServerInterpreter (const vtkClientServerInterpreter &)=delete
 
vtkClientServerInterpreteroperator= (const vtkClientServerInterpreter &)=delete
 
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...
 
vtkObjectBaseGetObjectFromID (vtkClientServerID id)
 Return a pointer to a vtkObjectBase for an ID whose message contains only the one object. More...
 
vtkObjectBaseGetObjectFromID (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...
 
VTK_NEWINSTANCE vtkObjectBaseNewInstance (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=nullptr, vtkContextFreeFunction ctx_free=nullptr)
 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=nullptr, vtkContextFreeFunction ctx_free=nullptr)
 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...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkClientServerInterpreterNew ()
 
static int IsTypeOf (const char *type)
 
static vtkClientServerInterpreterSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkClientServerInterpreter ()
 
 ~vtkClientServerInterpreter () override
 
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 LoadInternal (const char *moduleName, const char *fullPath)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

ostream * LogStream
 
ostream * LogFileStream
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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 51 of file vtkClientServerInterpreter.h.

Member Typedef Documentation

◆ Superclass

Definition at line 55 of file vtkClientServerInterpreter.h.

Constructor & Destructor Documentation

◆ vtkClientServerInterpreter() [1/2]

vtkClientServerInterpreter::vtkClientServerInterpreter ( const vtkClientServerInterpreter )
delete

◆ vtkClientServerInterpreter() [2/2]

vtkClientServerInterpreter::vtkClientServerInterpreter ( )
protected

◆ ~vtkClientServerInterpreter()

vtkClientServerInterpreter::~vtkClientServerInterpreter ( )
overrideprotected

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

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

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

◆ PrintSelf()

void vtkClientServerInterpreter::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkObject.

◆ operator=()

vtkClientServerInterpreter& vtkClientServerInterpreter::operator= ( const vtkClientServerInterpreter )
delete

◆ 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 nullptr 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 90 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]

VTK_NEWINSTANCE 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 = nullptr,
vtkContextFreeFunction  ctx_free = nullptr 
)

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 = nullptr,
vtkContextFreeFunction  ctx_free = nullptr 
)

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

◆ LoadInternal()

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

Member Data Documentation

◆ LogStream

ostream* vtkClientServerInterpreter::LogStream
protected

Definition at line 189 of file vtkClientServerInterpreter.h.

◆ LogFileStream

ostream* vtkClientServerInterpreter::LogFileStream
protected

Definition at line 190 of file vtkClientServerInterpreter.h.


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