#include <Compress.h>
|
| | Data (const char *source, size_t numBytes) |
| | Constructor which will create a Data object which contains a copy of the source data in compressed form.
|
| |
| | Data (Mode m=NONE) |
| | Default constructor.
|
| |
| char * | data () |
| |
| const char * | data () const |
| |
| char * | data (size_t idx) |
| |
| const char * | data (size_t idx) const |
| |
| Mode | getMode () const |
| |
| float | ratio () const |
| |
| size_t | size () const |
| |
| bool | valid () const |
| |
| | Referenced () |
| | Default constructor.
|
| |
| | Referenced (const Referenced &) |
| |
| template<typename T > |
| T * | as () |
| | Subclass casting.
|
| |
| template<typename T > |
| const T * | as () const |
| |
| template<typename T > |
| T * | asSafe () |
| | Safe subclass casting, return nullptr if template type does not match.
|
| |
| template<typename T > |
| const T * | asSafe () const |
| |
| int | getReferenceCount () const |
| |
| template<typename T > |
| bool | is () const |
| | Subclass test.
|
| |
| Referenced & | operator= (const Referenced &) |
| | Assignment operator. Will increment the number of references to the referenced object.
|
| |
| void | reference (void *ptr=nullptr) const |
| | Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
|
| |
| void | unreference (void *ptr=nullptr) const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it.
|
| |
| void | unreference_nodelete () const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it.
|
| |
Definition at line 72 of file Compress.h.
◆ Level
Specifies a compression level. Default is zlib default compression level.
| Enumerator |
|---|
| DEFAULT_COMPRESSION | |
| MIN_COMPRESSION | |
| MAX_COMPRESSION | |
Definition at line 83 of file Compress.h.
◆ Mode
| Enumerator |
|---|
| NONE | |
| COMPRESSED | |
| DECOMPRESSED | |
Definition at line 75 of file Compress.h.
◆ Data() [1/2]
| agxNet::Compress::Data::Data |
( |
Mode |
m = NONE | ) |
|
Default constructor.
- Parameters
-
◆ Data() [2/2]
| agxNet::Compress::Data::Data |
( |
const char * |
source, |
|
|
size_t |
numBytes |
|
) |
| |
Constructor which will create a Data object which contains a copy of the source data in compressed form.
I.e. mode will be COMPRESSED
◆ ~Data()
| virtual agxNet::Compress::Data::~Data |
( |
| ) |
|
|
protectedvirtual |
◆ allocate()
| void agxNet::Compress::Data::allocate |
( |
size_t |
numBytes | ) |
|
|
inlineprotected |
Resize the data-buffer to fit numBytes.
Definition at line 136 of file Compress.h.
◆ curr()
| size_t agxNet::Compress::Data::curr |
( |
| ) |
const |
|
inlineprotected |
- Returns
- index of the current position in the bit-stream
Definition at line 130 of file Compress.h.
◆ currData() [1/2]
| char * agxNet::Compress::Data::currData |
( |
| ) |
|
|
inlineprotected |
- Returns
- a pointer to the data-buffer at the current index (set by setCurr).
Definition at line 139 of file Compress.h.
◆ currData() [2/2]
| const char * agxNet::Compress::Data::currData |
( |
| ) |
const |
|
inlineprotected |
- Returns
- a const pointer to the data-buffer at the current index (set by setCurr).
Definition at line 142 of file Compress.h.
◆ data() [1/4]
| char * agxNet::Compress::Data::data |
( |
| ) |
|
|
inline |
- Returns
- a pointer to the bit-stream (compressed or non-compressed).
Definition at line 110 of file Compress.h.
◆ data() [2/4]
| const char * agxNet::Compress::Data::data |
( |
| ) |
const |
|
inline |
- Returns
- a const pointer to the bit-stream (compressed or non-compressed).
Definition at line 113 of file Compress.h.
◆ data() [3/4]
| char * agxNet::Compress::Data::data |
( |
size_t |
idx | ) |
|
|
inline |
- Returns
- a pointer to the bit-stream (compressed or non-compressed).
Definition at line 116 of file Compress.h.
◆ data() [4/4]
| const char * agxNet::Compress::Data::data |
( |
size_t |
idx | ) |
const |
|
inline |
- Returns
- a const pointer to the bit-stream (compressed or non-compressed).
Definition at line 119 of file Compress.h.
◆ finalize()
| void agxNet::Compress::Data::finalize |
( |
| ) |
|
|
protected |
Make data valid and call any finalization of the compression/decompression structures.
◆ getMode()
| Mode agxNet::Compress::Data::getMode |
( |
| ) |
const |
|
inline |
- Returns
- the current mode for the data, compressed/decompressed/none
Definition at line 91 of file Compress.h.
◆ init()
Initialize the compression/decompression with a specified compression level (only for compression)
◆ ratio()
| float agxNet::Compress::Data::ratio |
( |
| ) |
const |
|
inline |
- Returns
- the compression ratio of the data, for decompressed data it returns 1.0
Definition at line 125 of file Compress.h.
◆ setCurr()
| void agxNet::Compress::Data::setCurr |
( |
size_t |
curr | ) |
|
|
inlineprotected |
set the current position in the bit stream (determines the pointer address of the returned value from currData()
Definition at line 133 of file Compress.h.
◆ size()
| size_t agxNet::Compress::Data::size |
( |
| ) |
const |
|
inline |
- Returns
- the number of bytes in the data vector
Definition at line 107 of file Compress.h.
◆ trim()
| void agxNet::Compress::Data::trim |
( |
| ) |
|
|
protected |
◆ valid()
| bool agxNet::Compress::Data::valid |
( |
| ) |
const |
|
inline |
- Returns
- true if the data is valid, compression/uncompression was succesfully done.
Definition at line 122 of file Compress.h.
The documentation for this class was generated from the following file: