swift
Public Member Functions | Protected Attributes | Friends | List of all members
swift::misc::CPropertyIndexVariantMap Class Reference

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

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

Public Member Functions

 CPropertyIndexVariantMap (bool wildcard=false)
 Constructor. More...
 
 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< CVariantvalues () 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 , typename = std::enable_if_t<!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. More...
 
void marshallToDbus (QDBusArgument &argument) const
 Marshall without begin/endStructure, for when composed within another object. More...
 
void unmarshallFromDbus (const QDBusArgument &argument)
 Unmarshall without begin/endStructure, for when composed within another object. More...
 
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream. More...
 
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream. More...
 
- Public Member Functions inherited from swift::misc::mixin::MetaType< CPropertyIndexVariantMap >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object. More...
 
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, CVariantm_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. More...
 

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

◆ convertToQString()

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

Cast as QString.

◆ 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.

◆ 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.

Friends And Related Function Documentation

◆ 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.


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