IGSTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
igstk::BinaryData Class Reference

BinaryData representing a binary data chunk. More...

#include <igstkBinaryData.h>

Public Types

typedef std::vector< unsigned
char > 
ContainerType
 Data container type definition. More...
 

Public Member Functions

 BinaryData ()
 Constructor. More...
 
 BinaryData (const char *encodedString)
 Constructor that copies data from an encoded string. More...
 
 BinaryData (const std::string &encodedString)
 Constructor that copies data from an encoded string. More...
 
virtual ~BinaryData ()
 Destructor. More...
 
void SetSize (unsigned int size)
 SetSize method resizes/allocates memory. More...
 
unsigned int GetSize () const
 GetSize method returns the size of data. More...
 
const ContainerTypeGetData () const
 Get a data container (returns constant) More...
 
ContainerTypeGetData ()
 Get a data container. More...
 
void CopyFrom (unsigned char *inputBegin, unsigned int inputLength)
 Copy data from an array. More...
 
void CopyTo (unsigned char *output) const
 Copy data into an array. More...
 
void Append (unsigned char byte)
 Append a byte. More...
 
void Append (const unsigned char *inputBegin, unsigned int inputLength)
 Append data from an array. More...
 
const BinaryDataoperator= (const BinaryData &inputBinaryData)
 Assign the values of one BinaryData to another. More...
 
bool operator== (const BinaryData &inputBinaryData) const
 operator== redefinition More...
 
bool operator!= (const BinaryData &inputBinaryData) const
 operator!= redefinition More...
 
bool operator< (const BinaryData &inputBinaryData) const
 operator< redefinition More...
 
unsigned char operator[] (const unsigned int index) const
 operator[] redefinition More...
 
unsigned char & operator[] (const unsigned int index)
 operator[] redefinition (returns reference) More...
 
 operator std::string () const
 operator that converts BinaryData to std::string type after encoding as ASCII More...
 
void Print (std::ostream &os, itk::Indent indent) const
 Method for printing the member variables of this class to an ostream. More...
 
bool Decode (const std::string &asciiString)
 Decode method decodes encoded ASCII string to binary data. More...
 

Static Public Member Functions

static void Encode (std::string &output, const unsigned char *data, unsigned int size)
 Encode method encodes binary data to ASCII string in std::string. More...
 

Protected Member Functions

void PrintHeader (std::ostream &os, itk::Indent indent) const
 Method for printing the header to an ostream. More...
 
void PrintTrailer (std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const
 Method for printing the trailer to an ostream. More...
 
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print the object information in a stream. More...
 

Detailed Description

BinaryData representing a binary data chunk.

This class represents a binary data chunk.

This class can be used for storing binary stream during communication.

Definition at line 38 of file igstkBinaryData.h.

Member Typedef Documentation

typedef std::vector<unsigned char> igstk::BinaryData::ContainerType

Data container type definition.

Definition at line 43 of file igstkBinaryData.h.

Constructor & Destructor Documentation

igstk::BinaryData::BinaryData ( )

Constructor.

igstk::BinaryData::BinaryData ( const char *  encodedString)

Constructor that copies data from an encoded string.

igstk::BinaryData::BinaryData ( const std::string &  encodedString)

Constructor that copies data from an encoded string.

virtual igstk::BinaryData::~BinaryData ( )
virtual

Destructor.

Member Function Documentation

void igstk::BinaryData::SetSize ( unsigned int  size)

SetSize method resizes/allocates memory.

unsigned int igstk::BinaryData::GetSize ( ) const

GetSize method returns the size of data.

const ContainerType& igstk::BinaryData::GetData ( ) const
inline

Get a data container (returns constant)

Definition at line 66 of file igstkBinaryData.h.

ContainerType& igstk::BinaryData::GetData ( )
inline

Get a data container.

Definition at line 69 of file igstkBinaryData.h.

void igstk::BinaryData::CopyFrom ( unsigned char *  inputBegin,
unsigned int  inputLength 
)

Copy data from an array.

void igstk::BinaryData::CopyTo ( unsigned char *  output) const

Copy data into an array.

void igstk::BinaryData::Append ( unsigned char  byte)

Append a byte.

void igstk::BinaryData::Append ( const unsigned char *  inputBegin,
unsigned int  inputLength 
)

Append data from an array.

const BinaryData& igstk::BinaryData::operator= ( const BinaryData inputBinaryData)

Assign the values of one BinaryData to another.

bool igstk::BinaryData::operator== ( const BinaryData inputBinaryData) const

operator== redefinition

bool igstk::BinaryData::operator!= ( const BinaryData inputBinaryData) const

operator!= redefinition

bool igstk::BinaryData::operator< ( const BinaryData inputBinaryData) const

operator< redefinition

unsigned char igstk::BinaryData::operator[] ( const unsigned int  index) const

operator[] redefinition

unsigned char& igstk::BinaryData::operator[] ( const unsigned int  index)

operator[] redefinition (returns reference)

igstk::BinaryData::operator std::string ( ) const

operator that converts BinaryData to std::string type after encoding as ASCII

void igstk::BinaryData::Print ( std::ostream &  os,
itk::Indent  indent 
) const

Method for printing the member variables of this class to an ostream.

static void igstk::BinaryData::Encode ( std::string &  output,
const unsigned char *  data,
unsigned int  size 
)
static

Encode method encodes binary data to ASCII string in std::string.

bool igstk::BinaryData::Decode ( const std::string &  asciiString)

Decode method decodes encoded ASCII string to binary data.

void igstk::BinaryData::PrintHeader ( std::ostream &  os,
itk::Indent  indent 
) const
protected

Method for printing the header to an ostream.

void igstk::BinaryData::PrintTrailer ( std::ostream &  itkNotUsedos,
itk::Indent   itkNotUsedindent 
) const
protected

Method for printing the trailer to an ostream.

virtual void igstk::BinaryData::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual

Print the object information in a stream.


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