Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlJS::Dom::AttachedInfo Class Referenceabstract

Attached info creates a tree to attach extra info to DomItems. More...

#include <qqmldomattachedinfo_p.h>

+ Inheritance diagram for QQmlJS::Dom::AttachedInfo:
+ Collaboration diagram for QQmlJS::Dom::AttachedInfo:

Public Types

enum class  PathType { Relative , Canonical }
 
using Ptr = std::shared_ptr<AttachedInfo>
 
- Public Types inherited from QQmlJS::Dom::DomBase
using FilterT = function_ref<bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)>
 

Public Member Functions

DomType kind () const override
 
Path canonicalPath (const DomItem &self) const override
 
bool iterateDirectSubpaths (const DomItem &self, DirectVisitor visitor) const override
 
AttachedInfo::Ptr makeCopy (const DomItem &self) const
 
Ptr parent () const
 
Path path () const
 
void setPath (const Path &p)
 
 AttachedInfo (const Ptr &parent=nullptr, const Path &p=Path())
 
 AttachedInfo (const AttachedInfo &o)
 
DomItem itemAtPath (const DomItem &self, const Path &p, PathType pType=PathType::Relative) const
 
DomItem infoAtPath (const DomItem &self, const Path &p, PathType pType=PathType::Relative) const
 
MutableDomItem ensureItemAtPath (MutableDomItem &self, const Path &p, PathType pType=PathType::Relative)
 
MutableDomItem ensureInfoAtPath (MutableDomItem &self, const Path &p, PathType pType=PathType::Relative)
 
virtual AttachedInfo::Ptr instantiate (const AttachedInfo::Ptr &parent, const Path &p=Path()) const =0
 
virtual DomItem infoItem (const DomItem &self) const =0
 
QMap< Path, PtrsubItems () const
 
void setSubItems (QMap< Path, Ptr > v)
 
- Public Member Functions inherited from QQmlJS::Dom::OwningItem
 OwningItem (const OwningItem &o)
 
 OwningItem (int derivedFrom=0)
 
 OwningItem (int derivedFrom, const QDateTime &lastDataUpdateAt)
 
 OwningItem (const OwningItem &&)=delete
 
OwningItemoperator= (const OwningItem &&)=delete
 
bool iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override
 
std::shared_ptr< OwningItemmakeCopy (const DomItem &self) const
 
Path pathFromOwner () const
 
Path pathFromOwner (const DomItem &) const override final
 
DomItem containingObject (const DomItem &self) const override
 
int derivedFrom () const
 
virtual int revision () const
 
QDateTime createdAt () const
 
virtual QDateTime lastDataUpdateAt () const
 
virtual void refreshedDataAt (QDateTime tNew)
 
virtual bool frozen () const
 
virtual bool freeze ()
 
QDateTime frozenAt () const
 
virtual void addError (const DomItem &self, ErrorMessage &&msg)
 
void addErrorLocal (ErrorMessage &&msg)
 
void clearErrors (const ErrorGroups &groups=ErrorGroups({}))
 
bool iterateErrors (const DomItem &self, function_ref< bool(const DomItem &source, const ErrorMessage &msg)> visitor, const Path &inPath=Path())
 
QMultiMap< Path, ErrorMessagelocalErrors () const
 
virtual bool iterateSubOwners (const DomItem &self, function_ref< bool(const DomItem &owner)> visitor)
 
QBasicMutexmutex () const
 
- Public Member Functions inherited from QQmlJS::Dom::DomBase
virtual ~DomBase ()=default
 
DomBasedomBase ()
 
const DomBasedomBase () const
 
virtual DomKind domKind () const
 
bool iterateDirectSubpathsConst (const DomItem &self, DirectVisitor) const
 
virtual void dump (const DomItem &, const Sink &sink, int indent, FilterT filter) const
 
virtual quintptr id () const
 
QString typeName () const
 
virtual QList< QStringfields (const DomItem &self) const
 
virtual DomItem field (const DomItem &self, QStringView name) const
 
virtual index_type indexes (const DomItem &self) const
 
virtual DomItem index (const DomItem &self, index_type index) const
 
virtual QSet< QString > const keys (const DomItem &self) const
 
virtual DomItem key (const DomItem &self, const QString &name) const
 
virtual QString canonicalFilePath (const DomItem &self) const
 
virtual void writeOut (const DomItem &self, OutWriter &lw) const
 
virtual QCborValue value () const
 

Static Public Member Functions

static Ptr ensure (const Ptr &self, const Path &path, PathType pType=PathType::Relative)
 Returns that the AttachedInfo corresponding to the given path, creating it if it does not exists.
 
static Ptr find (const Ptr &self, const Path &p, PathType pType=PathType::Relative)
 
static AttachedInfoLookupResult< PtrfindAttachedInfo (const DomItem &item, QStringView treeFieldName)
 
static Ptr treePtr (const DomItem &item, QStringView fieldName)
 
- Static Public Member Functions inherited from QQmlJS::Dom::OwningItem
static int nextRevision ()
 

Static Public Attributes

static constexpr DomType kindValue = DomType::AttachedInfo
 

Protected Attributes

Path m_path
 
std::weak_ptr< AttachedInfom_parent
 
QMap< Path, Ptrm_subItems
 

Additional Inherited Members

- Protected Member Functions inherited from QQmlJS::Dom::OwningItem
virtual std::shared_ptr< OwningItemdoCopy (const DomItem &self) const =0
 

Detailed Description

Attached info creates a tree to attach extra info to DomItems.

Normally one uses the template AttachedInfoT<SpecificInfoToAttach>

static methods Attributes: \list

  • parent: parent AttachedInfo in tree (might be empty)
  • subItems: subItems of the tree (path -> AttachedInfo)
  • infoItem: the attached information \endlist
See also
QQmlJs::Dom::AttachedInfo

Definition at line 51 of file qqmldomattachedinfo_p.h.

Member Typedef Documentation

◆ Ptr

using QQmlJS::Dom::AttachedInfo::Ptr = std::shared_ptr<AttachedInfo>

Definition at line 61 of file qqmldomattachedinfo_p.h.

Member Enumeration Documentation

◆ PathType

Enumerator
Relative 
Canonical 

Definition at line 54 of file qqmldomattachedinfo_p.h.

Constructor & Destructor Documentation

◆ AttachedInfo() [1/2]

QQmlJS::Dom::AttachedInfo::AttachedInfo ( const Ptr & parent = nullptr,
const Path & p = Path() )
inline

Definition at line 76 of file qqmldomattachedinfo_p.h.

◆ AttachedInfo() [2/2]

QQmlJS::Dom::AttachedInfo::AttachedInfo ( const AttachedInfo & o)

Definition at line 198 of file qqmldomattachedinfo.cpp.

Member Function Documentation

◆ canonicalPath()

Path QQmlJS::Dom::AttachedInfo::canonicalPath ( const DomItem & self) const
inlineoverridevirtual

Implements QQmlJS::Dom::OwningItem.

Definition at line 64 of file qqmldomattachedinfo_p.h.

◆ ensure()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::ensure ( const Ptr & self,
const Path & path,
AttachedInfo::PathType pType = PathType::Relative )
static

Returns that the AttachedInfo corresponding to the given path, creating it if it does not exists.

The path might be either a relative path or a canonical path, as specified by the PathType

Definition at line 210 of file qqmldomattachedinfo.cpp.

References Canonical, QString::insert(), QString::length(), QQmlJS::Dom::Path::mid(), path(), Q_ASSERT, and Relative.

+ Here is the call graph for this function:

◆ ensureInfoAtPath()

MutableDomItem QQmlJS::Dom::AttachedInfo::ensureInfoAtPath ( MutableDomItem & self,
const Path & p,
PathType pType = PathType::Relative )
inline

Definition at line 123 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::MutableDomItem::field().

+ Here is the call graph for this function:

◆ ensureItemAtPath()

MutableDomItem QQmlJS::Dom::AttachedInfo::ensureItemAtPath ( MutableDomItem & self,
const Path & p,
PathType pType = PathType::Relative )
inline

Definition at line 109 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::Path::mid().

+ Here is the call graph for this function:

◆ find()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::find ( const Ptr & self,
const Path & p,
AttachedInfo::PathType pType = PathType::Relative )
static

Definition at line 240 of file qqmldomattachedinfo.cpp.

References Canonical, QQmlJS::Dom::Path::dropFront(), QString::length(), and QQmlJS::Dom::Path::mid().

Referenced by findAttachedInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAttachedInfo()

AttachedInfoLookupResult< AttachedInfo::Ptr > QQmlJS::Dom::AttachedInfo::findAttachedInfo ( const DomItem & item,
QStringView treeFieldName )
static

Definition at line 265 of file qqmldomattachedinfo.cpp.

References find(), item, o, and Relative.

+ Here is the call graph for this function:

◆ infoAtPath()

DomItem QQmlJS::Dom::AttachedInfo::infoAtPath ( const DomItem & self,
const Path & p,
PathType pType = PathType::Relative ) const
inline

Definition at line 104 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::DomItem::field().

+ Here is the call graph for this function:

◆ infoItem()

virtual DomItem QQmlJS::Dom::AttachedInfo::infoItem ( const DomItem & self) const
pure virtual

Implemented in QQmlJS::Dom::AttachedInfoT< Info >.

Referenced by iterateDirectSubpaths().

+ Here is the caller graph for this function:

◆ instantiate()

virtual AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::instantiate ( const AttachedInfo::Ptr & parent,
const Path & p = Path() ) const
pure virtual

◆ itemAtPath()

DomItem QQmlJS::Dom::AttachedInfo::itemAtPath ( const DomItem & self,
const Path & p,
PathType pType = PathType::Relative ) const
inline

Definition at line 91 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::Path::mid().

+ Here is the call graph for this function:

◆ iterateDirectSubpaths()

bool QQmlJS::Dom::AttachedInfo::iterateDirectSubpaths ( const DomItem & self,
DirectVisitor visitor ) const
overridevirtual

Implements QQmlJS::Dom::DomBase.

Definition at line 168 of file qqmldomattachedinfo.cpp.

References QQmlJS::Dom::Path::Field(), QQmlJS::Dom::Path::fromString(), infoItem(), QMap< Key, T >::insert(), QMap< Key, T >::key(), m_subItems, map, QQmlJS::Dom::Map, parent(), path(), and QQmlJS::Dom::Path::toString().

+ Here is the call graph for this function:

◆ kind()

DomType QQmlJS::Dom::AttachedInfo::kind ( ) const
inlineoverridevirtual

Implements QQmlJS::Dom::DomBase.

Definition at line 63 of file qqmldomattachedinfo_p.h.

◆ makeCopy()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::makeCopy ( const DomItem & self) const
inline

Definition at line 67 of file qqmldomattachedinfo_p.h.

◆ parent()

Ptr QQmlJS::Dom::AttachedInfo::parent ( ) const
inline

Definition at line 72 of file qqmldomattachedinfo_p.h.

Referenced by iterateDirectSubpaths().

+ Here is the caller graph for this function:

◆ path()

Path QQmlJS::Dom::AttachedInfo::path ( ) const
inline

Definition at line 73 of file qqmldomattachedinfo_p.h.

Referenced by ensure(), and iterateDirectSubpaths().

+ Here is the caller graph for this function:

◆ setPath()

void QQmlJS::Dom::AttachedInfo::setPath ( const Path & p)
inline

Definition at line 74 of file qqmldomattachedinfo_p.h.

◆ setSubItems()

void QQmlJS::Dom::AttachedInfo::setSubItems ( QMap< Path, Ptr > v)
inline

Definition at line 135 of file qqmldomattachedinfo_p.h.

◆ subItems()

QMap< Path, Ptr > QQmlJS::Dom::AttachedInfo::subItems ( ) const
inline

Definition at line 132 of file qqmldomattachedinfo_p.h.

◆ treePtr()

static Ptr QQmlJS::Dom::AttachedInfo::treePtr ( const DomItem & item,
QStringView fieldName )
inlinestatic

Definition at line 86 of file qqmldomattachedinfo_p.h.

References item.

Member Data Documentation

◆ kindValue

constexpr DomType QQmlJS::Dom::AttachedInfo::kindValue = DomType::AttachedInfo
staticconstexpr

Definition at line 60 of file qqmldomattachedinfo_p.h.

◆ m_parent

std::weak_ptr<AttachedInfo> QQmlJS::Dom::AttachedInfo::m_parent
protected

Definition at line 140 of file qqmldomattachedinfo_p.h.

◆ m_path

Path QQmlJS::Dom::AttachedInfo::m_path
protected

Definition at line 139 of file qqmldomattachedinfo_p.h.

◆ m_subItems

QMap<Path, Ptr> QQmlJS::Dom::AttachedInfo::m_subItems
protected

Definition at line 141 of file qqmldomattachedinfo_p.h.

Referenced by iterateDirectSubpaths().


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