ESA JPIP server  0.1
jpip::CacheModel::Codestream Class Reference

Sub-class of the cache model class used to identify a codestream. More...

#include <cache_model.h>

Collaboration diagram for jpip::CacheModel::Codestream:

Public Member Functions

 Codestream ()
 Initializes all the members to zero. More...
 
 Codestream (const Codestream &model)
 Copy constructor. More...
 
Codestreamoperator= (const Codestream &model)
 Copy assignment. More...
 
Codestreamoperator+= (const Codestream &model)
 Add the content of the given codestream cache model. More...
 
template<typename T >
T & SerializeWith (T &stream)
 
int GetMainHeader () const
 Returns the amount of the main header. More...
 
int GetTileHeader () const
 Returns the amount of the tile header. More...
 
int AddToMainHeader (int amount, bool complete=false)
 Increases the amount of the main header. More...
 
int AddToTileHeader (int amount, bool complete=false)
 Increases the amount of the tile header. More...
 
int GetPrecinct (int num_precinct)
 Returns the amount of a precinct. More...
 
int AddToPrecinct (int num_precinct, int amount, bool complete=false)
 Increases the amount of a precinct. More...
 
void Pack (int min_sum=1)
 Packs the information stored regarding the precincts, removing those initial elements that are consecutive and completes. More...
 

Private Attributes

int header
 Amount for the header. More...
 
int tile_header
 Amount for the tile-header. More...
 
vector< int > precincts
 Amount for the precincts. More...
 
int min_precinct
 Minimum identifier of the non-consecutive precinct completely sent. More...
 

Detailed Description

Sub-class of the cache model class used to identify a codestream.

This class is serializable.

Constructor & Destructor Documentation

jpip::CacheModel::Codestream::Codestream ( )
inline

Initializes all the members to zero.

jpip::CacheModel::Codestream::Codestream ( const Codestream model)
inline

Copy constructor.

Member Function Documentation

int jpip::CacheModel::Codestream::AddToMainHeader ( int  amount,
bool  complete = false 
)
inline

Increases the amount of the main header.

Parameters
amountAmount increment.
completetrue if the main header is complete after the increment.
Returns
the new amount value.

Here is the caller graph for this function:

int jpip::CacheModel::Codestream::AddToPrecinct ( int  num_precinct,
int  amount,
bool  complete = false 
)
inline

Increases the amount of a precinct.

Parameters
num_precinctIndex number of the precinct.
amountAmount increment.
completetrue if the precinct is complete after the increment.
Returns
the new amount value.

Here is the caller graph for this function:

int jpip::CacheModel::Codestream::AddToTileHeader ( int  amount,
bool  complete = false 
)
inline

Increases the amount of the tile header.

Parameters
amountAmount increment.
completetrue if the tile header is complete after the increment.
Returns
the new amount value.

Here is the caller graph for this function:

int jpip::CacheModel::Codestream::GetMainHeader ( ) const
inline

Returns the amount of the main header.

Here is the caller graph for this function:

int jpip::CacheModel::Codestream::GetPrecinct ( int  num_precinct)
inline

Returns the amount of a precinct.

Parameters
num_precinctIndex number of the precinct.

Here is the caller graph for this function:

int jpip::CacheModel::Codestream::GetTileHeader ( ) const
inline

Returns the amount of the tile header.

Here is the caller graph for this function:

Codestream& jpip::CacheModel::Codestream::operator+= ( const Codestream model)
inline

Add the content of the given codestream cache model.

Codestream& jpip::CacheModel::Codestream::operator= ( const Codestream model)
inline

Copy assignment.

Here is the call graph for this function:

void jpip::CacheModel::Codestream::Pack ( int  min_sum = 1)
inline

Packs the information stored regarding the precincts, removing those initial elements that are consecutive and completes.

Parameters
min_sumOnly the packing is performed if there are a number of items equal or greater than this value (1 by default).
template<typename T >
T& jpip::CacheModel::Codestream::SerializeWith ( T &  stream)
inline

Member Data Documentation

int jpip::CacheModel::Codestream::header
private

Amount for the header.

int jpip::CacheModel::Codestream::min_precinct
private

Minimum identifier of the non-consecutive precinct completely sent.

All the initial precincts already sent completely to the client are removed, so this value contains the next precinct. The vector precincts is related to the precincts starting from this index.

vector<int> jpip::CacheModel::Codestream::precincts
private

Amount for the precincts.

int jpip::CacheModel::Codestream::tile_header
private

Amount for the tile-header.


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