Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

L1394::QArray Class Reference

A QArray represents an dynamic array of Quadlets. More...

#include <l1394_qarray.h>

List of all members.

Public Member Functions

Constructors
These are the different constructors to create a QArray.

 QArray (int size)
 Create a Qarray with a certain size.
 QArray (const QArray &qarray)
 Copy constructor.
 ~QArray ()
 Destructor.
Manipulate a QArray
These functions manipulate the values stored in a QArray.

void append (const QArray &qarray)
 This method appends an QArray to the end of a QArray.
void insert (const Quadlet value, const unsigned int position)
 This method inserts a quadlet at a specific position in the array and overwrites the old value.
void insert (const u_int32_t value, const unsigned int position)
 This method inserts am u_int32_t value at a specific position in the array and overwrites the old value.
Quadlet getQuadlet (const unsigned int i) const
 This method returns the i'th Quadlet in an array.
int getByte (const unsigned int i) const
 This method returns the i'th byte of the array.
void setByte (const unsigned int i, const unsigned int value)
 This method sets byte i of the QArray to a specific value.
Convert a QArray
These functions convert a QArray to another basic type.

void toIntArray (u_int32_t *) const
 This method converts a QArray to an integer array (for compatibility use only).
void toCharArray (u_char *) const
 This method converts the value of a QArray to an u_char array.
int getSize () const
 This method returns the size of a QArray.
Some operators
QArrayoperator= (const QArray &)
 This method sets the value of this QArray to the value of qarray.
bool operator== (const QArray &)
 This method compare two QArrays.

Friends

ostream & operator<< (ostream &output, const QArray &array)
 This method prints the QArray to ostream.


Detailed Description

A QArray represents an dynamic array of Quadlets.

Like Quadlets, QArrays are one of the basic data types in this library to communicate with FireWire nodes. If you send more than 4 bytes to a FireWire node you should use an QArray.
The QArray stores also information about the size of the array. It provides most of the functionality like a Quadlet (without the compute operators).

This class also provides functions to convert a QArray to an integer array or a char array.

Author:
Michael Repplinger

Definition at line 41 of file l1394_qarray.h.


Constructor & Destructor Documentation

L1394::QArray::QArray int  size  ) 
 

Create a Qarray with a certain size.

Parameters:
size : Set the size of a QArray.

Definition at line 21 of file l1394_qarray.cpp.

L1394::QArray::QArray const QArray qa  ) 
 

Copy constructor.

Parameters:
qarray : reference to the QArray

Definition at line 37 of file l1394_qarray.cpp.

References internal_size, qarray, and size.

L1394::QArray::~QArray  ) 
 

Destructor.

Definition at line 46 of file l1394_qarray.cpp.


Member Function Documentation

L1394::QArray::append const QArray qarray  ) 
 

This method appends an QArray to the end of a QArray.

Parameters:
qarray : array to append.

Definition at line 51 of file l1394_qarray.cpp.

References getQuadlet(), and getSize().

L1394::QArray::getByte const unsigned int  i  )  const [inline]
 

This method returns the i'th byte of the array.

The range of i depends on the size of your QArray and is between 0<= i < size*4. Byte 0 are the 8 most significant bits of the array

Returns:
int : integer value of the i'th byte of the array.

Definition at line 120 of file l1394_qarray.h.

References getByte().

Referenced by getByte(), and L1394::AvcCameraRegister::setValue().

L1394::QArray::getQuadlet const unsigned int  i  )  const [inline]
 

This method returns the i'th Quadlet in an array.

Valid values are from 0 to length-1. If you try to get a Quadlet from position >= length, a Quadlet with value 0 is returned

Parameters:
i : integer value for the position
Returns:
Quadlet : the i'th Quadlet. If i>= size a empty Quadlet is returned

Definition at line 110 of file l1394_qarray.h.

Referenced by append(), L1394::internal::BusInfo::BusInfo(), L1394::FcpNode::decode(), L1394::Card::readAGuid(), and L1394::internal::Transaction::send().

L1394::QArray::getSize  )  const [inline]
 

This method returns the size of a QArray.

Returns:
int : the size of the QArray

Definition at line 161 of file l1394_qarray.h.

Referenced by append(), L1394::AvcCameraRegister::getValue(), L1394::Card::readAGuid(), L1394::internal::Transaction::send(), and L1394::AvcCameraRegister::setValue().

L1394::QArray::insert const u_int32_t  value,
const unsigned int  position
 

This method inserts am u_int32_t value at a specific position in the array and overwrites the old value.

If you try to insert a value to an invalid position, the value will not be insert.

Parameters:
value : u_int32_t Integer to insert
position : unsigned integer value for the position.

Definition at line 85 of file l1394_qarray.cpp.

L1394::QArray::insert const Quadlet  value,
const unsigned int  i
 

This method inserts a quadlet at a specific position in the array and overwrites the old value.

If you try to insert a value to an invalid position, the value will not be set.

Parameters:
value : Quadlet to insert
position : unsigned integer value for the position

Definition at line 77 of file l1394_qarray.cpp.

Referenced by L1394::FcpNode::getSubunitInfo(), L1394::FcpNode::getUnitInfo(), L1394::Card::readTopoMap(), L1394::internal::BusTopology::readTopoMap(), and L1394::AvcRegister::reset().

L1394::QArray::operator= const QArray qarray  ) 
 

This method sets the value of this QArray to the value of qarray.

If this QArray is bigger than qarray, the last Quadlets are unchanged. If this QArray is smaller, this QArray will be resized to the size of qarray.

Definition at line 107 of file l1394_qarray.cpp.

References L1394::Quadlet::fromInt(), internal_size, qarray, and size.

L1394::QArray::operator== const QArray qarray  ) 
 

This method compare two QArrays.

Two QArrays with equal size are equal, if all their Quadlets are equal. Two QArrays with different size are equal, if all Quadlets of the smaller QArray are equal to the bigger one.

Returns:
bool : return true if two QArrays are equal, false if not.

Definition at line 132 of file l1394_qarray.cpp.

References qarray, and size.

L1394::QArray::setByte const unsigned int  i,
const unsigned int  value
 

This method sets byte i of the QArray to a specific value.

The range of i depends on the size of your QArray and is between 0<= i < size*4.

Parameters:
i : unsigned integer for the position
value : unsigned integer for the value

Definition at line 153 of file l1394_qarray.cpp.

References L1394::Quadlet::setByte().

Referenced by L1394::AvcCameraRegister::automatic(), L1394::AvcRegister::defaultSet(), L1394::AvcCameraRegister::getValue(), L1394::AvcRegister::hasFeature(), L1394::AvcCameraRegister::hasFeature(), L1394::AvcCameraRegister::onePush(), L1394::AvcRegister::reset(), L1394::AvcRegister::setCtype(), L1394::AvcRegister::setOpcode(), L1394::AvcRegister::setSubfunction(), L1394::AvcCameraRegister::setValue(), and L1394::AvcRegister::status().

L1394::QArray::toCharArray u_char *  data  )  const
 

This method converts the value of a QArray to an u_char array.

The size of the u_char array is size of the QArray * 4. Note, that the programmer are responsible to delete this array.

Returns:
u_char* : pointer to the u_char array.

Definition at line 147 of file l1394_qarray.cpp.

References L1394::Quadlet::getByte().

L1394::QArray::toIntArray u_int32_t *  data  )  const
 

This method converts a QArray to an integer array (for compatibility use only).

The integer array has the same size like the QArray. The programmer is responsible to delete this array.

Returns:
u_int32_t* : pointer to the integer array.

Definition at line 101 of file l1394_qarray.cpp.

References L1394::Quadlet::toInt().

Referenced by L1394::internal::Transaction::send().


Friends And Related Function Documentation

L1394::QArray::operator<< ostream &  output,
const QArray qarray
[friend]
 

This method prints the QArray to ostream.

Parameters:
output : reference to the output stream.
qarray : reference to the QArray.
Returns:
ostream& : reference to the output ostream.


The documentation for this class was generated from the following files:
Generated on Wed Aug 24 00:36:44 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/