class TObj

List of predecestors:
none
Files:
basic.h, tobj.cpp
Desc. & Idea Warnings Methods Atributes Operators Specials


Description

Fundamental class. Most of all classes in the system are derrived from TObj. It implements error messaging and class serialization for transportation via PVM. Also implements (de)serialization methods for basic types and for arrays of basic types.

Up.gif (1072 bytes)


Warnings

None.

Up.gif (1072 bytes)


Methods

Public:
TObj()
virtual char* Dump()
int Message(char* msg, char* name, msg_type type, BOOL halt = FALSE)
virtual uint Serialize(BYTE **raw,BOOL subclass=FALSE)
virtual uint GetSerSize(BOOL subclass=FALSE)
TObj(BYTE **raw,uint len,BOOL subclass=FALSE)

uint GetSerSizeChar(char arg)
uint GetSerSizeByte(BYTE arg)
uint GetSerSizeBool(BOOL arg)
uint GetSerSizeInt(int arg)
uint GetSerSizeLong(long arg)
uint GetSerSizeTFit(TFit arg)
uint GetSerSizeFloat(float arg)
uint GetSerSizeDouble(double arg)

uint GetSerSizeChar(char* array,uint len)
uint GetSerSizeByte(BYTE* array,uint len)
uint GetSerSizeBool(BOOL* array,uint len)
uint GetSerSizeInt(int* array,uint len)
uint GetSerSizeLong(long* array,uint len)
uint GetSerSizeTFit(TFit* array,uint len)
uint GetSerSizeFloat(float* array,uint len)
uint GetSerSizeDouble(double* array,uint len)

uint SerializeChar(char arg,BYTE **raw)
uint SerializeByte(BYTE arg,BYTE **raw)
uint SerializeBool(BOOL arg,BYTE **raw)
uint SerializeInt(int arg,BYTE **raw)
uint SerializeLong(long arg,BYTE **raw)
uint SerializeTFit(TFit arg,BYTE **raw)
uint SerializeFloat(float arg,BYTE **raw)
uint SerializeDouble(double arg,BYTE **raw)

uint SerializeChar(char* array,uint len,BYTE **raw)
uint SerializeByte(BYTE* array,uint len,BYTE **raw)
uint SerializeBool(BOOL* array,uint len,BYTE **raw)
uint SerializeInt(int* array,uint len,BYTE **raw)
uint SerializeLong(long* array,uint len,BYTE **raw)
uint SerializeTFit(TFit* array,uint len,BYTE **raw)
uint SerializeFloat(float* array,uint len,BYTE **raw)
uint SerializeDouble(double* array,uint len,BYTE **raw)

char DeserializeChar(BYTE **raw)
BYTE DeserializeByte(BYTE **raw)
BOOL DeserializeBool(BYTE **raw)
int DeserializeInt(BYTE **raw)
long DeserializeLong(BYTE **raw)
TFit DeserializeTFit(BYTE **raw)
float DeserializeFloat(BYTE **raw)
double DeserializeDouble(BYTE **raw)

char* DeserializeChar(char* array,uint len,BYTE **raw)
BYTE* DeserializeByte(BYTE* array,uint len,BYTE **raw)
BOOL* DeserializeBool(BOOL* array,uint len,BYTE **raw)
int* DeserializeInt(int* array,uint len,BYTE **raw)
long* DeserializeLong(long* array,uint len,BYTE **raw)
TFit* DeserializeTFit(TFit* array,uint len,BYTE **raw)
float* DeserializeFloat(float* array,uint len,BYTE **raw)
double* DeserializeDouble(double* array,uint len,BYTE **raw)
Protected:
Private:


virtual char* Dump()

Dumps the state of the object (all atributes) to the string. Allocates string and formats the info. Every class SHOULD override this method!

Arguments:

none

Returns:

pointer to the allocated string filled with debug info

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


int Message(char* msg, char* name, msg_type type, BOOL halt = FALSE)

Main method for error messaging. Provides simple user interface. Enables "error solving".

Arguments:

msg ... message for user (error description)
name ... class name and method name, where error had occured
type ... type of answer (see basic.h for details)
halt ... TRUE if program should terminate after message (default FALSE)

Returns:

user's answer

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


virtual uint Serialize(BYTE **raw,BOOL subclass=FALSE)

Method for class serialization. Puts down the content of class to the string of bytes.

Arguments:

raw ... pointer to pointer to the destination string, pointer (*raw) is changed during the serialization
subclass ... affects if the subclasses (classes created and destructed by the class) are also serialized (default FALSE)

Returns:

length of serialized class

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


virtual uint GetSerSize(BOOL subclass=FALSE)

Method counting the length of serialized class.

Arguments:

subclass ... affects if the subclasses (classes created and destructed by the class) should be also serialized (default FALSE)

Returns:

length of serialized class

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


TObj(BYTE **raw,uint len,BOOL subclass=FALSE)

Constructor for class deserialization. Creates the class from the string of bytes.

Arguments:

raw ... pointer to pointer to the source string, pointer (*raw) is changed during the deserialization
len ... length of string
subclass ... true if the subclasses were also serialized (default FALSE)

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


uint GetSerSizeChar(char arg)
uint GetSerSizeByte(BYTE arg)
uint GetSerSizeBool(BOOL arg)
uint GetSerSizeInt(int arg)
uint GetSerSizeLong(long arg)
uint GetSerSizeTFit(TFit arg)
uint GetSerSizeFloat(float arg)
uint GetSerSizeDouble(double arg)

Counts the length of serialized argument of specified type.

Arguments:

arg ... argument to serialize

Returns:

length of serialized argument

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


uint GetSerSizeChar(char* array,uint len)
uint GetSerSizeByte(BYTE* array,uint len)
uint GetSerSizeBool(BOOL* array,uint len)
uint GetSerSizeInt(int* array,uint len)
uint GetSerSizeLong(long* array,uint len)
uint GetSerSizeTFit(TFit* array,uint len)
uint GetSerSizeFloat(float* array,uint len)
uint GetSerSizeDouble(double* array,uint len)

Counts the length of serialized arrray of single, specified type.

Arguments:

array ... array to serialize
len ... length of array (number of values stored in array)

Returns:

length of serialized array

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


uint SerializeChar(char arg,BYTE **raw)
uint SerializeByte(BYTE arg,BYTE **raw)
uint SerializeBool(BOOL arg,BYTE **raw)
uint SerializeInt(int arg,BYTE **raw)
uint SerializeLong(long arg,BYTE **raw)
uint SerializeTFit(TFit arg,BYTE **raw)
uint SerializeFloat(float arg,BYTE **raw)
uint SerializeDouble(double arg,BYTE **raw)

Serializes argument of specified type and moves the pointer (*raw) by proper length.

Arguments:

arg ... argument to serialize
raw ... pointer to the destination string

Returns:

length of serialized argument

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


uint SerializeChar(char* array,uint len,BYTE **raw)
uint SerializeByte(BYTE* array,uint len,BYTE **raw)
uint SerializeBool(BOOL* array,uint len,BYTE **raw)
uint SerializeInt(int* array,uint len,BYTE **raw)
uint SerializeLong(long* array,uint len,BYTE **raw)
uint SerializeTFit(TFit* array,uint len,BYTE **raw)
uint SerializeFloat(float* array,uint len,BYTE **raw)
uint SerializeDouble(double* array,uint len,BYTE **raw)

Serializes array of specified type and moves the pointer (*raw) by proper length.
Note: The length of array is not serialized. You should serialize it before the array itself.

Arguments:

array ... array to serialize
len ... length of array (number of values stored in array)
raw ... pointer to the destination string

Returns:

length of serialized array

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


char DeserializeChar(BYTE **raw)
BYTE DeserializeByte(BYTE **raw)
BOOL DeserializeBool(BYTE **raw)
int DeserializeInt(BYTE **raw)
long DeserializeLong(BYTE **raw)
TFit DeserializeTFit(BYTE **raw)
float DeserializeFloat(BYTE **raw)
double DeserializeDouble(BYTE **raw)

Deserializes argument of specified type and moves the pointer (*raw) by proper length.

Arguments:

raw ... pointer to the source string

Returns:

deserialized value

arrow3u.gif (362 bytes) Up.gif (1072 bytes)


char* DeserializeChar(char* array,uint len,BYTE **raw)
BYTE* DeserializeByte(BYTE* array,uint len,BYTE **raw)
BOOL* DeserializeBool(BOOL* array,uint len,BYTE **raw)
int* DeserializeInt(int* array,uint len,BYTE **raw)
long* DeserializeLong(long* array,uint len,BYTE **raw)
TFit* DeserializeTFit(TFit* array,uint len,BYTE **raw)
float* DeserializeFloat(float* array,uint len,BYTE **raw)
double* DeserializeDouble(double* array,uint len,BYTE **raw)

Deserializes array of specified type and moves the pointer (*raw) by proper length.

Arguments:

array ... allocated space for deserialized array
len ... length of array (number of values stored in array)
raw ... pointer to the source string

Returns:

deserialized array

arrow3u.gif (362 bytes) Up.gif (1072 bytes)




Atributes

Public:
Protected:
Private:


Operators

Public:
Protected:
Private:


Specials

None.

Up.gif (1072 bytes)