EasyUSB::Data Class Reference

Data structure for the USB system. More...


Public Member Functions

template<typename Type>
void Assign (const Type &Data) throw (Errors::NotEnoughMemory)
 Assigns data of specified type to the object.
void CopyContent (char *pData, unsigned long Length)
 Copies the data to the specified address.
 Data (std::wstring String) throw (Errors::NotEnoughMemory)
 Data (std::string String) throw (Errors::NotEnoughMemory)
 Data (char *pc, unsigned long len) throw (Errors::NotEnoughMemory)
 Data (unsigned long Size) throw (Errors::NotEnoughMemory)
 Data (const Data &Orig) throw (Errors::NotEnoughMemory)
 Copy constructor.
 Data ()
 Constructor.
template<typename Type>
Type GetCustom () const throw (Errors::BufferTooSmall)
 Gets the data for the specified type.
unsigned long GetLength () const
 Gets the length of bytes currently stored by this object.
 operator char () const
 operator char * () const
 operator int () const
 operator long () const
 operator long long () const
 operator short () const
 operator std::string () const
 operator std::wstring () const
 operator unsigned char () const
 operator unsigned int () const
 operator unsigned long () const
 operator unsigned long long () const
 operator unsigned short () const
Dataoperator= (const long long &l)
Dataoperator= (const unsigned long long &l)
Dataoperator= (const long &l)
Dataoperator= (const unsigned long &l)
Dataoperator= (const int &i)
Dataoperator= (const unsigned int &i)
Dataoperator= (const short &s)
Dataoperator= (const unsigned short &s)
Dataoperator= (const char &c)
Dataoperator= (const unsigned char &c)
Dataoperator= (const Data &NewData) throw (Errors::NotEnoughMemory)
 Assignment operator.
void Reserve (unsigned long Size) throw (Errors::NotEnoughMemory)
 Reserves some bytes and fills them with zeros.
void Resize (unsigned long Size) throw (Errors::NotEnoughMemory)
 Resizes the object to the specified size.
 ~Data ()
 Destructor.

Protected Attributes

unsigned long m_Length
 The length of the data in bytes.
char * m_pData
 The data.


Detailed Description

Data structure for the USB system.

Constructor & Destructor Documentation

EasyUSB::Data::Data (  ) 

Constructor.

EasyUSB::Data::Data ( const Data Orig  )  throw (Errors::NotEnoughMemory)

Copy constructor.

EasyUSB::Data::~Data (  ) 

Destructor.

EasyUSB::Data::Data ( unsigned long  Size  )  throw (Errors::NotEnoughMemory) [explicit]

EasyUSB::Data::Data ( char *  pc,
unsigned long  len 
) throw (Errors::NotEnoughMemory)

EasyUSB::Data::Data ( std::string  String  )  throw (Errors::NotEnoughMemory)

EasyUSB::Data::Data ( std::wstring  String  )  throw (Errors::NotEnoughMemory)


Member Function Documentation

template<typename Type>
void EasyUSB::Data::Assign ( const Type &  Data  )  throw (Errors::NotEnoughMemory) [inline]

Assigns data of specified type to the object.

Parameters:
Data The data to assign.
Exceptions:
NotEnoughMemory Not enough memory to complete the operation.
Note:
The needed size is determined with the sizeof-operator.

void EasyUSB::Data::CopyContent ( char *  pData,
unsigned long  Length 
)

Copies the data to the specified address.

Parameters:
pData The address to copy the data to.
Length The length in bytes of the given buffer.
Note:
The user must allocate the buffer and is responsible for it.

template<typename Type>
Type EasyUSB::Data::GetCustom (  )  const throw (Errors::BufferTooSmall) [inline]

Gets the data for the specified type.

Returns:
The data in the given type.
Note:
The object data is type-casted to the specified type.

unsigned long EasyUSB::Data::GetLength (  )  const [inline]

Gets the length of bytes currently stored by this object.

Returns:
The length in bytes.

EasyUSB::Data::operator char (  )  const [inline]

EasyUSB::Data::operator char * (  )  const [inline]

EasyUSB::Data::operator int (  )  const [inline]

EasyUSB::Data::operator long (  )  const [inline]

EasyUSB::Data::operator long long (  )  const [inline]

EasyUSB::Data::operator short (  )  const [inline]

EasyUSB::Data::operator std::string (  )  const

EasyUSB::Data::operator std::wstring (  )  const

EasyUSB::Data::operator unsigned char (  )  const [inline]

EasyUSB::Data::operator unsigned int (  )  const [inline]

EasyUSB::Data::operator unsigned long (  )  const [inline]

EasyUSB::Data::operator unsigned long long (  )  const [inline]

EasyUSB::Data::operator unsigned short (  )  const [inline]

Data& EasyUSB::Data::operator= ( const long long &  l  )  [inline]

Data& EasyUSB::Data::operator= ( const unsigned long long &  l  )  [inline]

Data& EasyUSB::Data::operator= ( const long &  l  )  [inline]

Data& EasyUSB::Data::operator= ( const unsigned long &  l  )  [inline]

Data& EasyUSB::Data::operator= ( const int &  i  )  [inline]

Data& EasyUSB::Data::operator= ( const unsigned int &  i  )  [inline]

Data& EasyUSB::Data::operator= ( const short &  s  )  [inline]

Data& EasyUSB::Data::operator= ( const unsigned short &  s  )  [inline]

Data& EasyUSB::Data::operator= ( const char &  c  )  [inline]

Data& EasyUSB::Data::operator= ( const unsigned char &  c  )  [inline]

Data& EasyUSB::Data::operator= ( const Data NewData  )  throw (Errors::NotEnoughMemory)

Assignment operator.

void EasyUSB::Data::Reserve ( unsigned long  Size  )  throw (Errors::NotEnoughMemory)

Reserves some bytes and fills them with zeros.

Parameters:
Size The new size in bytes of this object.
Exceptions:
NotEnoughMemory Not enough memory to complete the operation.
Note:
Previously contained data is destroyed.

void EasyUSB::Data::Resize ( unsigned long  Size  )  throw (Errors::NotEnoughMemory)

Resizes the object to the specified size.

Parameters:
Size The new size in bytes.
Exceptions:
NotEnoughMemory Not enough memory to complete the operation.
Note:
If the new size is greater than the old size, the data is padded with zeros.
If the new size is smaller, the data is truncated.


Field Documentation

unsigned long EasyUSB::Data::m_Length [protected]

The length of the data in bytes.

char* EasyUSB::Data::m_pData [protected]

The data.


Generated on Tue Nov 4 22:13:26 2008 for EasyUSB Connect by  doxygen 1.5.6