Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
vtkClientServerStream Class Reference

Store messages for the interpreter. More...

#include <vtkClientServerStream.h>

Classes

struct  Argument
 Proxy-object returned by the two-argument form of GetArgument. More...
 
struct  Array
 Proxy-object returned by InsertArray and used to insert array data into the stream. More...
 

Public Types

enum  Commands {
  New, Invoke, Delete, Assign,
  Reply, Error, EndOfCommands
}
 Enumeration of message types that may be stored in a stream. More...
 
enum  Types {
  int8_value, int8_array, int16_value, int16_array,
  int32_value, int32_array, int64_value, int64_array,
  uint8_value, uint8_array, uint16_value, uint16_array,
  uint32_value, uint32_array, uint64_value, uint64_array,
  float32_value, float32_array, float64_value, float64_array,
  bool_value, string_value, id_value, vtk_object_pointer,
  stream_value, LastResult, End
}
 Enumeration of data types that may be stored in a stream. More...
 

Public Member Functions

void Reserve (size_t size)
 Ask the stream to allocate at least the given size in memory to avoid too many reallocations during stream construction. More...
 
void Reset ()
 Reset the stream to an empty state. More...
 
void Copy (const vtkClientServerStream *source)
 Copy the stream contents from another stream. More...
 
int GetNumberOfMessages () const
 Get the number of complete messages currently stored in the stream. More...
 
vtkClientServerStream::Commands GetCommand (int message) const
 Get the command in the message with the given index. More...
 
int GetNumberOfArguments (int message) const
 Get the number of arguments in the message with the given index. More...
 
vtkClientServerStream::Types GetArgumentType (int message, int argument) const
 Get the type of the given argument in the given message. More...
 
int GetArgument (int message, int &argument, vtkVariant *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgumentLength (int message, int argument, vtkTypeUInt32 *length) const
 Get the length of an argument of an array type. More...
 
int GetArgumentObject (int message, int argument, vtkObjectBase **value, const char *type) const
 Get the given argument in the given message as an object of a particular vtkObjectBase type. More...
 
vtkClientServerStream::Argument GetArgument (int message, int argument) const
 Get the given argument of the given message in a form that can be sent to another stream. More...
 
int GetData (const unsigned char **data, size_t *length) const
 Get a pointer to the stream data and its length. More...
 
int SetData (const unsigned char *data, size_t length)
 Construct the entire stream from the given data. More...
 
int StreamFromString (const char *str)
 Set the stream by parsing the given string. More...
 
 vtkClientServerStream (vtkObjectBase *owner=nullptr)
 Constructor/Destructor manage references of vtk objects stored in the stream along with the rest of the stream data. More...
 
 ~vtkClientServerStream ()
 Constructor/Destructor manage references of vtk objects stored in the stream along with the rest of the stream data. More...
 
 vtkClientServerStream (const vtkClientServerStream &, vtkObjectBase *owner=nullptr)
 Copy constructor and assignment operator copy all stream data. More...
 
vtkClientServerStreamoperator= (const vtkClientServerStream &)
 Copy constructor and assignment operator copy all stream data. More...
 
int GetArgument (int message, int argument, bool *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, signed char *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, char *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, short *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, int *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, long *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned char *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned short *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned int *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned long *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, float *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, double *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, long long *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned long long *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, signed char *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, char *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, short *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, int *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, long *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned char *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned short *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned int *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned long *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, float *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, double *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, long long *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, unsigned long long *value, vtkTypeUInt32 length) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, const char **value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, char **value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, vtkStdString *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, std::string *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, vtkClientServerStream *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, vtkClientServerID *value) const
 Get the value of the given argument in the given message. More...
 
int GetArgument (int message, int argument, vtkObjectBase **value) const
 Get the value of the given argument in the given message. More...
 
vtkClientServerStreamoperator<< (vtkClientServerStream::Commands)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (vtkClientServerStream::Types)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (vtkClientServerStream::Argument)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (vtkClientServerStream::Array)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (const vtkClientServerStream &)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (vtkClientServerID)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (vtkObjectBase *)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (const vtkStdString &)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (const vtkVariant &)
 Stream operators for special types. More...
 
vtkClientServerStreamoperator<< (bool value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (char value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (short value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (int value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (long value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (signed char value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (unsigned char value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (unsigned short value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (unsigned int value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (unsigned long value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (long long value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (unsigned long long value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (float value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (double value)
 Stream operators for native types. More...
 
vtkClientServerStreamoperator<< (const char *value)
 Stream operators for native types. More...
 
void Print (ostream &) const
 Print the contents of the stream in a human-readable form. More...
 
void Print (ostream &, vtkIndent) const
 Print the contents of the stream in a human-readable form. More...
 
void PrintMessage (ostream &, int message) const
 Print the contents of the stream in a human-readable form. More...
 
void PrintMessage (ostream &, int message, vtkIndent) const
 Print the contents of the stream in a human-readable form. More...
 
void PrintArgument (ostream &, int message, int argument) const
 Print the contents of the stream in a human-readable form. More...
 
void PrintArgument (ostream &, int message, int argument, vtkIndent) const
 Print the contents of the stream in a human-readable form. More...
 
void PrintArgumentValue (ostream &, int message, int argument) const
 Print the contents of the stream in a human-readable form. More...
 
const char * StreamToString () const
 Convert the stream to a string-based encoding. More...
 
void StreamToString (ostream &os) const
 Convert the stream to a string-based encoding. More...
 

Static Public Member Functions

static vtkClientServerStream::Types GetTypeFromString (const char *name)
 Get the type named by the given string. More...
 
static const char * GetStringFromCommand (vtkClientServerStream::Commands cmd)
 Get a string describing the given command. More...
 
static vtkClientServerStream::Commands GetCommandFromString (const char *name)
 Get the command named by the given string. More...
 
static vtkClientServerStream::Array InsertArray (const char *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const short *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const int *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const long *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const signed char *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const unsigned char *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const unsigned short *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const unsigned int *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const unsigned long *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const long long *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const unsigned long long *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const float *, int)
 Allow arrays to be passed into the stream. More...
 
static vtkClientServerStream::Array InsertArray (const double *, int)
 Allow arrays to be passed into the stream. More...
 
static const char * GetStringFromType (vtkClientServerStream::Types type)
 Get a string describing the given type. More...
 
static const char * GetStringFromType (vtkClientServerStream::Types type, int index)
 Get a string describing the given type. More...
 

Protected Types

enum  { BigEndian, LittleEndian }
 

Protected Member Functions

vtkClientServerStreamWrite (const void *data, size_t length)
 
int ParseData ()
 
unsigned char * ParseCommand (int order, unsigned char *data, unsigned char *begin, unsigned char *end)
 
void ParseEnd ()
 
unsigned char * ParseType (int order, unsigned char *data, unsigned char *begin, unsigned char *end, vtkClientServerStream::Types *type)
 
unsigned char * ParseValue (int order, unsigned char *data, unsigned char *end, unsigned int wordSize)
 
unsigned char * ParseArray (int order, unsigned char *data, unsigned char *end, unsigned int wordSize)
 
unsigned char * ParseString (int order, unsigned char *data, unsigned char *end)
 
unsigned char * ParseStream (int order, unsigned char *data, unsigned char *end)
 
void PerformByteSwap (int dataByteOrder, unsigned char *data, unsigned int numWords, unsigned int wordSize)
 
const unsigned char * GetValue (int message, int value) const
 
int GetNumberOfValues (int message) const
 
void PrintArgumentInternal (ostream &, int message, int argument, int annotate, vtkIndent) const
 
void StreamToString (ostream &os, vtkIndent indent) const
 
void MessageToString (ostream &os, int m) const
 
void MessageToString (ostream &os, int m, vtkIndent indent) const
 
void ArgumentToString (ostream &os, int m, int a) const
 
void ArgumentToString (ostream &os, int m, int a, vtkIndent indent) const
 
void ArgumentValueToString (ostream &os, int m, int a, vtkIndent indent) const
 
int StreamFromStringInternal (const char *begin, const char *end)
 
int AddMessageFromString (const char *begin, const char *end, const char **next)
 
int AddArgumentFromString (const char *begin, const char *end, const char **next)
 

Static Protected Member Functions

static vtkClientServerStream::Array InsertString (const char *begin, const char *end)
 
static vtkClientServerStream::Types GetTypeFromString (const char *begin, const char *end)
 
static vtkClientServerStream::Commands GetCommandFromString (const char *begin, const char *end)
 

Friends

class vtkClientServerStreamInternals
 

Detailed Description

Store messages for the interpreter.

vtkClientServerStream will store zero or more almost arbitrary messages in a platform-independent manner. The stream's data may be copied from one platform to another via GetData/SetData methods, and the message represented will remain unchanged. Messages are used to represent both commands and results for vtkClientServerInterpreter, but they may be used for any purpose.

Definition at line 23 of file vtkClientServerStream.h.

Member Enumeration Documentation

◆ Commands

Enumeration of message types that may be stored in a stream.

This must be kept in sync with the string table in this class's .cxx file.

Enumerator
New 
Invoke 
Delete 
Assign 
Reply 
Error 
EndOfCommands 

Definition at line 48 of file vtkClientServerStream.h.

◆ Types

Enumeration of data types that may be stored in a stream.

This must be kept in sync with the string table in this class's .cxx file.

Enumerator
int8_value 
int8_array 
int16_value 
int16_array 
int32_value 
int32_array 
int64_value 
int64_array 
uint8_value 
uint8_array 
uint16_value 
uint16_array 
uint32_value 
uint32_array 
uint64_value 
uint64_array 
float32_value 
float32_array 
float64_value 
float64_array 
bool_value 
string_value 
id_value 
vtk_object_pointer 
stream_value 
LastResult 
End 

Definition at line 64 of file vtkClientServerStream.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
BigEndian 
LittleEndian 

Definition at line 391 of file vtkClientServerStream.h.

Constructor & Destructor Documentation

◆ vtkClientServerStream() [1/2]

vtkClientServerStream::vtkClientServerStream ( vtkObjectBase owner = nullptr)

Constructor/Destructor manage references of vtk objects stored in the stream along with the rest of the stream data.

◆ ~vtkClientServerStream()

vtkClientServerStream::~vtkClientServerStream ( )

Constructor/Destructor manage references of vtk objects stored in the stream along with the rest of the stream data.

◆ vtkClientServerStream() [2/2]

vtkClientServerStream::vtkClientServerStream ( const vtkClientServerStream ,
vtkObjectBase owner = nullptr 
)

Copy constructor and assignment operator copy all stream data.

Member Function Documentation

◆ operator=()

vtkClientServerStream& vtkClientServerStream::operator= ( const vtkClientServerStream )

Copy constructor and assignment operator copy all stream data.

◆ Reserve()

void vtkClientServerStream::Reserve ( size_t  size)

Ask the stream to allocate at least the given size in memory to avoid too many reallocations during stream construction.

◆ Reset()

void vtkClientServerStream::Reset ( )

Reset the stream to an empty state.

◆ Copy()

void vtkClientServerStream::Copy ( const vtkClientServerStream source)

Copy the stream contents from another stream.

◆ GetNumberOfMessages()

int vtkClientServerStream::GetNumberOfMessages ( ) const

Get the number of complete messages currently stored in the stream.

◆ GetCommand()

vtkClientServerStream::Commands vtkClientServerStream::GetCommand ( int  message) const

Get the command in the message with the given index.

Returns EndOfCommands if the given index is out of range.

◆ GetNumberOfArguments()

int vtkClientServerStream::GetNumberOfArguments ( int  message) const

Get the number of arguments in the message with the given index.

Returns a value less than 0 if the given index is out of range.

◆ GetArgumentType()

vtkClientServerStream::Types vtkClientServerStream::GetArgumentType ( int  message,
int  argument 
) const

Get the type of the given argument in the given message.

Returns End if either index is out of range.

◆ GetArgument() [1/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
bool *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [2/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
signed char *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [3/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
char *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [4/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
short *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [5/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
int value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [6/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
long *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [7/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned char *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [8/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned short *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [9/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned int value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [10/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned long *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [11/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
float value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [12/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
double value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [13/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
long long *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [14/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned long long *  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [15/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
signed char *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [16/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
char *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [17/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
short *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [18/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
int value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [19/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
long *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [20/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned char *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [21/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned short *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [22/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned int value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [23/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned long *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [24/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
float value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [25/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
double value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [26/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
long long *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [27/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
unsigned long long *  value,
vtkTypeUInt32  length 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [28/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
const char **  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [29/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
char **  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [30/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
vtkStdString value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [31/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
std::string value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [32/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
vtkClientServerStream value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [33/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
vtkClientServerID value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [34/36]

int vtkClientServerStream::GetArgument ( int  message,
int  argument,
vtkObjectBase **  value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

◆ GetArgument() [35/36]

int vtkClientServerStream::GetArgument ( int  message,
int argument,
vtkVariant value 
) const

Get the value of the given argument in the given message.

Returns whether the argument could be converted to the requested type.

Note that this version modifies the argument number as a vtkVariant is passed in the stream as a composite type with a variable number of primitive stream entries required to describe it.

◆ GetArgumentLength()

int vtkClientServerStream::GetArgumentLength ( int  message,
int  argument,
vtkTypeUInt32 *  length 
) const

Get the length of an argument of an array type.

Returns whether the argument is really an array type.

◆ GetArgumentObject()

int vtkClientServerStream::GetArgumentObject ( int  message,
int  argument,
vtkObjectBase **  value,
const char *  type 
) const

Get the given argument in the given message as an object of a particular vtkObjectBase type.

Returns whether the argument is really of the requested type.

◆ GetArgument() [36/36]

vtkClientServerStream::Argument vtkClientServerStream::GetArgument ( int  message,
int  argument 
) const

Get the given argument of the given message in a form that can be sent to another stream.

Returns an empty argument if it either index is out of range.

◆ GetData()

int vtkClientServerStream::GetData ( const unsigned char **  data,
size_t *  length 
) const

Get a pointer to the stream data and its length.

The values are suitable for passing to another stream's SetData method, but are invalidated when any further writing to the stream is done. Returns whether the stream is currently valid.

◆ operator<<() [1/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkClientServerStream::Commands  )

Stream operators for special types.

◆ operator<<() [2/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkClientServerStream::Types  )

Stream operators for special types.

◆ operator<<() [3/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkClientServerStream::Argument  )

Stream operators for special types.

◆ operator<<() [4/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkClientServerStream::Array  )

Stream operators for special types.

◆ operator<<() [5/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( const vtkClientServerStream )

Stream operators for special types.

◆ operator<<() [6/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkClientServerID  )

Stream operators for special types.

◆ operator<<() [7/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( vtkObjectBase )

Stream operators for special types.

◆ operator<<() [8/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( const vtkStdString )

Stream operators for special types.

◆ operator<<() [9/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( const vtkVariant )

Stream operators for special types.

◆ operator<<() [10/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( bool  value)

Stream operators for native types.

◆ operator<<() [11/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( char  value)

Stream operators for native types.

◆ operator<<() [12/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( short  value)

Stream operators for native types.

◆ operator<<() [13/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( int  value)

Stream operators for native types.

◆ operator<<() [14/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( long  value)

Stream operators for native types.

◆ operator<<() [15/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( signed char  value)

Stream operators for native types.

◆ operator<<() [16/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( unsigned char  value)

Stream operators for native types.

◆ operator<<() [17/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( unsigned short  value)

Stream operators for native types.

◆ operator<<() [18/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( unsigned int  value)

Stream operators for native types.

◆ operator<<() [19/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( unsigned long  value)

Stream operators for native types.

◆ operator<<() [20/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( long long  value)

Stream operators for native types.

◆ operator<<() [21/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( unsigned long long  value)

Stream operators for native types.

◆ operator<<() [22/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( float  value)

Stream operators for native types.

◆ operator<<() [23/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( double  value)

Stream operators for native types.

◆ operator<<() [24/24]

vtkClientServerStream& vtkClientServerStream::operator<< ( const char *  value)

Stream operators for native types.

◆ InsertArray() [1/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const char *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [2/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const short *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [3/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const int ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [4/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const long *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [5/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const signed char *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [6/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const unsigned char *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [7/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const unsigned short *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [8/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const unsigned int ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [9/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const unsigned long *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [10/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const long long *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [11/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const unsigned long long *  ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [12/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const float ,
int   
)
static

Allow arrays to be passed into the stream.

◆ InsertArray() [13/13]

static vtkClientServerStream::Array vtkClientServerStream::InsertArray ( const double ,
int   
)
static

Allow arrays to be passed into the stream.

◆ SetData()

int vtkClientServerStream::SetData ( const unsigned char *  data,
size_t  length 
)

Construct the entire stream from the given data.

This destroys any data already in the stream. Returns whether the stream is deemed valid. In the case of 0, the stream will have been reset.

◆ GetStringFromType() [1/2]

static const char* vtkClientServerStream::GetStringFromType ( vtkClientServerStream::Types  type)
static

Get a string describing the given type.

Returns "unknown" if the type value is invalid. If the type has multiple possible names, the second argument can be used to specify the index of the name to use. The higher the index, the more shorthand the name. If the index is too high, the last name is used.

◆ GetStringFromType() [2/2]

static const char* vtkClientServerStream::GetStringFromType ( vtkClientServerStream::Types  type,
int  index 
)
static

Get a string describing the given type.

Returns "unknown" if the type value is invalid. If the type has multiple possible names, the second argument can be used to specify the index of the name to use. The higher the index, the more shorthand the name. If the index is too high, the last name is used.

◆ GetTypeFromString() [1/2]

static vtkClientServerStream::Types vtkClientServerStream::GetTypeFromString ( const char *  name)
static

Get the type named by the given string.

Returns vtkClientServerStream::End if the type string is not recognized.

◆ GetStringFromCommand()

static const char* vtkClientServerStream::GetStringFromCommand ( vtkClientServerStream::Commands  cmd)
static

Get a string describing the given command.

Returns "unknown" if the command value is invalid.

◆ GetCommandFromString() [1/2]

static vtkClientServerStream::Commands vtkClientServerStream::GetCommandFromString ( const char *  name)
static

Get the command named by the given string.

Returns vtkClientServerStream::EndOfCommands if the string is not recognized.

◆ Print() [1/2]

void vtkClientServerStream::Print ( ostream &  ) const

Print the contents of the stream in a human-readable form.

◆ Print() [2/2]

void vtkClientServerStream::Print ( ostream &  ,
vtkIndent   
) const

Print the contents of the stream in a human-readable form.

◆ PrintMessage() [1/2]

void vtkClientServerStream::PrintMessage ( ostream &  ,
int  message 
) const

Print the contents of the stream in a human-readable form.

◆ PrintMessage() [2/2]

void vtkClientServerStream::PrintMessage ( ostream &  ,
int  message,
vtkIndent   
) const

Print the contents of the stream in a human-readable form.

◆ PrintArgument() [1/2]

void vtkClientServerStream::PrintArgument ( ostream &  ,
int  message,
int  argument 
) const

Print the contents of the stream in a human-readable form.

◆ PrintArgument() [2/2]

void vtkClientServerStream::PrintArgument ( ostream &  ,
int  message,
int  argument,
vtkIndent   
) const

Print the contents of the stream in a human-readable form.

◆ PrintArgumentValue()

void vtkClientServerStream::PrintArgumentValue ( ostream &  ,
int  message,
int  argument 
) const

Print the contents of the stream in a human-readable form.

◆ StreamToString() [1/3]

const char* vtkClientServerStream::StreamToString ( ) const

Convert the stream to a string-based encoding.

◆ StreamToString() [2/3]

void vtkClientServerStream::StreamToString ( ostream &  os) const

Convert the stream to a string-based encoding.

◆ StreamFromString()

int vtkClientServerStream::StreamFromString ( const char *  str)

Set the stream by parsing the given string.

The syntax of the string must be that produced by the StreamToString method. Returns 1 if the string is successfully parsed and 0 otherwise.

◆ Write()

vtkClientServerStream& vtkClientServerStream::Write ( const void *  data,
size_t  length 
)
protected

◆ ParseData()

int vtkClientServerStream::ParseData ( )
protected

◆ ParseCommand()

unsigned char* vtkClientServerStream::ParseCommand ( int  order,
unsigned char *  data,
unsigned char *  begin,
unsigned char *  end 
)
protected

◆ ParseEnd()

void vtkClientServerStream::ParseEnd ( )
protected

◆ ParseType()

unsigned char* vtkClientServerStream::ParseType ( int  order,
unsigned char *  data,
unsigned char *  begin,
unsigned char *  end,
vtkClientServerStream::Types type 
)
protected

◆ ParseValue()

unsigned char* vtkClientServerStream::ParseValue ( int  order,
unsigned char *  data,
unsigned char *  end,
unsigned int  wordSize 
)
protected

◆ ParseArray()

unsigned char* vtkClientServerStream::ParseArray ( int  order,
unsigned char *  data,
unsigned char *  end,
unsigned int  wordSize 
)
protected

◆ ParseString()

unsigned char* vtkClientServerStream::ParseString ( int  order,
unsigned char *  data,
unsigned char *  end 
)
protected

◆ ParseStream()

unsigned char* vtkClientServerStream::ParseStream ( int  order,
unsigned char *  data,
unsigned char *  end 
)
protected

◆ PerformByteSwap()

void vtkClientServerStream::PerformByteSwap ( int  dataByteOrder,
unsigned char *  data,
unsigned int  numWords,
unsigned int  wordSize 
)
protected

◆ GetValue()

const unsigned char* vtkClientServerStream::GetValue ( int  message,
int  value 
) const
protected

◆ GetNumberOfValues()

int vtkClientServerStream::GetNumberOfValues ( int  message) const
protected

◆ PrintArgumentInternal()

void vtkClientServerStream::PrintArgumentInternal ( ostream &  ,
int  message,
int  argument,
int  annotate,
vtkIndent   
) const
protected

◆ StreamToString() [3/3]

void vtkClientServerStream::StreamToString ( ostream &  os,
vtkIndent  indent 
) const
protected

◆ MessageToString() [1/2]

void vtkClientServerStream::MessageToString ( ostream &  os,
int  m 
) const
protected

◆ MessageToString() [2/2]

void vtkClientServerStream::MessageToString ( ostream &  os,
int  m,
vtkIndent  indent 
) const
protected

◆ ArgumentToString() [1/2]

void vtkClientServerStream::ArgumentToString ( ostream &  os,
int  m,
int  a 
) const
protected

◆ ArgumentToString() [2/2]

void vtkClientServerStream::ArgumentToString ( ostream &  os,
int  m,
int  a,
vtkIndent  indent 
) const
protected

◆ ArgumentValueToString()

void vtkClientServerStream::ArgumentValueToString ( ostream &  os,
int  m,
int  a,
vtkIndent  indent 
) const
protected

◆ InsertString()

static vtkClientServerStream::Array vtkClientServerStream::InsertString ( const char *  begin,
const char *  end 
)
staticprotected

◆ GetTypeFromString() [2/2]

static vtkClientServerStream::Types vtkClientServerStream::GetTypeFromString ( const char *  begin,
const char *  end 
)
staticprotected

◆ GetCommandFromString() [2/2]

static vtkClientServerStream::Commands vtkClientServerStream::GetCommandFromString ( const char *  begin,
const char *  end 
)
staticprotected

◆ StreamFromStringInternal()

int vtkClientServerStream::StreamFromStringInternal ( const char *  begin,
const char *  end 
)
protected

◆ AddMessageFromString()

int vtkClientServerStream::AddMessageFromString ( const char *  begin,
const char *  end,
const char **  next 
)
protected

◆ AddArgumentFromString()

int vtkClientServerStream::AddArgumentFromString ( const char *  begin,
const char *  end,
const char **  next 
)
protected

Friends And Related Function Documentation

◆ vtkClientServerStreamInternals

friend class vtkClientServerStreamInternals
friend

Definition at line 436 of file vtkClientServerStream.h.


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