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

L1394::Quadlet Class Reference

This class stores a Quadlet and provides functions to manipulate it. More...

#include <l1394_quadlet.h>

List of all members.

Computing operator

These functions implements some computing operators for Quadlets.

Quadletoperator= (const Quadlet &)
 operator= assigns the data q to this quadlet and returns a reference to it.
bool operator== (const Quadlet &)
 operator== compares two Quadlets and returns true if they are equal, false if not
bool operator!= (const Quadlet &)
 operator!= compares Quadlet q with this Quadlet
const Quadlet operator+ (const Quadlet &, const Quadlet &)
 operator+ adds the value of Quadlet q_1 and q_2 and returns the reference to it.
const Quadlet operator+ (const u_int32_t &, const Quadlet &)
 operator+ adds the value of Quadlet q to this Quadlet and returns the reference to it.
const Quadlet operator- (const u_int32_t &data, const Quadlet &)
 operator+ adds the value of Quadlet q to this Quadlet and returns the reference to it.
const Quadlet operator- (const Quadlet &q, const Quadlet &)
 operator- subtract the value of data from this Quadlet and returns the reference to it.

Public Member Functions

Constructors
These are the different constructors to create a Quadlet.

 Quadlet ()
 Constructs an empty quadlet.
 Quadlet (const char *)
 Constructs an quadlet from a char array.
 Quadlet (const u_int32_t)
 Constructs an quadlet from an int.
 Quadlet (const string &)
 Constructs an quadlet from a string.
 Quadlet (const Quadlet &)
 Constructs a copy of ref.
 ~Quadlet ()
 Destructs the object.
Manipulate the Quadlet
These functions manipulate the value of a certain range of the Quadlet.

u_int32_t getByte (const int) const
 This method returns the i'th byte of the quadlet. (value between 0..3).
void setByte (const int i, const u_int32_t value)
 This method sets the i'th byte (0..3) to value.
u_int32_t getBitRange (const int start, const int end) const
 This method returns the bit range from start to end as integer.
void setBitRange (const int start, const int end, const u_int32_t value)
 This method sets the bitrange from start to end to a value.
int getBit (const int) const
 This method returns the i'th bit (value between 0..31).
void setBit (const int i, const int value)
 Sets the i'th bit to value.
Convert a Quadlet
These functions convert a Quadlet to another basic type.

u_int32_t toInt () const
 This method converts a quadlet to a 32 bit integer value.
void fromInt (u_int32_t value)
 This method converts a 32 bit integer to a quadlet.
string toString () const
 This method converts a Quadlet to a string.
char * toCharArray (char *, int) const
 converts a Quadlet to a char*

Friends

ostream & operator<< (ostream &, const Quadlet &)
 operator<< writes the Quadlet to a stream and returns a reference to it.
istream & operator>> (istream &, Quadlet &)
 operator>> reads 4 bytes from a stream, stores the value in the Quadlet and returns a reference to the stream


Detailed Description

This class stores a Quadlet and provides functions to manipulate it.

A Quadlet is one of the base data-types of this library and represents the atomic unit of information that can be read or write to a FireWire node. The Quadlet stores 4 byte and is realized as an char array.
This class provides also a lot of functions to manipulate the bits and bytes.

The location 31 is msb, location 0 is lsb.

Author:
Michael Mirold, Michael Repplinger

Definition at line 44 of file l1394_quadlet.h.


Constructor & Destructor Documentation

L1394::Quadlet::Quadlet  ) 
 

Constructs an empty quadlet.

Definition at line 17 of file l1394_quadlet.cpp.

L1394::Quadlet::Quadlet const char *  data  ) 
 

Constructs an quadlet from a char array.

Parameters:
value,: const char pointer on an char array containing the data.

Definition at line 22 of file l1394_quadlet.cpp.

L1394::Quadlet::Quadlet const   u_int32_t  ) 
 

Constructs an quadlet from an int.

Parameters:
data : Integer value representing the data.

Definition at line 27 of file l1394_quadlet.cpp.

L1394::Quadlet::Quadlet const string &  data  ) 
 

Constructs an quadlet from a string.

Parameters:
data : String representing the data.

Definition at line 34 of file l1394_quadlet.cpp.

L1394::Quadlet::Quadlet const Quadlet  ) 
 

Constructs a copy of ref.

Definition at line 39 of file l1394_quadlet.cpp.

References quadlet.

L1394::Quadlet::~Quadlet  )  [inline]
 

Destructs the object.

Definition at line 87 of file l1394_quadlet.h.


Member Function Documentation

L1394::Quadlet::fromInt u_int32_t  value  ) 
 

This method converts a 32 bit integer to a quadlet.

Parameters:
value : value for the Quadlet

Definition at line 236 of file l1394_quadlet.cpp.

Referenced by L1394::DccRegister::DccRegister(), L1394::DccCamera::init(), L1394::internal::Transaction::lock(), L1394::QArray::operator=(), L1394::internal::Transaction::read(), setBitRange(), and L1394::DccCamera::setVideoMode().

L1394::Quadlet::getBit const   int  )  const
 

This method returns the i'th bit (value between 0..31).

Parameters:
bit : int with the i'th position
Returns:
int : value 0 or 1.

Definition at line 190 of file l1394_quadlet.cpp.

Referenced by L1394::DccRegister::automatic(), L1394::internal::BusInfo::getBmc(), L1394::internal::BusInfo::getCmc(), L1394::internal::BusInfo::getIrmc(), L1394::internal::BusInfo::getIsc(), L1394::internal::TopoNode::getLinkActive(), L1394::DccRegister::hasAuto(), L1394::DccRegister::hasFeature(), L1394::DccCamera::hasFramerate(), L1394::DccRegister::hasManual(), L1394::DccRegister::hasOnePush(), L1394::DccRegister::hasOnOff(), L1394::DccRegister::hasReadout(), L1394::DccCamera::hasVideoFormat(), L1394::DccRegister::on(), L1394::DccRegister::onePush(), L1394::Card::releaseIsoChannel(), L1394::Card::requestIsoChannel(), L1394::DccCamera::setParameter(), L1394::DccRegister::setTriggerPolarity(), and L1394::DccCamera::shot().

L1394::Quadlet::getBitRange const int  start,
const int  end
const
 

This method returns the bit range from start to end as integer.

Parameters:
start : startvalue of the bitrange.
end : endvalue of the bitrange.

Definition at line 117 of file l1394_quadlet.cpp.

References toInt().

Referenced by L1394::internal::BusInfo::getChipIdHi(), L1394::internal::BusInfo::getCykClk(), L1394::internal::TopoNode::getGapCount(), L1394::internal::BusInfo::getMaxRec(), L1394::DccRegister::getMaxValue(), L1394::DccRegister::getMinValue(), L1394::internal::BusInfo::getNodeVendorId(), L1394::internal::TopoNode::getPhyDelay(), L1394::internal::TopoNode::getPhyId(), L1394::internal::TopoNode::getPhySpeed(), L1394::internal::TopoNode::getPwrClass(), L1394::DccRegister::getValue(), L1394::Card::readTopoMap(), L1394::internal::BusTopology::readTopoMap(), L1394::DccRegister::setTriggerMode(), and L1394::DccRegister::setValue().

L1394::Quadlet::getByte const   int  )  const
 

This method returns the i'th byte of the quadlet. (value between 0..3).

Parameters:
byte : The position of the byte.

Definition at line 89 of file l1394_quadlet.cpp.

Referenced by L1394::FcpNode::decode(), L1394::AvcVcr::getTimeCode(), L1394::AvcCameraRegister::getValue(), L1394::AvcRegister::hasFeature(), L1394::AvcCameraRegister::hasFeature(), L1394::AvcCameraRegister::onePush(), L1394::AvcRegister::send(), and L1394::QArray::toCharArray().

L1394::Quadlet::operator!= const Quadlet q  ) 
 

operator!= compares Quadlet q with this Quadlet

Parameters:
q : Quadlet that should be compared
Returns:
bool : return true if q is not equal to this Quadlet, false if not.

Definition at line 81 of file l1394_quadlet.cpp.

L1394::Quadlet::operator= const Quadlet q  ) 
 

operator= assigns the data q to this quadlet and returns a reference to it.

Parameters:
q : Quadlet that will be assigned
Returns:
Quadlet : Reference to this Quadlet

Definition at line 66 of file l1394_quadlet.cpp.

References quadlet.

L1394::Quadlet::operator== const Quadlet q  ) 
 

operator== compares two Quadlets and returns true if they are equal, false if not

Two Quadlets are equal, if all 4 bytes are equal.

Parameters:
Quadlet reference to quadlet
Returns:
bool : True if two Quadlets are equal, false if not

Definition at line 76 of file l1394_quadlet.cpp.

References FALSE, quadlet, and TRUE.

L1394::Quadlet::setBit const int  i,
const int  value
 

Sets the i'th bit to value.

Parameters:
i : integer for the position ( value between 0..31)
value : the i'th bit (0 or 1)

Definition at line 204 of file l1394_quadlet.cpp.

Referenced by L1394::DccRegister::automatic(), L1394::DccCamera::init(), L1394::DccCamera::multiShot(), L1394::DccRegister::on(), L1394::DccRegister::onePush(), L1394::Card::releaseIsoChannel(), L1394::Card::requestIsoChannel(), L1394::DccRegister::setTriggerPolarity(), L1394::DccCamera::shot(), L1394::DccCamera::start(), and L1394::DccCamera::stop().

L1394::Quadlet::setBitRange const int  start,
const int  end,
const u_int32_t  value
 

This method sets the bitrange from start to end to a value.

The bitrange must big enough to store the value.

Parameters:
start : startvalue of the bitrange
end : endvalue of the bitrange
value : u_int32_t for the value

Definition at line 147 of file l1394_quadlet.cpp.

References fromInt(), and toInt().

Referenced by L1394::DccCamera::init(), L1394::DccCamera::multiShot(), L1394::DccCamera::setFramerate(), L1394::DccRegister::setTriggerMode(), L1394::DccRegister::setValue(), and L1394::DccCamera::setVideoMode().

L1394::Quadlet::setByte const int  i,
const u_int32_t  value
 

This method sets the i'th byte (0..3) to value.

Parameters:
i : integer i for the position (value between 0..3)
value : u_int32_t with the data

Definition at line 100 of file l1394_quadlet.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

Referenced by L1394::QArray::setByte().

L1394::Quadlet::toCharArray char *  ,
int 
const
 

converts a Quadlet to a char*

Definition at line 256 of file l1394_quadlet.cpp.

Referenced by toString().

L1394::Quadlet::toInt  )  const
 

This method converts a quadlet to a 32 bit integer value.

Returns:
u_int32_t : The integer value of the Quadlet

Definition at line 225 of file l1394_quadlet.cpp.

Referenced by getBitRange(), L1394::internal::BusInfo::getChipIdLow(), L1394::internal::Transaction::lock(), L1394::operator+(), L1394::operator-(), L1394::Card::readAGuid(), setBitRange(), L1394::QArray::toIntArray(), and L1394::internal::Transaction::write().

L1394::Quadlet::toString  )  const
 

This method converts a Quadlet to a string.

Parameters:
string : return the Quadlet as string

Definition at line 245 of file l1394_quadlet.cpp.

References toCharArray().

Referenced by L1394::operator<<().


Friends And Related Function Documentation

L1394::Quadlet::operator+ const u_int32_t &  data,
const Quadlet q
[friend]
 

operator+ adds the value of Quadlet q to this Quadlet and returns the reference to it.

Returns:
Quadlet : The new Quadlet

L1394::Quadlet::operator+ const Quadlet q_1,
const Quadlet q_2
[friend]
 

operator+ adds the value of Quadlet q_1 and q_2 and returns the reference to it.

The new value of q1+q2 must be less then 0xffffffff or the value is set to 0xffffffff.

Parameters:
q_1 : Reference to the first Quadlet
q_2 : Reference the the seconf Quadlet
Returns:
const Quadlet : The new Quadlet

Definition at line 45 of file l1394_quadlet.cpp.

L1394::Quadlet::operator- const Quadlet q,
const Quadlet q_2
[friend]
 

operator- subtract the value of data from this Quadlet and returns the reference to it.

Returns:
const Quadlet : The new Quadlet

Definition at line 55 of file l1394_quadlet.cpp.

L1394::Quadlet::operator- const u_int32_t &  data,
const Quadlet
[friend]
 

operator+ adds the value of Quadlet q to this Quadlet and returns the reference to it.

Returns:
const Quadlet : The new Quadlet

L1394::Quadlet::operator<< ostream &  s,
const Quadlet q
[friend]
 

operator<< writes the Quadlet to a stream and returns a reference to it.

Definition at line 268 of file l1394_quadlet.cpp.

L1394::Quadlet::operator>> istream &  s,
Quadlet q
[friend]
 

operator>> reads 4 bytes from a stream, stores the value in the Quadlet and returns a reference to the stream

Definition at line 275 of file l1394_quadlet.cpp.


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/