Rhino C++ API  7.21
Public Member Functions | Public Attributes | List of all members
ON_CompressedBuffer Class Reference

#include <opennurbs_compress.h>

Public Member Functions

 ON_CompressedBuffer ()
 
 ON_CompressedBuffer (const ON_CompressedBuffer &src)
 
 ~ON_CompressedBuffer ()
 
bool Compress (size_t sizeof__inbuffer, const void *inbuffer, int sizeof_element)
 
bool CompressionEnd (struct ON_CompressedBufferHelper *) const
 
bool CompressionInit (struct ON_CompressedBufferHelper *) const
 
size_t DeflateHelper (struct ON_CompressedBufferHelper *, size_t sizeof___inbuffer, const void *in___buffer)
 
void Destroy ()
 
bool InflateHelper (struct ON_CompressedBufferHelper *, size_t sizeof___outbuffer, void *out___buffer) const
 
ON_CompressedBufferoperator= (const ON_CompressedBuffer &src)
 
bool Read (ON_BinaryArchive &binary_archive)
 
size_t SizeOfUncompressedBuffer () const
 
bool Uncompress (void *outbuffer, int *bFailedCRC) const
 
bool Write (ON_BinaryArchive &binary_archive) const
 
bool WriteChar (size_t count, const void *buffer)
 

Public Attributes

void * m_buffer_compressed
 
size_t m_buffer_compressed_capacity
 
ON__UINT32 m_crc_compressed
 
ON__UINT32 m_crc_uncompressed
 
int m_method
 0 = copied, 1 = compressed More...
 
size_t m_sizeof_compressed
 
int m_sizeof_element
 
size_t m_sizeof_uncompressed
 

Constructor & Destructor Documentation

◆ ON_CompressedBuffer() [1/2]

ON_CompressedBuffer::ON_CompressedBuffer ( )

◆ ~ON_CompressedBuffer()

ON_CompressedBuffer::~ON_CompressedBuffer ( )

◆ ON_CompressedBuffer() [2/2]

ON_CompressedBuffer::ON_CompressedBuffer ( const ON_CompressedBuffer src)

Member Function Documentation

◆ Compress()

bool ON_CompressedBuffer::Compress ( size_t  sizeof__inbuffer,
const void *  inbuffer,
int  sizeof_element 
)

Description: Compress inbuffer. Parameters: sizeof__inbuffer - [in] Number of bytes in inbuffer. inbuffer - [in] Uncompressed information. sizeof_element - [out] This parameter only matters if the buffer will be compressed, and decompressed on CPUs with different endianness. If this is the case, then the types in the buffer need to have the same size (2,4, or 8). Returns: True if inbuffer is successfully compressed.

Parameters
sizeof__inbuffersizeof uncompressed input data
inbufferuncompressed input data

◆ CompressionEnd()

bool ON_CompressedBuffer::CompressionEnd ( struct ON_CompressedBufferHelper *  ) const

◆ CompressionInit()

bool ON_CompressedBuffer::CompressionInit ( struct ON_CompressedBufferHelper *  ) const

Implementation

◆ DeflateHelper()

size_t ON_CompressedBuffer::DeflateHelper ( struct ON_CompressedBufferHelper *  ,
size_t  sizeof___inbuffer,
const void *  in___buffer 
)
Parameters
sizeof___inbuffersizeof uncompressed input data ( > 0 )
in___bufferuncompressed input data ( != nullptr )

◆ Destroy()

void ON_CompressedBuffer::Destroy ( )

Description: Destroy the current informtion in the ON_CompressedBuffer so the class can be reused.

◆ InflateHelper()

bool ON_CompressedBuffer::InflateHelper ( struct ON_CompressedBufferHelper *  ,
size_t  sizeof___outbuffer,
void *  out___buffer 
) const
Parameters
sizeof___outbuffersizeof uncompressed data
out___bufferbuffer for uncompressed data

◆ operator=()

ON_CompressedBuffer& ON_CompressedBuffer::operator= ( const ON_CompressedBuffer src)

◆ Read()

bool ON_CompressedBuffer::Read ( ON_BinaryArchive binary_archive)

◆ SizeOfUncompressedBuffer()

size_t ON_CompressedBuffer::SizeOfUncompressedBuffer ( ) const

Returns: Number of bytes in the uncompressed information.

◆ Uncompress()

bool ON_CompressedBuffer::Uncompress ( void *  outbuffer,
int *  bFailedCRC 
) const

Description: Uncompress the contents of this ON_CompressedBuffer. Parameters: outbuffer - [in/out] This buffer must have at least SizeOfUncompressedBuffer() bytes. If the function returns true, then the uncopressed information is stored in this buffer. bFailedCRC - [out] If not null, then this boolean is set to true if the CRC of the uncompressed information has changed. Returns: True if uncompressed information is returned in outbuffer.

Parameters
outbufferread and uncompress uncompressed output data returned here

◆ Write()

bool ON_CompressedBuffer::Write ( ON_BinaryArchive binary_archive) const

◆ WriteChar()

bool ON_CompressedBuffer::WriteChar ( size_t  count,
const void *  buffer 
)

Member Data Documentation

◆ m_buffer_compressed

void* ON_CompressedBuffer::m_buffer_compressed

◆ m_buffer_compressed_capacity

size_t ON_CompressedBuffer::m_buffer_compressed_capacity

◆ m_crc_compressed

ON__UINT32 ON_CompressedBuffer::m_crc_compressed

◆ m_crc_uncompressed

ON__UINT32 ON_CompressedBuffer::m_crc_uncompressed

◆ m_method

int ON_CompressedBuffer::m_method

0 = copied, 1 = compressed

◆ m_sizeof_compressed

size_t ON_CompressedBuffer::m_sizeof_compressed

◆ m_sizeof_element

int ON_CompressedBuffer::m_sizeof_element

◆ m_sizeof_uncompressed

size_t ON_CompressedBuffer::m_sizeof_uncompressed