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

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • structures
  • datatypes
  • primitive
pointerdatainformation.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Okteta Kasten Framework, made within the KDE community.
3  *
4  * Copyright 2012 Alessandro Di Federico <ale@clearmind.me>
5  * Copyright 2012 Alex Richardson <alex.richardosn@gmx.de>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) version 3, or any
11  * later version accepted by the membership of KDE e.V. (or its
12  * successor approved by the membership of KDE e.V.), which shall
13  * act as a proxy defined in Section 6 of version 3 of the license.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef POINTERDATAINFORMATION_H
25 #define POINTERDATAINFORMATION_H
26 
27 #include "primitivedatainformation.h"
28 
29 
30 class PointerDataInformation : public PrimitiveDataInformationWrapper
31 {
32  DATAINFORMATION_CLONE_DECL(PointerDataInformation, PrimitiveDataInformationWrapper);
33 public:
37  PointerDataInformation(QString name, DataInformation* childType,
38  PrimitiveDataInformation* valueType, DataInformation* parent);
39  virtual ~PointerDataInformation();
40 
41  virtual bool canHaveChildren() const;
42  virtual uint childCount() const;
43  virtual DataInformation* childAt(uint index) const;
44  virtual bool isPointer() const;
45  virtual BitCount64 childPosition(const DataInformation* child, Okteta::Address start) const;
46  virtual int indexOf(const DataInformation* const data) const;
47  virtual qint64 readData(Okteta::AbstractByteArrayModel* input, Okteta::Address address,
48  BitCount64 bitsRemaining, quint8* bitOffset);
52  void delayedReadData(Okteta::AbstractByteArrayModel* input, Okteta::Address address);
53 
54  DataInformation* pointerTarget() const;
58  void setPointerTarget(DataInformation* target);
59 
60  PrimitiveDataInformation* pointerType() const;
65  bool setPointerType(DataInformation* type);
66 private:
67  virtual QScriptClass* scriptClass(ScriptHandlerInfo* handlerInfo) const;
68  virtual QString valueStringImpl() const;
69  virtual QString typeNameImpl() const;
70 protected:
71  QScopedPointer<DataInformation> mPointerTarget;
72 };
73 
74 inline bool PointerDataInformation::canHaveChildren() const
75 {
76  return true;
77 }
78 
79 inline bool PointerDataInformation::isPointer() const
80 {
81  return true;
82 }
83 
84 inline DataInformation* PointerDataInformation::pointerTarget() const
85 {
86  return mPointerTarget.data();
87 }
88 
89 inline void PointerDataInformation::setPointerTarget(DataInformation* target)
90 {
91  Q_CHECK_PTR(target);
92  mPointerTarget.reset(target);
93  mPointerTarget->setParent(this);
94 }
95 
96 inline PrimitiveDataInformation* PointerDataInformation::pointerType() const
97 {
98  return mValue.data();
99 }
100 
101 #endif // POINTERDATAINFORMATION_H
DataInformation
Interface that must be implemented by all datatypes.
Definition: datainformation.h:67
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
DataInformation::name
QString name() const
Definition: datainformation.h:258
QScriptClass
PointerDataInformation::setPointerTarget
void setPointerTarget(DataInformation *target)
Set a new pointer target.
Definition: pointerdatainformation.h:89
PointerDataInformation
Definition: pointerdatainformation.h:30
BitCount64
quint64 BitCount64
Definition: datainformationbase.h:42
PrimitiveDataInformationWrapper::type
virtual PrimitiveDataType type() const
Definition: primitivedatainformation.h:107
PointerDataInformation::~PointerDataInformation
virtual ~PointerDataInformation()
Definition: pointerdatainformation.cpp:50
PointerDataInformation::pointerTarget
DataInformation * pointerTarget() const
Definition: pointerdatainformation.h:84
PointerDataInformation::delayedReadData
void delayedReadData(Okteta::AbstractByteArrayModel *input, Okteta::Address address)
Called once the whole structure has been read.
Definition: pointerdatainformation.cpp:91
PointerDataInformation::setPointerType
bool setPointerType(DataInformation *type)
Set a new pointer target.
Definition: pointerdatainformation.cpp:145
PrimitiveDataInformationWrapper::mValue
QScopedPointer< PrimitiveDataInformation > mValue
Definition: primitivedatainformation.h:116
DataInformation::child
virtual DataInformation * child(const QString &name) const
Looks for a child of this object with given name.
Definition: datainformation.cpp:228
PointerDataInformation::readData
virtual qint64 readData(Okteta::AbstractByteArrayModel *input, Okteta::Address address, BitCount64 bitsRemaining, quint8 *bitOffset)
Reads the necessary data from input and returns the number of bytes read.
Definition: pointerdatainformation.cpp:60
PointerDataInformation::indexOf
virtual int indexOf(const DataInformation *const data) const
Find the index of a DataInformation in this object, needed to calculate the row.
Definition: pointerdatainformation.cpp:85
PointerDataInformation::childAt
virtual DataInformation * childAt(uint index) const
Definition: pointerdatainformation.cpp:139
PointerDataInformation::pointerType
PrimitiveDataInformation * pointerType() const
Definition: pointerdatainformation.h:96
PointerDataInformation::childCount
virtual uint childCount() const
Definition: pointerdatainformation.cpp:134
DataInformation::data
virtual QVariant data(int column, int role) const
get the necessary data (for the model)
Definition: datainformation.cpp:156
PrimitiveDataInformationWrapper
A base class for data types which just wrap an underlying primitive data type.
Definition: primitivedatainformation.h:76
PointerDataInformation::childPosition
virtual BitCount64 childPosition(const DataInformation *child, Okteta::Address start) const
Definition: pointerdatainformation.cpp:77
ScriptHandlerInfo
Definition: scripthandlerinfo.h:39
PointerDataInformation::canHaveChildren
virtual bool canHaveChildren() const
true for unions and structs and arrays
Definition: pointerdatainformation.h:74
DataInformation::parent
DataInformationBase * parent() const
Definition: datainformation.h:309
PointerDataInformation::PointerDataInformation
PointerDataInformation(QString name, DataInformation *childType, PrimitiveDataInformation *valueType, DataInformation *parent)
creates a new pointer takes ownership over childType and valueType
Definition: pointerdatainformation.cpp:37
PointerDataInformation::isPointer
virtual bool isPointer() const
Definition: pointerdatainformation.h:79
PrimitiveDataInformation
A base class for all primitive data elements (e.g.
Definition: primitivedatainformation.h:34
primitivedatainformation.h
PointerDataInformation::mPointerTarget
QScopedPointer< DataInformation > mPointerTarget
Definition: pointerdatainformation.h:71
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 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