byte_array Class Reference

A very common template for a dynamic array of bytes. More...

#include <byte_array.h>

Inheritance diagram for byte_array:

Inheritance graph
[legend]
Collaboration diagram for byte_array:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 byte_array (int number=0, const byte *initial_contents=NIL)
 constructs an array of "number" bytes from "initial_contents".
 byte_array (const byte_array &to_copy)
 constructs an array bytes by copying the "to_copy" array.
 byte_array (const array< byte > &to_copy)
 constructs an array bytes by copying the "to_copy" array.
 IMPLEMENT_CLASS_NAME ("byte_array")
bool operator== (const byte_array &to_compare) const
 returns true if "this" is equal to "to_compare".
bool operator!= (const byte_array &tc) const
 returns true if "this" is not equal to "to_compare".

Static Public Member Functions

static const byte_arrayempty_array ()
 returns an array of zero bytes.

Detailed Description

A very common template for a dynamic array of bytes.

byte_array provides a simple wrapper around array<byte>, but with the exponential growth and simple copy modes automatically enabled. Note that it is almost always best to forward declare byte_arrays in ones own headers rather than including this header.

Definition at line 31 of file byte_array.h.


Constructor & Destructor Documentation

byte_array::byte_array ( int  number = 0,
const byte initial_contents = NIL 
) [inline]

constructs an array of "number" bytes from "initial_contents".

Definition at line 34 of file byte_array.h.

byte_array::byte_array ( const byte_array to_copy  ) 

constructs an array bytes by copying the "to_copy" array.

Definition at line 25 of file byte_array.cpp.

byte_array::byte_array ( const array< byte > &  to_copy  )  [inline]

constructs an array bytes by copying the "to_copy" array.

Definition at line 39 of file byte_array.h.


Member Function Documentation

byte_array::IMPLEMENT_CLASS_NAME ( "byte_array"   ) 

const byte_array & byte_array::empty_array (  )  [static]

returns an array of zero bytes.

note that this is implemented in the opsystem library to avoid bad issues with static objects mixed into multiple dlls from a static library.

Definition at line 30 of file byte_array.cpp.

References __byte_array_empty_array().

Referenced by library_wide_cleanup::library_wide_cleanup().

bool byte_array::operator== ( const byte_array to_compare  )  const [inline]

returns true if "this" is equal to "to_compare".

Definition at line 51 of file byte_array.h.

References array< contents >::length(), and array< contents >::observe().

bool byte_array::operator!= ( const byte_array tc  )  const [inline]

returns true if "this" is not equal to "to_compare".

Definition at line 56 of file byte_array.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 23 04:34:59 2008 for HOOPLE Libraries by  doxygen 1.5.1