cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Protected Member Functions | List of all members
cc_tools_qt::property::field::IntValue Class Reference

#include "cc_tools_qt/property/field.h"

Detailed Description

Class to contain all the properties relevant to comms::field::IntValue fields.

Inheritance diagram for cc_tools_qt::property::field::IntValue:
cc_tools_qt::property::field::CommonBase< IntValue > cc_tools_qt::property::field::Common

Public Types

using SpecialsList = QList< SpecialType >
 List of special values.
 
using SpecialType = QPair< QString, long long >
 The special value is described as string containing name and the actual numeric value.
 

Public Member Functions

 IntValue ()
 Default constructor.
 
 IntValue (const IntValue &)
 Copy constructor.
 
 IntValue (const QVariant &props)
 Construct from QVariant that contains QVariantMap.
 
 IntValue (const QVariantMap &props)
 Construct from QVariantMap.
 
 IntValue (IntValue &&)
 Move constructor.
 
 ~IntValue () noexcept
 Destructor.
 
IntValueaddSpecial (const QString &specialName, long long value)
 Add speical value.
 
QVariantMap asMap () const
 Retrieve all properties as map.
 
long long displayOffset () const
 Get numeric offset of the displayed field.
 
IntValuedisplayOffset (long long value)
 Set numeric offset for displayed field.
 
bool hasScaledDecimals () const
 Check whether property of having scaled decimals being set.
 
IntValuehidden (bool value=true)
 Set whether the field is hidden.
 
IntValuehiddenWhenReadOnly (bool value=true)
 Set whether the field must be hidden when cannot be modified.
 
bool isHidden () const
 Check the field is hidden.
 
bool isHiddenWhenReadOnly () const
 Check the field is hidden when readOnly.
 
bool isReadOnly () const
 Check whether the field cannot be modified.
 
bool isSerialisedHidden () const
 Check the serialisation part is hidden.
 
const QString & name () const
 Get name of the field.
 
IntValuename (const char *value)
 Set name value.
 
IntValuename (const QString &value)
 Set name value.
 
IntValueoperator= (const IntValue &)
 Copy assignement.
 
IntValueoperator= (IntValue &&)
 Move assignment.
 
IntValuereadOnly (bool value=true)
 Set whether the field cannot be modified.
 
int scaledDecimals () const
 Get number of digits after decimal point when displaying scaled value.
 
IntValuescaledDecimals (int value)
 Set number of digits after decimal point when displaying scaled value.
 
IntValueserialisedHidden (bool value=true)
 Set whether the serialised part is hidden.
 
void setName (const char *value)
 Update the name value.
 
void setName (const QString &value)
 Update the name value.
 
void setTo (QVariantMap &props) const
 Copy all the properties value into provided properties map.
 
const SpecialsListspecials () const
 Get access to all the special values information.
 

Static Protected Member Functions

template<typename TValueType >
static TValueType getElemFrom (const QVariantMap &props, const QString &name, const TValueType &defaultVal=TValueType())
 read element value from the map
 
template<typename U >
static void setElemTo (U &&val, const QString &name, QVariantMap &props)
 set element value to the map
 

Member Function Documentation

◆ addSpecial()

IntValue & cc_tools_qt::property::field::IntValue::addSpecial ( const QString &  specialName,
long long  value 
)

Add speical value.

Parameters
[in]specialNameName of the special value.
[in]valueNumeric value

◆ getElemFrom()

template<typename TValueType >
static TValueType cc_tools_qt::property::field::Common::getElemFrom ( const QVariantMap &  props,
const QString &  name,
const TValueType &  defaultVal = TValueType() 
)
staticprotectedinherited

read element value from the map

Parameters
[in]propsProperties map
[in]nameProperty name
[in]defaultValValue to return if not found in map
Returns
Value of found property in the map

◆ hidden()

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::hidden ( bool  value = true)
inherited

Set whether the field is hidden.

Returns
reference to derived class

◆ hiddenWhenReadOnly()

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::hiddenWhenReadOnly ( bool  value = true)
inherited

Set whether the field must be hidden when cannot be modified.

Returns
reference to derived class

◆ name() [1/2]

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::name ( const char *  value)
inherited

Set name value.

Returns
reference to derived class

◆ name() [2/2]

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::name ( const QString &  value)
inherited

Set name value.

Returns
reference to derived class

◆ readOnly()

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::readOnly ( bool  value = true)
inherited

Set whether the field cannot be modified.

Returns
reference to derived class

◆ serialisedHidden()

IntValue & cc_tools_qt::property::field::CommonBase< IntValue >::serialisedHidden ( bool  value = true)
inherited

Set whether the serialised part is hidden.

Returns
reference to derived class

◆ setElemTo()

template<typename U >
static void cc_tools_qt::property::field::Common::setElemTo ( U &&  val,
const QString &  name,
QVariantMap &  props 
)
staticprotectedinherited

set element value to the map

Parameters
[in]valValue to set
[in]nameName of the property
[in,out]propsMap to update

The documentation for this class was generated from the following file: