Conexus::Data Struct Reference
[Conexus]

#include <conexus/data.h>

List of all members.


Detailed Description

This structure represents a data block allocated via a smart pointer.

Additional it provides several typedefs that may be used to ensure type consistency both within the conexus library, and with applications using the conexus library.

Author:
Rick L Vinyard Jr


Public Types

typedef uint8_t Octet
 Typedefs the concept of an octet as an unsigned 8 bit integer.
typedef boost::shared_array<
Octet
Octets
 Provides a convenience typedef of a smart pointer to data.

Public Member Functions

 Data ()
 Default constructor initializes data size to zero and relies on smart pointer constructor to initialize pointer to NULL.
 Data (const void *d, size_t s)
 Constructor which accepts a pointer to data and size and creates a duplicate.
 Data (Octets d, size_t s)
 Constructor which accepts a smart pointer to data and data size in octets.
 Data (size_t s)
 Constructor which creates a data object of a given size in octets.
Data clone ()
 Performs a deep copy of this data object.
 operator Octet * ()
 Overloaded dereference operator provides direct access to actual data.
std::string hex_string (std::string separator=std::string())
 Returns a hex string representation of the data.
void clear ()
 Frees any allocated memory and resets size to 0.

Public Attributes

Octets data
 Smart pointer to the underlying data.
size_t size
 Size of the data in bytes.


Member Typedef Documentation

Data::Octets
 

Provides a convenience typedef of a smart pointer to data.

Hint: access externally as Data::Octets


Member Function Documentation

Data Conexus::Data::clone  )  [inline]
 

Performs a deep copy of this data object.

Assignment results in a shallow copy of this data object, which is in accordance with the semantics of the smart pointers used. However, at times a deep copy may be necessary. This method allocates a new memory chunk, copies the existing data into that data chunk, and returns an object containing a smart pointer to the underlying data.

Conexus::Data::operator Octet *  )  [inline]
 

Overloaded dereference operator provides direct access to actual data.

If you want access to the smart pointer, use the data member instead.


The documentation for this struct was generated from the following file:
Generated on Sun Aug 6 12:16:58 2006 by  doxygen 1.4.6