VOS::COD Class Reference
[libvos]
#include <vos/vos/cod.hh>
Inheritance diagram for VOS::COD:

Detailed Description
COD stands for Compact Object Description.It is a binary file format for saving and loading Vobjects, and (in the form of the RemoteCOD subclass) is also used for efficient batch downloads of the state of many remote vobjects.
Definition at line 27 of file cod.hh.
Public Member Functions
- COD (Site &ls)
- COD (const VobjectStore &vs)
- virtual ~COD ()
- virtual void writeVobjects (std::ostream &output, ImpExpEnv &environment)
- Write the current COD to the initialized iostream.
- Write the current COD to the initialized iostream.
- virtual void writeVobjects (unsigned char **buffer, unsigned int *size, ImpExpEnv &environment)
- Write the current COD to a buffer.
- Write the current COD to a buffer.
- virtual void readVobjects (std::istream &input, ImpExpEnv &environment)
- Read a COD from the supplied input stream.
- Read a COD from the supplied input stream.
- virtual void readVobjects (unsigned char *buffer, unsigned int size, ImpExpEnv &environment)
- Read the COD from the supplied data buffer.
- Read the COD from the supplied data buffer.
- virtual int computeSize ()
- Computes the output size of the COD.
- Computes the output size of the COD.
- virtual void setProgressMeter (ProgressMeterCallback *cb)
- Set a progress meter callback to be called periodically to indicate the progress of unpacking the COD file.
- Set a progress meter callback to be called periodically to indicate the progress of unpacking the COD file.
Protected Member Functions
- void write (const char *data, unsigned int size)
- void write (const unsigned char *data, unsigned int size)
- void read (char *data, unsigned int size)
- void read (unsigned char *data, unsigned int size)
- virtual int writeObjectDesc (Entry *v, bool doWrite=true)
- virtual int writeObjectChildren (Vobject *v, bool doWrite=true)
- virtual std::string readStr ()
- virtual uint16_t readShort ()
- virtual uint32_t readLong ()
- virtual void readObjectDesc (std::string &name, uint32_t &pos, std::deque< std::string > &types, MessageBlock &mb)
- virtual void readObjectChildren (std::string &parent, std::deque< PCR > &children)
- virtual bool checkCOD ()
- virtual void doReadVobjects ()
Protected Attributes
- std::istream * inputstream
- unsigned int offset
- unsigned int buffersize
- unsigned char * buffer
- ProgressMeterCallback * progress
Constructor & Destructor Documentation
| VOS::COD::COD | ( | Site & | ls | ) |
Constructor.
Does not initialize with an iostream, so you will have to supply a buffer when you call readCOD or writeCOD.
- Parameters:
-
ls The local site any new vobjects will be created on.
| VOS::COD::COD | ( | const VobjectStore & | vs | ) |
| virtual VOS::COD::~COD | ( | ) | [virtual] |
Destructor.
Member Function Documentation
| virtual bool VOS::COD::checkCOD | ( | ) | [protected, virtual] |
| virtual int VOS::COD::computeSize | ( | ) | [virtual] |
| virtual void VOS::COD::doReadVobjects | ( | ) | [protected, virtual] |
Reimplemented in VOS::RemoteCOD.
| void VOS::COD::read | ( | unsigned char * | data, | |
| unsigned int | size | |||
| ) | [protected] |
| void VOS::COD::read | ( | char * | data, | |
| unsigned int | size | |||
| ) | [protected] |
| virtual uint32_t VOS::COD::readLong | ( | ) | [protected, virtual] |
| virtual void VOS::COD::readObjectChildren | ( | std::string & | parent, | |
| std::deque< PCR > & | children | |||
| ) | [protected, virtual] |
| virtual void VOS::COD::readObjectDesc | ( | std::string & | name, | |
| uint32_t & | pos, | |||
| std::deque< std::string > & | types, | |||
| MessageBlock & | mb | |||
| ) | [protected, virtual] |
| virtual uint16_t VOS::COD::readShort | ( | ) | [protected, virtual] |
| virtual std::string VOS::COD::readStr | ( | ) | [protected, virtual] |
| virtual void VOS::COD::readVobjects | ( | unsigned char * | buffer, | |
| unsigned int | size, | |||
| ImpExpEnv & | environment | |||
| ) | [virtual] |
Read the COD from the supplied data buffer.
- Parameters:
-
buffer the source data size the length of the data
Implements VOS::VobjectInput.
| virtual void VOS::COD::readVobjects | ( | std::istream & | input, | |
| ImpExpEnv & | environment | |||
| ) | [virtual] |
| virtual void VOS::COD::setProgressMeter | ( | ProgressMeterCallback * | cb | ) | [inline, virtual] |
| void VOS::COD::write | ( | const unsigned char * | data, | |
| unsigned int | size | |||
| ) | [protected] |
| void VOS::COD::write | ( | const char * | data, | |
| unsigned int | size | |||
| ) | [protected] |
| virtual int VOS::COD::writeObjectChildren | ( | Vobject * | v, | |
| bool | doWrite = true | |||
| ) | [protected, virtual] |
| virtual int VOS::COD::writeObjectDesc | ( | Entry * | v, | |
| bool | doWrite = true | |||
| ) | [protected, virtual] |
| virtual void VOS::COD::writeVobjects | ( | unsigned char ** | buffer, | |
| unsigned int * | size, | |||
| ImpExpEnv & | environment | |||
| ) | [virtual] |
Write the current COD to a buffer.
The buffer is malloc()'d by writeCOD and returned via the supplied parameters.
- Parameters:
-
buffer the data buffer holding the COD data. You should free() this when you're done. size the size of the buffer
Implements VOS::VobjectOutput.
| virtual void VOS::COD::writeVobjects | ( | std::ostream & | output, | |
| ImpExpEnv & | environment | |||
| ) | [virtual] |
Member Data Documentation
unsigned char* VOS::COD::buffer [protected] |
unsigned int VOS::COD::buffersize [protected] |
std::istream* VOS::COD::inputstream [protected] |
unsigned int VOS::COD::offset [protected] |
ProgressMeterCallback* VOS::COD::progress [protected] |
The documentation for this class was generated from the following file:
- /home/tetron/hack/vos/libs/vos/vos/cod.hh