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

#include "cc_tools_qt/property/field.h"

Detailed Description

Common set of properties.

Common base class for all other properties description classes

Inheritance diagram for cc_tools_qt::property::field::Common:
cc_tools_qt::property::field::CommonBase< ArrayList > cc_tools_qt::property::field::CommonBase< Bitfield > cc_tools_qt::property::field::CommonBase< BitmaskValue > cc_tools_qt::property::field::CommonBase< Bundle > cc_tools_qt::property::field::CommonBase< EnumValue > cc_tools_qt::property::field::CommonBase< FloatValue > cc_tools_qt::property::field::CommonBase< IntValue > cc_tools_qt::property::field::CommonBase< Optional > cc_tools_qt::property::field::CommonBase< String > cc_tools_qt::property::field::CommonBase< Variant > cc_tools_qt::property::field::CommonBase< TDerived >

Public Member Functions

 Common ()
 Default constructor.
 
 Common (Common &&)
 Move constructor.
 
 Common (const Common &)
 Copy constructor.
 
 Common (const QVariant &props)
 Construct from QVariant that contains QVariantMap.
 
 Common (const QVariantMap &props)
 Construct from QVariantMap.
 
 ~Common () noexcept
 Destructor.
 
void getFrom (const QVariantMap &props)
 Read the properties values from the provided map.
 
Commonhidden (bool value=true)
 Set whether the field is hidden.
 
CommonhiddenWhenReadOnly (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.
 
Commonoperator= (Common &&)
 Move assignment operator.
 
Commonoperator= (const Common &)
 Copy assignment operator.
 
CommonreadOnly (bool value=true)
 Set whether the field cannot be modified.
 
CommonserialisedHidden (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.
 

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

◆ getElemFrom()

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

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

◆ setElemTo()

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

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: