112 lines
2.5 KiB
C++
112 lines
2.5 KiB
C++
// **************************************************************************
|
|
//
|
|
// (C) Copyright 2009 Swiss SIMTEC AG
|
|
//
|
|
// **************************************************************************
|
|
//
|
|
// $HeadURL$
|
|
// $LastChangedBy$
|
|
// $LastChangedDate$
|
|
// $LastChangedRevision$
|
|
//
|
|
// **************************************************************************
|
|
|
|
#pragma once
|
|
|
|
#include "LogViewXdrElement.hpp"
|
|
|
|
namespace N_LogView
|
|
{
|
|
/**
|
|
* This class represents XDR-elements which have a type and an arraySize. This are
|
|
* typedefs and struct-elements.
|
|
* The arraySize has following possibilities:
|
|
* 0 => opaque
|
|
* 1 => scalar
|
|
* >1 => array
|
|
*
|
|
* @author alois.wismer
|
|
* @version 1.0
|
|
* @created 16-Feb-2010 15:48:24
|
|
*/
|
|
class LogViewXdrType final : public LogViewXdrElement
|
|
{
|
|
public:
|
|
|
|
/**
|
|
*
|
|
* @param a_name
|
|
* @param a_type
|
|
* @param a_arraySize
|
|
* @param a_dynArrayOffset
|
|
* @param a_kind
|
|
*/
|
|
LogViewXdrType(const QString& a_name, const QString& a_type, const uint16_t a_arraySize, const uint16_t a_dynArrayOffset, const E_ElementKind a_kind);
|
|
|
|
/**
|
|
*
|
|
* @param a_name
|
|
* @param a_type
|
|
* @param a_arraySize
|
|
* @param a_dynArrayOffset
|
|
* @param a_kind
|
|
* @param a_firstBit
|
|
* @param a_lastBit
|
|
* @param a_isLast
|
|
*/
|
|
LogViewXdrType(const QString& a_name, const QString& a_type, const uint16_t a_arraySize, const uint16_t a_dynArrayOffset, const E_ElementKind a_kind, const int16_t a_firstBit, const int16_t a_lastBit, const bool a_isLast);
|
|
|
|
|
|
void dump() const override;
|
|
|
|
|
|
const QString& getType() const;
|
|
|
|
/**
|
|
* 0 => opaque
|
|
* 1 => normal (scalar) element
|
|
* >1 => array
|
|
*/
|
|
uint16_t getArraySize() const;
|
|
|
|
/**
|
|
*
|
|
* @param a_value
|
|
* @param a_size
|
|
* @param a_tooltip
|
|
*/
|
|
bool maskValue(uint32_t& a_value, const uint16_t a_size, QString& a_tooltip) const;
|
|
|
|
|
|
uint16_t getMaxArraySize() const;
|
|
|
|
protected:
|
|
|
|
QString m_Type;
|
|
/**
|
|
* 0 => opaque
|
|
* 1 => normal (scalar) element
|
|
* >1 => array
|
|
*/
|
|
uint16_t m_ArraySize;
|
|
/**
|
|
* The maximum size of the array. Interesting for dynamic arrays.
|
|
*/
|
|
uint16_t m_MaxArraySize;
|
|
/**
|
|
* The first relevant bit, if we have bitfield-enum
|
|
*/
|
|
int16_t m_FirstBit;
|
|
/**
|
|
* The last relevant bit, if we have bitfield-enum
|
|
*/
|
|
int16_t m_LastBit;
|
|
/**
|
|
* used to step to next values when reading out content-data of bit-fields
|
|
*/
|
|
bool m_IsLast;
|
|
};
|
|
|
|
}
|
|
|