Krita Source Code Documentation
Loading...
Searching...
No Matches
CompareWithOtherTagFunctor Class Reference

The CompareWithOtherTagFunctor class defines a comparer for tags. More...

#include <TagActions.h>

Public Member Functions

 CompareWithOtherTagFunctor (KisTagSP referenceTag)
 CompareWithOtherTagFunctor defines a default constructor.
 
bool operator() (KisTagSP otherTag)
 operator () contains comparison logic
 
KisTagSP referenceTag ()
 referenceTag is a getter for the reference tag
 
void setReferenceTag (KisTagSP referenceTag)
 setReferenceTag sets a reference tag in the comparer
 

Private Attributes

KisTagSP m_referenceTag
 Tag to compare all other tags to.
 

Detailed Description

The CompareWithOtherTagFunctor class defines a comparer for tags.

It contains a saved tag and can be used to determine if another tag is equal to the saved tag ("reference tag") or not. It can be used in stl list features like erase() etc.

Definition at line 185 of file TagActions.h.

Constructor & Destructor Documentation

◆ CompareWithOtherTagFunctor()

CompareWithOtherTagFunctor::CompareWithOtherTagFunctor ( KisTagSP referenceTag)

CompareWithOtherTagFunctor defines a default constructor.

Parameters
referenceTaga tag to compare all other tags to

Definition at line 180 of file TagActions.cpp.

181{
183}
KisTagSP m_referenceTag
Tag to compare all other tags to.
Definition TagActions.h:188
KisTagSP referenceTag()
referenceTag is a getter for the reference tag

References m_referenceTag, and referenceTag().

Member Function Documentation

◆ operator()()

bool CompareWithOtherTagFunctor::operator() ( KisTagSP otherTag)

operator () contains comparison logic

Parameters
otherTaga tag to compare with the reference tag
Returns

Definition at line 185 of file TagActions.cpp.

186{
187// ENTER_FUNCTION() << "refTag: " << (m_referenceTag.isNull() ? "null" : m_referenceTag->name())
188// << " other: " << (otherTag.isNull() ? "null" : otherTag->name())
189// << " result = " << (!otherTag.isNull() && !m_referenceTag.isNull() && otherTag->url() == m_referenceTag->url());
190 return !otherTag.isNull() && !m_referenceTag.isNull() && otherTag->url() == m_referenceTag->url();
191}

References m_referenceTag.

◆ referenceTag()

KisTagSP CompareWithOtherTagFunctor::referenceTag ( )

referenceTag is a getter for the reference tag

Returns
a tag that is used to compare other tags to

Definition at line 197 of file TagActions.cpp.

197 {
198 return m_referenceTag;
199}

References m_referenceTag.

◆ setReferenceTag()

void CompareWithOtherTagFunctor::setReferenceTag ( KisTagSP referenceTag)

setReferenceTag sets a reference tag in the comparer

Parameters
referenceTaga tag that is used to compare other tags to

Definition at line 193 of file TagActions.cpp.

193 {
195}

References m_referenceTag, and referenceTag().

Member Data Documentation

◆ m_referenceTag

KisTagSP CompareWithOtherTagFunctor::m_referenceTag
private

Tag to compare all other tags to.

Definition at line 188 of file TagActions.h.


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