• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AllPrimitiveTypes Union Reference

#include <allprimitivetypes.h>

Public Member Functions

 AllPrimitiveTypes ()
 
 AllPrimitiveTypes (const AllPrimitiveTypes &a)
 
 AllPrimitiveTypes (quint64 val)
 
 AllPrimitiveTypes (qint64 val)
 
 AllPrimitiveTypes (qint32 val)
 
 AllPrimitiveTypes (quint32 val)
 
 AllPrimitiveTypes (qint16 val)
 
 AllPrimitiveTypes (quint16 val)
 
 AllPrimitiveTypes (qint8 val)
 
 AllPrimitiveTypes (quint8 val)
 
 AllPrimitiveTypes (float val)
 
 AllPrimitiveTypes (double val)
 
bool operator!= (AllPrimitiveTypes other) const
 
bool operator< (AllPrimitiveTypes other) const
 
bool operator== (AllPrimitiveTypes other) const
 
bool readBits (quint8 bitCount, const Okteta::AbstractByteArrayModel *input, QSysInfo::Endian byteOrder, Okteta::Address address, BitCount64 bitsRemaining, quint8 *const bitOffset)
 
template<typename T >
T value () const
 
template<>
quint8 value () const
 
template<>
quint16 value () const
 
template<>
quint32 value () const
 
template<>
quint64 value () const
 
template<>
qint8 value () const
 
template<>
qint16 value () const
 
template<>
qint32 value () const
 
template<>
qint64 value () const
 
template<>
float value () const
 
template<>
double value () const
 
bool writeBits (quint8 bitCount, AllPrimitiveTypes newValue, Okteta::AbstractByteArrayModel *out, QSysInfo::Endian byteOrder, Okteta::Address address, BitCount64 bitsRemaining, quint8 *const bitOffset)
 

Static Public Member Functions

template<typename T >
static T readValue (const Okteta::AbstractByteArrayModel *input, Okteta::Address address, QSysInfo::Endian endianess, quint8 bitOffset)
 

Public Attributes

qint8 allBytes [8]
 

Detailed Description

This union holds the value of one primitive datatype.

Maximum size of a datatype is currently 64 bits. It has methods for reading and writing from Okteta::AbstractByteArrayModel

Definition at line 70 of file allprimitivetypes.h.

Constructor & Destructor Documentation

AllPrimitiveTypes::AllPrimitiveTypes ( )
inline

Definition at line 85 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( const AllPrimitiveTypes &  a)
inline

Definition at line 86 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( quint64  val)
inline

Definition at line 87 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( qint64  val)
inline

Definition at line 88 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( qint32  val)
inline

Definition at line 90 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( quint32  val)
inline

Definition at line 91 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( qint16  val)
inline

Definition at line 92 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( quint16  val)
inline

Definition at line 93 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( qint8  val)
inline

Definition at line 94 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( quint8  val)
inline

Definition at line 95 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( float  val)
inline

Definition at line 96 of file allprimitivetypes.h.

AllPrimitiveTypes::AllPrimitiveTypes ( double  val)
inline

Definition at line 97 of file allprimitivetypes.h.

Member Function Documentation

bool AllPrimitiveTypes::operator!= ( AllPrimitiveTypes  other) const
inline

Definition at line 99 of file allprimitivetypes.h.

bool AllPrimitiveTypes::operator< ( AllPrimitiveTypes  other) const
inline

Not useful, but needed so we can store this in a QMap.

Definition at line 108 of file allprimitivetypes.h.

bool AllPrimitiveTypes::operator== ( AllPrimitiveTypes  other) const
inline

Definition at line 103 of file allprimitivetypes.h.

bool AllPrimitiveTypes::readBits ( quint8  bitCount,
const Okteta::AbstractByteArrayModel *  input,
QSysInfo::Endian  byteOrder,
Okteta::Address  address,
BitCount64  bitsRemaining,
quint8 *const  bitOffset 
)

Reads given number of bits from input and sets value of this union to the new value.

bitOffset is changed in this method so it does not have to be handled later. There is no need to write an optimised version of this method for reading complete bytes since this is already handled internally.

On failure value of this union is set to 0.

Parameters
bitCountthe number of bits to read
inputthe byte array the value is read from
byteOrderthe byteOrder used for reading values
addressthe address in input
bitsRemainingnumber of bytes remaining in input
bitOffsetthe bit to start at in the first byte
Returns
true on success, false otherwise

Definition at line 79 of file allprimitivetypes.cpp.

template<typename T >
T AllPrimitiveTypes::readValue ( const Okteta::AbstractByteArrayModel *  input,
Okteta::Address  address,
QSysInfo::Endian  endianess,
quint8  bitOffset 
)
inlinestatic

Read data of type T from the model.

Range checking must have been performed before

Parameters
inputthe input to read from
addressthe starting address
endianessthe endianess to use when reading
bitOffsetthe number of bits into the first byte (different depending on endianess)
Returns
the read value

Definition at line 204 of file allprimitivetypes.h.

template<typename T >
T AllPrimitiveTypes::value ( ) const
template<>
quint8 AllPrimitiveTypes::value ( ) const
inline

Definition at line 191 of file allprimitivetypes.h.

template<>
quint16 AllPrimitiveTypes::value ( ) const
inline

Definition at line 192 of file allprimitivetypes.h.

template<>
quint32 AllPrimitiveTypes::value ( ) const
inline

Definition at line 193 of file allprimitivetypes.h.

template<>
quint64 AllPrimitiveTypes::value ( ) const
inline

Definition at line 194 of file allprimitivetypes.h.

template<>
qint8 AllPrimitiveTypes::value ( ) const
inline

Definition at line 195 of file allprimitivetypes.h.

template<>
qint16 AllPrimitiveTypes::value ( ) const
inline

Definition at line 196 of file allprimitivetypes.h.

template<>
qint32 AllPrimitiveTypes::value ( ) const
inline

Definition at line 197 of file allprimitivetypes.h.

template<>
qint64 AllPrimitiveTypes::value ( ) const
inline

Definition at line 198 of file allprimitivetypes.h.

template<>
float AllPrimitiveTypes::value ( ) const
inline

Definition at line 199 of file allprimitivetypes.h.

template<>
double AllPrimitiveTypes::value ( ) const
inline

Definition at line 200 of file allprimitivetypes.h.

bool AllPrimitiveTypes::writeBits ( quint8  bitCount,
AllPrimitiveTypes  newValue,
Okteta::AbstractByteArrayModel *  out,
QSysInfo::Endian  byteOrder,
Okteta::Address  address,
BitCount64  bitsRemaining,
quint8 *const  bitOffset 
)

Writes given number of bits to out.

If the value of this union is not equal to newValue it is set to newValue. bitOffset is changed in this method so it does not have to be handled later. There is no need to write an optimised version of this method for reading complete bytes since this is already handled internally.

On failure value of this union is set to 0.

Parameters
bitCountthe number of bits to read
newValuethe new value of this union
outthe byte array the value is read from
byteOrderthe byteOrder used for reading values
addressthe address in out
remainingnumber of bytes remaining in input
bitOffsetthe bit to start at in the first byte
Returns
true on success, false otherwise

Definition at line 38 of file allprimitivetypes.cpp.

Member Data Documentation

qint8 AllPrimitiveTypes::allBytes[8]

Definition at line 84 of file allprimitivetypes.h.


The documentation for this union was generated from the following files:
  • allprimitivetypes.h
  • allprimitivetypes.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal