ESA JPIP server  0.1
jpip::CacheModel Class Reference

The cache model of a JPIP client is handled using this class. More...

#include <cache_model.h>

Collaboration diagram for jpip::CacheModel:

Classes

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

Public Member Functions

 CacheModel ()
 Empty constructor. More...
 
 CacheModel (const CacheModel &model)
 Copy constructor. More...
 
CacheModeloperator= (const CacheModel &model)
 Copy assignment. More...
 
CacheModeloperator+= (const CacheModel &model)
 Add the content of the given cache model. More...
 
template<typename T >
T & SerializeWith (T &stream)
 
CodestreamGetCodestream (int num_codestream)
 Returns the reference of a codestream. More...
 
int GetMetadata (int id)
 Returns the amount of a meta-data. More...
 
int AddToMetadata (int id, int amount, bool complete=false)
 Increases the amount of a meta-data. More...
 
template<int BIN_CLASS>
int GetDataBin (int num_codestream, int id)
 Returns the amount of a data-bin item using the class DataBinSelector. More...
 
template<int BIN_CLASS>
int AddToDataBin (int num_codestream, int id, int amount, bool complete=false)
 Increases the amount of a data-bin item using the class DataBinSelector. More...
 
bool IsFullMetadata () const
 Returns the full flag of the meta-datas. More...
 
void SetFullMetadata ()
 Sets the full flag for the meta-datas to true. More...
 
void Pack (int min_sum=1)
 Calls the Pack method of all the codestreams. More...
 
void Clear ()
 Clear all the amounts. More...
 
virtual ~CacheModel ()
 

Private Attributes

bool full_meta
 Says if the meta-data has been totally sent. More...
 
vector< int > meta_data
 Amounts for the meta-datas. More...
 
vector< Codestreamcodestreams
 Amounts for the codestreams. More...
 

Detailed Description

The cache model of a JPIP client is handled using this class.

It allows to maintain a cache model recording the amount of data sent by the server regarding the meta-datas, headers, tile-headers and precincts. This implementation only allows to record incremental amounts, from the beginning of each entity. The value INT_MAX is used to specify that an item is complete. This class is serializable.

Constructor & Destructor Documentation

jpip::CacheModel::CacheModel ( )
inline

Empty constructor.

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

Copy constructor.

virtual jpip::CacheModel::~CacheModel ( )
inlinevirtual

Member Function Documentation

template<int BIN_CLASS>
int jpip::CacheModel::AddToDataBin ( int  num_codestream,
int  id,
int  amount,
bool  complete = false 
)
inline

Increases the amount of a data-bin item using the class DataBinSelector.

Parameters
num_codestreamIndex number of the associated codestream.
idIndex number of the data-bin.
amountAmount increment.
completetrue if the data-bin is complete after the increment.
Returns
the new amount value.
int jpip::CacheModel::AddToMetadata ( int  id,
int  amount,
bool  complete = false 
)
inline

Increases the amount of a meta-data.

Parameters
idIndex number of the meta-data.
amountAmount increment.
completetrue if the meta-data is complete after the increment.
Returns
the new amount value.

Here is the caller graph for this function:

void jpip::CacheModel::Clear ( )
inline

Clear all the amounts.

Here is the caller graph for this function:

Codestream& jpip::CacheModel::GetCodestream ( int  num_codestream)
inline

Returns the reference of a codestream.

Parameters
num_codestreamIndex number of the codestream.

Here is the caller graph for this function:

template<int BIN_CLASS>
int jpip::CacheModel::GetDataBin ( int  num_codestream,
int  id 
)
inline

Returns the amount of a data-bin item using the class DataBinSelector.

Parameters
num_codestreamIndex number of the associated codestream.
idIndex number of the data-bin.
int jpip::CacheModel::GetMetadata ( int  id)
inline

Returns the amount of a meta-data.

Parameters
idIndex number of the meta-data.

Here is the caller graph for this function:

bool jpip::CacheModel::IsFullMetadata ( ) const
inline

Returns the full flag of the meta-datas.

Here is the caller graph for this function:

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

Add the content of the given cache model.

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

Copy assignment.

Here is the call graph for this function:

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

Calls the Pack method of all the codestreams.

Here is the caller graph for this function:

template<typename T >
T& jpip::CacheModel::SerializeWith ( T &  stream)
inline
void jpip::CacheModel::SetFullMetadata ( )
inline

Sets the full flag for the meta-datas to true.

Here is the caller graph for this function:

Member Data Documentation

vector<Codestream> jpip::CacheModel::codestreams
private

Amounts for the codestreams.

bool jpip::CacheModel::full_meta
private

Says if the meta-data has been totally sent.

vector<int> jpip::CacheModel::meta_data
private

Amounts for the meta-datas.


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