#include <Compress.h>
|
| | Data (Mode m=NONE) |
| | Default constructor. More...
|
| |
| | 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. More...
|
| |
| template<typename T > |
| T * | as () |
| | Subclass casting. More...
|
| |
| template<typename T > |
| const T * | as () const |
| |
| template<typename T > |
| T * | asSafe () |
| | Safe subclass casting, return nullptr if template type does not match. More...
|
| |
| template<typename T > |
| const T * | asSafe () const |
| |
| char * | data () |
| |
| const char * | data () const |
| |
| char * | data (size_t idx) |
| |
| const char * | data (size_t idx) const |
| |
| Mode | getMode () const |
| |
| int | getReferenceCount () const |
| |
| template<typename T > |
| bool | is () const |
| | Subclass test. More...
|
| |
| float | ratio () const |
| |
| void | reference (void *ptr=nullptr) const |
| | Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
|
| |
| size_t | size () const |
| |
| void | unreference (void *ptr=nullptr) const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
|
| |
| void | unreference_nodelete () const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
|
| |
| bool | valid () const |
| |
Definition at line 73 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 84 of file Compress.h.
◆ Mode
| Enumerator |
|---|
| NONE | |
| COMPRESSED | |
| DECOMPRESSED | |
Definition at line 76 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 137 of file Compress.h.
◆ allocateObserverVector()
| void agx::Referenced::allocateObserverVector |
( |
| ) |
const |
|
protectedinherited |
◆ as() [1/2]
template<typename T >
| T* agx::Referenced::as |
( |
| ) |
|
|
inherited |
◆ as() [2/2]
template<typename T >
| const T* agx::Referenced::as |
( |
| ) |
const |
|
inherited |
◆ asSafe() [1/2]
template<typename T >
| T* agx::Referenced::asSafe |
( |
| ) |
|
|
inherited |
◆ asSafe() [2/2]
template<typename T >
| const T* agx::Referenced::asSafe |
( |
| ) |
const |
|
inherited |
◆ curr()
| size_t agxNet::Compress::Data::curr |
( |
| ) |
const |
|
inlineprotected |
- Returns
- index of the current position in the bit-stream
Definition at line 131 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 140 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 143 of file Compress.h.
References agx::init().
◆ data() [1/4]
| char* agxNet::Compress::Data::data |
( |
| ) |
|
|
inline |
- Returns
- a pointer to the bit-stream (compressed or non-compressed).
Definition at line 111 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 114 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 117 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 120 of file Compress.h.
◆ deleteUsingDeleteHandler()
| void agx::Referenced::deleteUsingDeleteHandler |
( |
| ) |
const |
|
protectedinherited |
◆ finalize()
| void agxNet::Compress::Data::finalize |
( |
| ) |
|
|
protected |
Make data valid and call any finalization of the compression/decompression structures.
◆ getDeleteHandler()
◆ getMode()
| Mode agxNet::Compress::Data::getMode |
( |
| ) |
const |
|
inline |
- Returns
- the current mode for the data, compressed/decompressed/none
Definition at line 92 of file Compress.h.
◆ getReferenceCount()
| int agx::Referenced::getReferenceCount |
( |
| ) |
const |
|
inherited |
- Returns
- the number pointers currently referencing this object.
◆ init()
Initialize the compression/decompression with a specified compression level (only for compression)
◆ is()
template<typename T >
| bool agx::Referenced::is |
( |
| ) |
const |
|
inherited |
◆ 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 126 of file Compress.h.
◆ reference()
| void agx::Referenced::reference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
◆ 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 134 of file Compress.h.
References agx::min().
◆ setDeleteHandler()
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
◆ size()
| size_t agxNet::Compress::Data::size |
( |
| ) |
const |
|
inline |
- Returns
- the number of bytes in the data vector
Definition at line 108 of file Compress.h.
◆ trim()
| void agxNet::Compress::Data::trim |
( |
| ) |
|
|
protected |
◆ unreference()
| void agx::Referenced::unreference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
◆ unreference_nodelete()
| void agx::Referenced::unreference_nodelete |
( |
| ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
◆ valid()
| bool agxNet::Compress::Data::valid |
( |
| ) |
const |
|
inline |
- Returns
- true if the data is valid, compression/uncompression was succesfully done.
Definition at line 123 of file Compress.h.
◆ ValidateCast()
template<typename T >
| static bool agx::Referenced::ValidateCast |
( |
const Referenced * |
object | ) |
|
|
staticinherited |
◆ m_mutex
| Mutex agx::Referenced::m_mutex |
|
mutableprotectedinherited |
◆ m_observers
|
|
mutableprotectedinherited |
◆ m_refCount
| AtomicValue agx::Referenced::m_refCount |
|
mutableprotectedinherited |
The documentation for this class was generated from the following file: