STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::binary_buffer_ref Class Reference

Detailed Description

binary_buffer_ref represents a memory area as pointer and valid length.

It is not deallocated or otherwise managed. This class can be used to pass around references to binary_buffer objects.

Definition at line 424 of file binary_buffer.h.

+ Inheritance diagram for stxxl::binary_buffer_ref:

Public Member Functions

 binary_buffer_ref (const binary_buffer &bb)
 Constructor, assign memory area from binary_buffer. More...
 
 binary_buffer_ref (const void *data, size_t n)
 Constructor, assign memory area from pointer and length. More...
 
 binary_buffer_ref (const std::string &str)
 Constructor, assign memory area from string, does NOT copy. More...
 
const void * data () const
 Return a pointer to the currently kept memory area. More...
 
bool operator!= (const binary_buffer_ref &br) const
 Compare contents of two binary_buffer_refs. More...
 
bool operator== (const binary_buffer_ref &br) const
 Compare contents of two binary_buffer_refs. More...
 
size_t size () const
 Return the currently valid length in bytes. More...
 
std::string str () const
 Explicit conversion to std::string (copies memory of course). More...
 

Protected Attributes

const char * m_data
 Allocated buffer pointer. More...
 
size_t m_size
 Size of valid data. More...
 

Constructor & Destructor Documentation

stxxl::binary_buffer_ref::binary_buffer_ref ( const binary_buffer bb)
inline

Constructor, assign memory area from binary_buffer.

Definition at line 435 of file binary_buffer.h.

stxxl::binary_buffer_ref::binary_buffer_ref ( const void *  data,
size_t  n 
)
inline

Constructor, assign memory area from pointer and length.

Definition at line 440 of file binary_buffer.h.

stxxl::binary_buffer_ref::binary_buffer_ref ( const std::string &  str)
inline

Constructor, assign memory area from string, does NOT copy.

Definition at line 445 of file binary_buffer.h.

Member Function Documentation

const void* stxxl::binary_buffer_ref::data ( ) const
inline

Return a pointer to the currently kept memory area.

Definition at line 450 of file binary_buffer.h.

bool stxxl::binary_buffer_ref::operator!= ( const binary_buffer_ref br) const
inline

Compare contents of two binary_buffer_refs.

Definition at line 469 of file binary_buffer.h.

References m_data, and m_size.

bool stxxl::binary_buffer_ref::operator== ( const binary_buffer_ref br) const
inline

Compare contents of two binary_buffer_refs.

Definition at line 462 of file binary_buffer.h.

References m_data, and m_size.

size_t stxxl::binary_buffer_ref::size ( ) const
inline

Return the currently valid length in bytes.

Definition at line 454 of file binary_buffer.h.

std::string stxxl::binary_buffer_ref::str ( ) const
inline

Explicit conversion to std::string (copies memory of course).

Definition at line 458 of file binary_buffer.h.

Member Data Documentation

const char* stxxl::binary_buffer_ref::m_data
protected

Allocated buffer pointer.

Definition at line 428 of file binary_buffer.h.

Referenced by operator!=(), and operator==().

size_t stxxl::binary_buffer_ref::m_size
protected

Size of valid data.

Definition at line 431 of file binary_buffer.h.

Referenced by operator!=(), and operator==().


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