qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ccSerializableObject Class Reference

Serializable object interface. More...

#include <ccSerializableObject.h>

Inheritance diagram for ccSerializableObject:
Inheritance graph
[legend]

Public Types

enum  DeserializationFlags { DF_POINT_COORDS_64_BITS = 1, DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 

Public Member Functions

virtual ~ccSerializableObject ()
 Desctructor.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not.
 
virtual bool toFile (QFile &out) const
 Saves data to binay stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags)
 Loads data from binay stream. More...
 

Static Public Member Functions

static bool WriteError ()
 Sends a custom error message (write error) and returns 'false'. More...
 
static bool ReadError ()
 Sends a custom error message (read error) and returns 'false'. More...
 
static bool MemoryError ()
 Sends a custom error message (not enough memory) and returns 'false'. More...
 
static bool CorruptError ()
 Sends a custom error message (corrupted file) and returns 'false'. More...
 

Detailed Description

Serializable object interface.

Member Enumeration Documentation

Deserialization flags (bit-field)

Enumerator
DF_POINT_COORDS_64_BITS 

Point coordinates are stored as 64 bits double (otherwise 32 bits floats)

DF_SCALAR_VAL_32_BITS 

Scalar values are stored as 32 bits floats (otherwise 64 bits double)

Member Function Documentation

static bool ccSerializableObject::CorruptError ( )
inlinestatic

Sends a custom error message (corrupted file) and returns 'false'.

Shortcut for returning a standardized error message in the fromFile method.

Returns
always false
virtual bool ccSerializableObject::fromFile ( QFile &  in,
short  dataVersion,
int  flags 
)
inlinevirtual

Loads data from binay stream.

Parameters
ininput file (already opened)
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
Returns
success

Reimplemented in ccGLMatrix, ccObject, ccHObject, ccColorScale, ccScalarField, ccIndexedTransformation, ccCustomHObject, and ccViewportParameters.

static bool ccSerializableObject::MemoryError ( )
inlinestatic

Sends a custom error message (not enough memory) and returns 'false'.

Shortcut for returning a standardized error message in the fromFile method.

Returns
always false
static bool ccSerializableObject::ReadError ( )
inlinestatic

Sends a custom error message (read error) and returns 'false'.

Shortcut for returning a standardized error message in the fromFile method.

Returns
always false
virtual bool ccSerializableObject::toFile ( QFile &  out) const
inlinevirtual

Saves data to binay stream.

Parameters
outoutput file (already opened)
Returns
success

Reimplemented in ccGLMatrix, ccObject, ccHObject, ccColorScale, ccScalarField, ccIndexedTransformation, and ccViewportParameters.

static bool ccSerializableObject::WriteError ( )
inlinestatic

Sends a custom error message (write error) and returns 'false'.

Shortcut for returning a standardized error message in the toFile method.

Returns
always false

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