Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
BinObjMgt_Persistent Class Reference

Binary persistent representation of an object. Really it is used as a buffer for read/write an object. More...

#include <BinObjMgt_Persistent.hxx>

Public Member Functions

 BinObjMgt_Persistent ()
 Empty constructor.
 
BinObjMgt_PersistentPutCharacter (const char theValue)
 
BinObjMgt_Persistentoperator<< (const char theValue)
 
BinObjMgt_PersistentPutByte (const uint8_t theValue)
 
BinObjMgt_Persistentoperator<< (const uint8_t theValue)
 
BinObjMgt_PersistentPutExtCharacter (const char16_t theValue)
 
BinObjMgt_Persistentoperator<< (const char16_t theValue)
 
BinObjMgt_PersistentPutInteger (const int theValue)
 
BinObjMgt_Persistentoperator<< (const int theValue)
 
BinObjMgt_PersistentPutBoolean (const bool theValue)
 
BinObjMgt_Persistentoperator<< (const bool theValue)
 
BinObjMgt_PersistentPutReal (const double theValue)
 
BinObjMgt_Persistentoperator<< (const double theValue)
 
BinObjMgt_PersistentPutShortReal (const float theValue)
 
BinObjMgt_Persistentoperator<< (const float theValue)
 
BinObjMgt_PersistentPutCString (const char *const theValue)
 Offset in output buffer is not aligned.
 
BinObjMgt_Persistentoperator<< (const char *const theValue)
 
BinObjMgt_PersistentPutAsciiString (const TCollection_AsciiString &theValue)
 Offset in output buffer is word-aligned.
 
BinObjMgt_Persistentoperator<< (const TCollection_AsciiString &theValue)
 
BinObjMgt_PersistentPutExtendedString (const TCollection_ExtendedString &theValue)
 Offset in output buffer is word-aligned.
 
BinObjMgt_Persistentoperator<< (const TCollection_ExtendedString &theValue)
 
BinObjMgt_PersistentPutLabel (const TDF_Label &theValue)
 
BinObjMgt_Persistentoperator<< (const TDF_Label &theValue)
 
BinObjMgt_PersistentPutGUID (const Standard_GUID &theValue)
 
BinObjMgt_Persistentoperator<< (const Standard_GUID &theValue)
 
BinObjMgt_PersistentPutCharArray (const BinObjMgt_PChar theArray, const int theLength)
 Put C array of char, theLength is the number of elements.
 
BinObjMgt_PersistentPutByteArray (const BinObjMgt_PByte theArray, const int theLength)
 Put C array of unsigned chars, theLength is the number of elements.
 
BinObjMgt_PersistentPutExtCharArray (const BinObjMgt_PExtChar theArray, const int theLength)
 Put C array of ExtCharacter, theLength is the number of elements.
 
BinObjMgt_PersistentPutIntArray (const BinObjMgt_PInteger theArray, const int theLength)
 Put C array of int, theLength is the number of elements.
 
BinObjMgt_PersistentPutRealArray (const BinObjMgt_PReal theArray, const int theLength)
 Put C array of double, theLength is the number of elements.
 
BinObjMgt_PersistentPutShortRealArray (const BinObjMgt_PShortReal theArray, const int theLength)
 Put C array of float, theLength is the number of elements.
 
const BinObjMgt_PersistentGetCharacter (char &theValue) const
 
const BinObjMgt_Persistentoperator>> (char &theValue) const
 
const BinObjMgt_PersistentGetByte (uint8_t &theValue) const
 
const BinObjMgt_Persistentoperator>> (uint8_t &theValue) const
 
const BinObjMgt_PersistentGetExtCharacter (char16_t &theValue) const
 
const BinObjMgt_Persistentoperator>> (char16_t &theValue) const
 
const BinObjMgt_PersistentGetInteger (int &theValue) const
 
const BinObjMgt_Persistentoperator>> (int &theValue) const
 
const BinObjMgt_PersistentGetBoolean (bool &theValue) const
 
const BinObjMgt_Persistentoperator>> (bool &theValue) const
 
const BinObjMgt_PersistentGetReal (double &theValue) const
 
const BinObjMgt_Persistentoperator>> (double &theValue) const
 
const BinObjMgt_PersistentGetShortReal (float &theValue) const
 
const BinObjMgt_Persistentoperator>> (float &theValue) const
 
const BinObjMgt_PersistentGetAsciiString (TCollection_AsciiString &theValue) const
 
const BinObjMgt_Persistentoperator>> (TCollection_AsciiString &theValue) const
 
const BinObjMgt_PersistentGetExtendedString (TCollection_ExtendedString &theValue) const
 
const BinObjMgt_Persistentoperator>> (TCollection_ExtendedString &theValue) const
 
const BinObjMgt_PersistentGetLabel (const occ::handle< TDF_Data > &theDS, TDF_Label &theValue) const
 
const BinObjMgt_PersistentGetGUID (Standard_GUID &theValue) const
 
const BinObjMgt_Persistentoperator>> (Standard_GUID &theValue) const
 
const BinObjMgt_PersistentGetCharArray (const BinObjMgt_PChar theArray, const int theLength) const
 Get C array of char, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
const BinObjMgt_PersistentGetByteArray (const BinObjMgt_PByte theArray, const int theLength) const
 Get C array of unsigned chars, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
const BinObjMgt_PersistentGetExtCharArray (const BinObjMgt_PExtChar theArray, const int theLength) const
 Get C array of ExtCharacter, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
const BinObjMgt_PersistentGetIntArray (const BinObjMgt_PInteger theArray, const int theLength) const
 Get C array of int, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
const BinObjMgt_PersistentGetRealArray (const BinObjMgt_PReal theArray, const int theLength) const
 Get C array of double, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
const BinObjMgt_PersistentGetShortRealArray (const BinObjMgt_PShortReal theArray, const int theLength) const
 Get C array of float, theLength is the number of elements; theArray must point to a space enough to place theLength elements.
 
int Position () const
 Tells the current position for get/put.
 
bool SetPosition (const int thePos) const
 Sets the current position for get/put. Resets an error state depending on the validity of thePos. Returns the new state (value of IsOK())
 
void Truncate ()
 Truncates the buffer by current position, i.e. updates mySize.
 
bool IsError () const
 Indicates an error after Get methods or SetPosition.
 
bool operator! () const
 
bool IsOK () const
 Indicates a good state after Get methods or SetPosition.
 
 operator bool () const
 
void Init ()
 Initializes me to reuse again.
 
void SetId (const int theId)
 Sets the Id of the object.
 
void SetTypeId (const int theId)
 Sets the Id of the type of the object.
 
int Id () const
 Returns the Id of the object.
 
int TypeId () const
 Returns the Id of the type of the object.
 
int Length () const
 Returns the length of data.
 
Standard_OStreamWrite (Standard_OStream &theOS, const bool theDirectStream=false)
 Stores <me> to the stream. inline Standard_OStream& operator<< (Standard_OStream&, BinObjMgt_Persistent&) is also available. If theDirectStream is true, after this data the direct stream data is stored.
 
Standard_IStreamRead (Standard_IStream &theIS)
 Retrieves <me> from the stream. inline Standard_IStream& operator>> (Standard_IStream&, BinObjMgt_Persistent&) is also available.
 
void Destroy ()
 Frees the allocated memory; This object can be reused after call to Init.
 
 ~BinObjMgt_Persistent ()
 
void SetOStream (Standard_OStream &theStream)
 Sets the stream for direct writing.
 
void SetIStream (Standard_IStream &theStream)
 Sets the stream for direct reading.
 
Standard_OStreamGetOStream ()
 Gets the stream for and enables direct writing.
 
Standard_IStreamGetIStream ()
 Gets the stream for and enables direct reading.
 
bool IsDirect ()
 Returns true if after this record a direct writing to the stream is performed.
 
occ::handle< BinObjMgt_PositionStreamStart ()
 Returns the start position of the direct writing in the stream.
 

Detailed Description

Binary persistent representation of an object. Really it is used as a buffer for read/write an object.

It takes care of Little/Big endian by inversing bytes in objects of standard types (see FSD_FileHeader.hxx for the default value of DO_INVERSE).

Constructor & Destructor Documentation

◆ BinObjMgt_Persistent()

BinObjMgt_Persistent::BinObjMgt_Persistent ( )

Empty constructor.

◆ ~BinObjMgt_Persistent()

BinObjMgt_Persistent::~BinObjMgt_Persistent ( )
inline

Member Function Documentation

◆ Destroy()

void BinObjMgt_Persistent::Destroy ( )

Frees the allocated memory; This object can be reused after call to Init.

◆ GetAsciiString()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetAsciiString ( TCollection_AsciiString & theValue) const

◆ GetBoolean()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetBoolean ( bool & theValue) const

◆ GetByte()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetByte ( uint8_t & theValue) const

◆ GetByteArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetByteArray ( const BinObjMgt_PByte theArray,
const int theLength ) const

Get C array of unsigned chars, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ GetCharacter()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetCharacter ( char & theValue) const

◆ GetCharArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetCharArray ( const BinObjMgt_PChar theArray,
const int theLength ) const

Get C array of char, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ GetExtCharacter()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetExtCharacter ( char16_t & theValue) const

◆ GetExtCharArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetExtCharArray ( const BinObjMgt_PExtChar theArray,
const int theLength ) const

Get C array of ExtCharacter, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ GetExtendedString()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetExtendedString ( TCollection_ExtendedString & theValue) const

◆ GetGUID()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetGUID ( Standard_GUID & theValue) const

◆ GetIntArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetIntArray ( const BinObjMgt_PInteger theArray,
const int theLength ) const

Get C array of int, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ GetInteger()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetInteger ( int & theValue) const

◆ GetIStream()

Standard_IStream * BinObjMgt_Persistent::GetIStream ( )

Gets the stream for and enables direct reading.

◆ GetLabel()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetLabel ( const occ::handle< TDF_Data > & theDS,
TDF_Label & theValue ) const

◆ GetOStream()

Standard_OStream * BinObjMgt_Persistent::GetOStream ( )

Gets the stream for and enables direct writing.

◆ GetReal()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetReal ( double & theValue) const

◆ GetRealArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetRealArray ( const BinObjMgt_PReal theArray,
const int theLength ) const

Get C array of double, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ GetShortReal()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetShortReal ( float & theValue) const

◆ GetShortRealArray()

const BinObjMgt_Persistent & BinObjMgt_Persistent::GetShortRealArray ( const BinObjMgt_PShortReal theArray,
const int theLength ) const

Get C array of float, theLength is the number of elements; theArray must point to a space enough to place theLength elements.

◆ Id()

int BinObjMgt_Persistent::Id ( ) const

Returns the Id of the object.

◆ Init()

void BinObjMgt_Persistent::Init ( )

Initializes me to reuse again.

◆ IsDirect()

bool BinObjMgt_Persistent::IsDirect ( )
inline

Returns true if after this record a direct writing to the stream is performed.

◆ IsError()

bool BinObjMgt_Persistent::IsError ( ) const

Indicates an error after Get methods or SetPosition.

◆ IsOK()

bool BinObjMgt_Persistent::IsOK ( ) const

Indicates a good state after Get methods or SetPosition.

◆ Length()

int BinObjMgt_Persistent::Length ( ) const

Returns the length of data.

◆ operator bool()

BinObjMgt_Persistent::operator bool ( ) const
inline

◆ operator!()

bool BinObjMgt_Persistent::operator! ( ) const
inline

◆ operator<<() [1/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const bool theValue)
inline

◆ operator<<() [2/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const char *const theValue)
inline

◆ operator<<() [3/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const char theValue)
inline

◆ operator<<() [4/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const char16_t theValue)
inline

◆ operator<<() [5/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const double theValue)
inline

◆ operator<<() [6/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const float theValue)
inline

◆ operator<<() [7/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const int theValue)
inline

◆ operator<<() [8/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const Standard_GUID & theValue)
inline

◆ operator<<() [9/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const TCollection_AsciiString & theValue)
inline

◆ operator<<() [10/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const TCollection_ExtendedString & theValue)
inline

◆ operator<<() [11/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const TDF_Label & theValue)
inline

◆ operator<<() [12/12]

BinObjMgt_Persistent & BinObjMgt_Persistent::operator<< ( const uint8_t theValue)
inline

◆ operator>>() [1/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( bool & theValue) const
inline

◆ operator>>() [2/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( char & theValue) const
inline

◆ operator>>() [3/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( char16_t & theValue) const
inline

◆ operator>>() [4/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( double & theValue) const
inline

◆ operator>>() [5/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( float & theValue) const
inline

◆ operator>>() [6/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( int & theValue) const
inline

◆ operator>>() [7/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( Standard_GUID & theValue) const
inline

◆ operator>>() [8/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( TCollection_AsciiString & theValue) const
inline

◆ operator>>() [9/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( TCollection_ExtendedString & theValue) const
inline

◆ operator>>() [10/10]

const BinObjMgt_Persistent & BinObjMgt_Persistent::operator>> ( uint8_t & theValue) const
inline

◆ Position()

int BinObjMgt_Persistent::Position ( ) const

Tells the current position for get/put.

◆ PutAsciiString()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutAsciiString ( const TCollection_AsciiString & theValue)

Offset in output buffer is word-aligned.

◆ PutBoolean()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutBoolean ( const bool theValue)

◆ PutByte()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutByte ( const uint8_t theValue)

◆ PutByteArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutByteArray ( const BinObjMgt_PByte theArray,
const int theLength )

Put C array of unsigned chars, theLength is the number of elements.

◆ PutCharacter()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutCharacter ( const char theValue)

◆ PutCharArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutCharArray ( const BinObjMgt_PChar theArray,
const int theLength )

Put C array of char, theLength is the number of elements.

◆ PutCString()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutCString ( const char *const theValue)

Offset in output buffer is not aligned.

◆ PutExtCharacter()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutExtCharacter ( const char16_t theValue)

◆ PutExtCharArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutExtCharArray ( const BinObjMgt_PExtChar theArray,
const int theLength )

Put C array of ExtCharacter, theLength is the number of elements.

◆ PutExtendedString()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutExtendedString ( const TCollection_ExtendedString & theValue)

Offset in output buffer is word-aligned.

◆ PutGUID()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutGUID ( const Standard_GUID & theValue)

◆ PutIntArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutIntArray ( const BinObjMgt_PInteger theArray,
const int theLength )

Put C array of int, theLength is the number of elements.

◆ PutInteger()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutInteger ( const int theValue)

◆ PutLabel()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutLabel ( const TDF_Label & theValue)

◆ PutReal()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutReal ( const double theValue)

◆ PutRealArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutRealArray ( const BinObjMgt_PReal theArray,
const int theLength )

Put C array of double, theLength is the number of elements.

◆ PutShortReal()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutShortReal ( const float theValue)

◆ PutShortRealArray()

BinObjMgt_Persistent & BinObjMgt_Persistent::PutShortRealArray ( const BinObjMgt_PShortReal theArray,
const int theLength )

Put C array of float, theLength is the number of elements.

◆ Read()

Standard_IStream & BinObjMgt_Persistent::Read ( Standard_IStream & theIS)

Retrieves <me> from the stream. inline Standard_IStream& operator>> (Standard_IStream&, BinObjMgt_Persistent&) is also available.

◆ SetId()

void BinObjMgt_Persistent::SetId ( const int theId)

Sets the Id of the object.

◆ SetIStream()

void BinObjMgt_Persistent::SetIStream ( Standard_IStream & theStream)
inline

Sets the stream for direct reading.

◆ SetOStream()

void BinObjMgt_Persistent::SetOStream ( Standard_OStream & theStream)
inline

Sets the stream for direct writing.

◆ SetPosition()

bool BinObjMgt_Persistent::SetPosition ( const int thePos) const

Sets the current position for get/put. Resets an error state depending on the validity of thePos. Returns the new state (value of IsOK())

◆ SetTypeId()

void BinObjMgt_Persistent::SetTypeId ( const int theId)

Sets the Id of the type of the object.

◆ StreamStart()

occ::handle< BinObjMgt_Position > BinObjMgt_Persistent::StreamStart ( )
inline

Returns the start position of the direct writing in the stream.

◆ Truncate()

void BinObjMgt_Persistent::Truncate ( )

Truncates the buffer by current position, i.e. updates mySize.

◆ TypeId()

int BinObjMgt_Persistent::TypeId ( ) const

Returns the Id of the type of the object.

◆ Write()

Standard_OStream & BinObjMgt_Persistent::Write ( Standard_OStream & theOS,
const bool theDirectStream = false )

Stores <me> to the stream. inline Standard_OStream& operator<< (Standard_OStream&, BinObjMgt_Persistent&) is also available. If theDirectStream is true, after this data the direct stream data is stored.


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