swift
Loading...
Searching...
No Matches
swift::misc::CPropertyIndexVariantMap Class Reference

Specialized value object compliant map for variants, based on indexes. More...

#include <propertyindexvariantmap.h>

Inheritance diagram for swift::misc::CPropertyIndexVariantMap:
[legend]

Public Member Functions

 CPropertyIndexVariantMap (bool wildcard=false)
 Constructor.
 CPropertyIndexVariantMap (const CPropertyIndex &index, const CVariant &value)
 Single value constructor.
void addValue (const CPropertyIndex &index, const CVariant &value)
 Add a value.
void addValue (const CPropertyIndex &index, const QVariant &value)
 Add a value.
void addValue (const CPropertyIndex &index, const char *str)
 Add QString as literal, disambiguate as I want to add QString.
template<class T>
void addValue (const CPropertyIndex &index, const T &value)
 Add a value as non CVariant.
void prependIndex (int index)
 Prepend index to all property indexes.
bool isEmpty () const
 Is empty?
CVariant value (const CPropertyIndex &index) const
 Value.
void value (const CPropertyIndex &index, const CVariant &value)
 Set value.
CPropertyIndexList indexes () const
 Indexes.
bool contains (const CPropertyIndex &index) const
 Contains index?
QList< CVariant > values () const
 values
bool isWildcard () const
 Wildcard, only relevant when used in search.
void setWildcard (bool wildcard)
 Wildcard, only relevant when used in search.
void clear ()
 clear
int size () const
 Number of elements.
bool matchesVariant (const CVariant &value) const
 True if this map matches the value contained in the variant.
template<typename T>
requires (!std::is_same_v<T, CVariant>)
bool matches (const T &value) const
 True if this map matches the value.
const QMap< CPropertyIndex, CVariant > & map () const
 Map.
size_t getValueHash () const
 Hash value.
QString convertToQString (bool i18n=false) const
 Cast as QString.
void marshallToDbus (QDBusArgument &argument) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &argument)
 Unmarshall without begin/endStructure, for when composed within another object.
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::mixin::MetaType< CPropertyIndexVariantMap >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::String< CPropertyIndexVariantMap >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.

Protected Attributes

QMap< CPropertyIndex, CVariant > m_values
 values
bool m_wildcard
 wildcard

Friends

SWIFT_MISC_EXPORT friend bool operator== (const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b)
 Equal operator, required if maps are directly compared, not with CValueObject.
SWIFT_MISC_EXPORT friend bool operator!= (const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b)
 Equal operator, required if maps are directly compared, not with CValueObject.
size_t qHash (const CPropertyIndexVariantMap &vm)
 qHash overload, needed for storing value in a QSet.

Additional Inherited Members

Static Public Member Functions inherited from swift::misc::mixin::MetaType< CPropertyIndexVariantMap >
static void registerMetadata ()
 Register metadata.

Detailed Description

Specialized value object compliant map for variants, based on indexes.

Definition at line 34 of file propertyindexvariantmap.h.

Constructor & Destructor Documentation

◆ CPropertyIndexVariantMap()

swift::misc::CPropertyIndexVariantMap::CPropertyIndexVariantMap ( bool wildcard = false)

Constructor.

Parameters
wildcardwhen used in search, for setting values irrelevant

Member Function Documentation

◆ addValue() [1/2]

void swift::misc::CPropertyIndexVariantMap::addValue ( const CPropertyIndex & index,
const QVariant & value )
inline

Add a value.

Definition at line 52 of file propertyindexvariantmap.h.

◆ addValue() [2/2]

template<class T>
void swift::misc::CPropertyIndexVariantMap::addValue ( const CPropertyIndex & index,
const T & value )
inline

Add a value as non CVariant.

Definition at line 59 of file propertyindexvariantmap.h.

◆ clear()

void swift::misc::CPropertyIndexVariantMap::clear ( )
inline

clear

Definition at line 92 of file propertyindexvariantmap.h.

◆ contains()

bool swift::misc::CPropertyIndexVariantMap::contains ( const CPropertyIndex & index) const
inline

Contains index?

Definition at line 80 of file propertyindexvariantmap.h.

◆ convertToQString()

QString swift::misc::CPropertyIndexVariantMap::convertToQString ( bool i18n = false) const

Cast as QString.

◆ isEmpty()

bool swift::misc::CPropertyIndexVariantMap::isEmpty ( ) const
inline

Is empty?

Definition at line 68 of file propertyindexvariantmap.h.

◆ isWildcard()

bool swift::misc::CPropertyIndexVariantMap::isWildcard ( ) const
inline

Wildcard, only relevant when used in search.

Definition at line 86 of file propertyindexvariantmap.h.

◆ map()

const QMap< CPropertyIndex, CVariant > & swift::misc::CPropertyIndexVariantMap::map ( ) const
inline

Map.

Definition at line 114 of file propertyindexvariantmap.h.

◆ marshallToDbus()

void swift::misc::CPropertyIndexVariantMap::marshallToDbus ( QDBusArgument & argument) const

Marshall without begin/endStructure, for when composed within another object.

◆ marshalToDataStream()

void swift::misc::CPropertyIndexVariantMap::marshalToDataStream ( QDataStream & stream) const

Marshal a value to a QDataStream.

◆ matches()

template<typename T>
requires (!std::is_same_v<T, CVariant>)
bool swift::misc::CPropertyIndexVariantMap::matches ( const T & value) const
inline

True if this map matches the value.

Definition at line 108 of file propertyindexvariantmap.h.

◆ setWildcard()

void swift::misc::CPropertyIndexVariantMap::setWildcard ( bool wildcard)
inline

Wildcard, only relevant when used in search.

Definition at line 89 of file propertyindexvariantmap.h.

◆ unmarshalFromDataStream()

void swift::misc::CPropertyIndexVariantMap::unmarshalFromDataStream ( QDataStream & stream)

Unmarshal a value from a QDataStream.

◆ unmarshallFromDbus()

void swift::misc::CPropertyIndexVariantMap::unmarshallFromDbus ( const QDBusArgument & argument)

Unmarshall without begin/endStructure, for when composed within another object.

◆ value() [1/2]

CVariant swift::misc::CPropertyIndexVariantMap::value ( const CPropertyIndex & index) const
inline

Value.

Definition at line 71 of file propertyindexvariantmap.h.

◆ value() [2/2]

void swift::misc::CPropertyIndexVariantMap::value ( const CPropertyIndex & index,
const CVariant & value )
inline

Set value.

Definition at line 74 of file propertyindexvariantmap.h.

◆ values()

QList< CVariant > swift::misc::CPropertyIndexVariantMap::values ( ) const
inline

values

Definition at line 83 of file propertyindexvariantmap.h.

◆ qHash

size_t qHash ( const CPropertyIndexVariantMap & vm)
friend

qHash overload, needed for storing value in a QSet.

Definition at line 120 of file propertyindexvariantmap.h.

Member Data Documentation

◆ m_values

QMap<CPropertyIndex, CVariant> swift::misc::CPropertyIndexVariantMap::m_values
protected

values

Definition at line 126 of file propertyindexvariantmap.h.

◆ m_wildcard

bool swift::misc::CPropertyIndexVariantMap::m_wildcard
protected

wildcard

Definition at line 127 of file propertyindexvariantmap.h.


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