ESA JPIP server  0.1
jpip::DataBinWriter Class Reference

Class used to generate data-bin segments and write them into a memory buffer. More...

#include <databin_writer.h>

Collaboration diagram for jpip::DataBinWriter:

Public Member Functions

 DataBinWriter ()
 Initializes the object. More...
 
DataBinWriter & SetBuffer (char *buf, int buf_len)
 Sets the associated memory buffer. More...
 
DataBinWriter & ClearPreviousIds ()
 Clears the previous identifiers of data-bin class and codestream index numbers. More...
 
DataBinWriter & SetCodestream (int value)
 Sets the current codestream. More...
 
DataBinWriter & SetDataBinClass (int databin_class)
 Sets the current data-bin class. More...
 
DataBinWriter & Write (uint64_t bin_id, uint64_t bin_offset, const File &file, const FileSegment &segment, bool last_byte=false)
 Writes a data-bin segment into the buffer. More...
 
DataBinWriter & WritePlaceHolder (uint64_t bin_id, uint64_t bin_offset, const File &file, const PlaceHolder &place_holder, bool last_byte=false)
 Writes a place-holder segment into the buffer. More...
 
DataBinWriter & WriteEmpty (uint64_t bin_id=0)
 Writes an empty segment. More...
 
int GetCount () const
 Returns the number of bytes written. More...
 
int GetFree () const
 Returns the number of bytes available. More...
 
DataBinWriter & WriteEOR (int reason)
 Writes a EOR message into the buffer. More...
 
 operator bool () const
 Returns the EOF status of the object. More...
 
virtual ~DataBinWriter ()
 

Private Member Functions

template<typename T >
DataBinWriter & WriteValue (T value)
 Writes a value into the buffer. More...
 
DataBinWriter & WriteVBAS (uint64_t value)
 Writes a new integer value into the buffer coded as VBAS. More...
 
DataBinWriter & WriteHeader (uint64_t bin_id, uint64_t bin_offset, uint64_t bin_length, bool last_byte=false)
 Writes a data-bin header into the buffer. More...
 

Private Attributes

bool eof
 true if the end of the buffer has been reached and the last value could not be written. More...
 
char * ini
 Pointer to the beginning of the buffer. More...
 
char * ptr
 Current position of the buffer. More...
 
char * end
 Pointer to the end of the buffer. More...
 
int databin_class
 Current data-bin class. More...
 
int codestream_idx
 Current codestream index number. More...
 
int prev_databin_class
 Previous data-bin class. More...
 
int prev_codestream_idx
 Previous codestream index number. More...
 

Detailed Description

Class used to generate data-bin segments and write them into a memory buffer.

See also
DataBinServer
DataBinClass
EOR

Constructor & Destructor Documentation

jpip::DataBinWriter::DataBinWriter ( )
inline

Initializes the object.

virtual jpip::DataBinWriter::~DataBinWriter ( )
inlinevirtual

Member Function Documentation

DataBinWriter& jpip::DataBinWriter::ClearPreviousIds ( )
inline

Clears the previous identifiers of data-bin class and codestream index numbers.

Returns
The object itself.

Here is the caller graph for this function:

int jpip::DataBinWriter::GetCount ( ) const
inline

Returns the number of bytes written.

Here is the caller graph for this function:

int jpip::DataBinWriter::GetFree ( ) const
inline

Returns the number of bytes available.

Here is the caller graph for this function:

jpip::DataBinWriter::operator bool ( ) const
inline

Returns the EOF status of the object.

DataBinWriter& jpip::DataBinWriter::SetBuffer ( char *  buf,
int  buf_len 
)
inline

Sets the associated memory buffer.

Parameters
bufMemory buffer.
buf_lenLength of the memory buffer.
Returns
The object itself.

Here is the caller graph for this function:

DataBinWriter& jpip::DataBinWriter::SetCodestream ( int  value)
inline

Sets the current codestream.

Parameters
valueIndex number of the codestream.
Returns
The object itself.

Here is the caller graph for this function:

DataBinWriter& jpip::DataBinWriter::SetDataBinClass ( int  databin_class)
inline

Sets the current data-bin class.

Parameters
databin_classData-bin class.
Returns
The object itself.

Here is the caller graph for this function:

DataBinWriter & jpip::DataBinWriter::Write ( uint64_t  bin_id,
uint64_t  bin_offset,
const File &  file,
const FileSegment &  segment,
bool  last_byte = false 
)

Writes a data-bin segment into the buffer.

Parameters
bin_idData-bin identifier.
bin_offsetData-bin offset.
fileFile from where to read the data.
segmentFile segment of the data.
last_bytetrue if the data contains the last byte of the data-bin.
Returns
The object itself.

Here is the call graph for this function:

Here is the caller graph for this function:

DataBinWriter & jpip::DataBinWriter::WriteEmpty ( uint64_t  bin_id = 0)

Writes an empty segment.

Parameters
bin_idData-bin identifier.
Returns
The object itself.

Here is the call graph for this function:

DataBinWriter& jpip::DataBinWriter::WriteEOR ( int  reason)
inline

Writes a EOR message into the buffer.

Parameters
reasonReason of the message.
Returns
The object itself.

Here is the caller graph for this function:

DataBinWriter & jpip::DataBinWriter::WriteHeader ( uint64_t  bin_id,
uint64_t  bin_offset,
uint64_t  bin_length,
bool  last_byte = false 
)
private

Writes a data-bin header into the buffer.

Parameters
bin_idData-bin identifier.
bin_offsetData-bin offset.
bin_lengthData-bin length.
last_bytetrue if the data related to this header contains the last byte of the data-bin.
Returns
The object itself.

Here is the call graph for this function:

Here is the caller graph for this function:

DataBinWriter & jpip::DataBinWriter::WritePlaceHolder ( uint64_t  bin_id,
uint64_t  bin_offset,
const File &  file,
const PlaceHolder &  place_holder,
bool  last_byte = false 
)

Writes a place-holder segment into the buffer.

Parameters
bin_idData-bin identifier.
bin_offsetData-bin offset.
fileFile from where to read the data.
place_holderPlace-holder information.
last_bytetrue if the data contains the last byte of the data-bin.
Returns
The object itself.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
DataBinWriter& jpip::DataBinWriter::WriteValue ( T  value)
inlineprivate

Writes a value into the buffer.

Parameters
valueValue to write.
Returns
The object itself.
DataBinWriter & jpip::DataBinWriter::WriteVBAS ( uint64_t  value)
private

Writes a new integer value into the buffer coded as VBAS.

Parameters
valueValue to write.
Returns
The object itself.

Here is the caller graph for this function:

Member Data Documentation

int jpip::DataBinWriter::codestream_idx
private

Current codestream index number.

int jpip::DataBinWriter::databin_class
private

Current data-bin class.

char* jpip::DataBinWriter::end
private

Pointer to the end of the buffer.

bool jpip::DataBinWriter::eof
private

true if the end of the buffer has been reached and the last value could not be written.

char* jpip::DataBinWriter::ini
private

Pointer to the beginning of the buffer.

int jpip::DataBinWriter::prev_codestream_idx
private

Previous codestream index number.

int jpip::DataBinWriter::prev_databin_class
private

Previous data-bin class.

char* jpip::DataBinWriter::ptr
private

Current position of the buffer.


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