Contains the core functionality of a (JPIP) data-bin server, which maintains a cache model and is capable of generating data chunks of variable length;.
More...
#include <databin_server.h>
|
template<int BIN_CLASS> |
int | WriteSegment (int num_codestream, int id, FileSegment segment, int offset=0, bool last=true) |
| Writes a new data-bin segment or a part of it that is not already cached. More...
|
|
int | WritePlaceHolder (int num_codestream, int id, const PlaceHolder &place_holder, int offset=0, bool last=false) |
| Writes a new place-holder segment, only if it is possible to write it completely. More...
|
|
Contains the core functionality of a (JPIP) data-bin server, which maintains a cache model and is capable of generating data chunks of variable length;.
Enumerator |
---|
MINIMUM_SPACE |
Minimum space in the chunk.
|
jpip::DataBinServer::DataBinServer |
( |
| ) |
|
|
inline |
virtual jpip::DataBinServer::~DataBinServer |
( |
| ) |
|
|
inlinevirtual |
bool jpip::DataBinServer::end_woi |
( |
| ) |
const |
|
inline |
Returns true
if the end of the WOI has been reached, that is, there is not more associated packets to send.
bool jpip::DataBinServer::GenerateChunk |
( |
char * |
buff, |
|
|
int * |
len, |
|
|
bool * |
last |
|
) |
| |
Generates a new chunk of data for the current image and WOI, according to the last indicated request.
- Parameters
-
buff | Pointer to the memory buffer. |
len | Length of the memory buffer. It is modified by the method to indicate how many bytes have been written to the buffer. |
last | Output parameter to indicates if this is the last chunk of data associated to the last request. |
- Returns
true
if successful.
Resets the server assigning a new image to serve.
It also resets the maintained cache model.
- Parameters
-
image_index | Pointer to the new image index to use. |
- Returns
true
if successful.
bool jpip::DataBinServer::SetRequest |
( |
const Request & |
req | ) |
|
Sets the new current request to take into account for generating the chunks of data.
- Parameters
-
- Returns
true
if successful.
int jpip::DataBinServer::WritePlaceHolder |
( |
int |
num_codestream, |
|
|
int |
id, |
|
|
const PlaceHolder & |
place_holder, |
|
|
int |
offset = 0 , |
|
|
bool |
last = false |
|
) |
| |
|
inlineprivate |
Writes a new place-holder segment, only if it is possible to write it completely.
- Parameters
-
num_codestream | Index number of the codestream. |
id | Data-bin identifier. |
place_holder | Place-holder information. |
offset | Data-bin offset of the data (0 by default). |
last | true if this is the last data of the data-bin. |
- Returns
- 1 if the segment content was completely written and/or cached, 0 if it was incompletely written (or not at all, if EOF flag is set), or -1 if an error was generated.
template<int BIN_CLASS>
int jpip::DataBinServer::WriteSegment |
( |
int |
num_codestream, |
|
|
int |
id, |
|
|
FileSegment |
segment, |
|
|
int |
offset = 0 , |
|
|
bool |
last = true |
|
) |
| |
|
inlineprivate |
Writes a new data-bin segment or a part of it that is not already cached.
- Parameters
-
num_codestream | Index number of the codestream. |
id | Data-bin identifier. |
segment | File segment associated. |
offset | Data-bin offset of the data (0 by default). |
last | true if this is the last data of the data-bin. |
- Returns
- 1 if the segment content was completely written and/or cached, 0 if it was incompletely written (or not at all, if EOF flag is set), or -1 if an error was generated.
Cache model of the client.
int jpip::DataBinServer::current_idx |
|
private |
Current codestream index.
Data-bin writer for generating the chunks.
bool jpip::DataBinServer::end_woi_ |
|
private |
true
if the WOI has been completely sent
bool jpip::DataBinServer::eof |
|
private |
true
if the end has been reached and the last write operation could not be completed.
Pointer to the associated image file.
List of files (for hyperlinked JPX files)
bool jpip::DataBinServer::has_woi |
|
private |
true
if the last request contained a WOI
Pointer to the associated image index.
bool jpip::DataBinServer::metareq |
|
private |
true
if the last request contained a "metareq"
int jpip::DataBinServer::pending |
|
private |
Range jpip::DataBinServer::range |
|
private |
WOI jpip::DataBinServer::woi |
|
private |
WOI composer for determining the packets.
The documentation for this class was generated from the following files: