AVRCpp::FlagsBuffer< T > Class Template Reference

#include <DiverseIO.h>

List of all members.

Public Member Functions

 FlagsBuffer ()
 FlagsBuffer (T initFlags)
void Set (T value)
Get ()
void SetBits (T flagsSet)
void ClearBits (T flagsCleared)
void ToggleBits (T flagsToggled)
SelectBits (T flagsSelected)
bool IsBitsSet (T flagsTested)
template<class Register>
void FromRegister ()
template<class Register>
void IntoRegister ()
void ChangeBits (T selection, T value)

Protected Attributes

flags


Detailed Description

template<typename T>
class AVRCpp::FlagsBuffer< T >

Definition at line 430 of file DiverseIO.h.


Constructor & Destructor Documentation

template<typename T>
AVRCpp::FlagsBuffer< T >::FlagsBuffer (  )  [inline]

Definition at line 438 of file DiverseIO.h.

00438 : flags(0) {}

template<typename T>
AVRCpp::FlagsBuffer< T >::FlagsBuffer ( initFlags  )  [inline]

Definition at line 439 of file DiverseIO.h.

00439 : flags(initFlags) {}


Member Function Documentation

template<typename T>
void AVRCpp::FlagsBuffer< T >::Set ( value  )  [inline]

Definition at line 441 of file DiverseIO.h.

00441 { flags = value; }

template<typename T>
T AVRCpp::FlagsBuffer< T >::Get (  )  [inline]

Definition at line 442 of file DiverseIO.h.

00442 { return flags; }

template<typename T>
void AVRCpp::FlagsBuffer< T >::SetBits ( flagsSet  )  [inline]

Definition at line 443 of file DiverseIO.h.

00443 { flags |= flagsSet; }

template<typename T>
void AVRCpp::FlagsBuffer< T >::ClearBits ( flagsCleared  )  [inline]

Definition at line 444 of file DiverseIO.h.

00444 { flags &= ~flagsCleared; }

template<typename T>
void AVRCpp::FlagsBuffer< T >::ToggleBits ( flagsToggled  )  [inline]

Definition at line 445 of file DiverseIO.h.

00445 { flags ^= flagsToggled; }

template<typename T>
T AVRCpp::FlagsBuffer< T >::SelectBits ( flagsSelected  )  [inline]

Definition at line 446 of file DiverseIO.h.

00446 { return flags & flagsSelected; }

template<typename T>
bool AVRCpp::FlagsBuffer< T >::IsBitsSet ( flagsTested  )  [inline]

Definition at line 447 of file DiverseIO.h.

00447 { return SelectBits(flagsTested) != 0 ? true : false; }

template<typename T>
template<class Register>
void AVRCpp::FlagsBuffer< T >::FromRegister (  )  [inline]

Definition at line 448 of file DiverseIO.h.

00448 { flags = Register::Get(); }

template<typename T>
template<class Register>
void AVRCpp::FlagsBuffer< T >::IntoRegister (  )  [inline]

Definition at line 449 of file DiverseIO.h.

00449 { Register::Set(flags); }

template<typename T>
void AVRCpp::FlagsBuffer< T >::ChangeBits ( selection,
value 
) [inline]

Definition at line 451 of file DiverseIO.h.

00452         {
00453                 T tmp = flags & ~selection;
00454                 
00455                 value &= selection;
00456                 flags = tmp + value;
00457                 
00458         } // ChangeBits


Member Data Documentation

template<typename T>
T AVRCpp::FlagsBuffer< T >::flags [protected]

Definition at line 434 of file DiverseIO.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 15 23:41:06 2007 for AVR C++ Lib for ATmega64 by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi