38 friend ObjectIdentifierVector::iterator begin(
ObjectPath& path)
noexcept
40 return path.m_objectIdentifiers.begin();
43 friend ObjectIdentifierVector::iterator end(
ObjectPath& path)
noexcept
45 return path.m_objectIdentifiers.end();
50 return lhs.m_objectIdentifiers == rhs.m_objectIdentifiers;
55 return lhs.m_objectIdentifiers != rhs.m_objectIdentifiers;
61 QString toString()
const noexcept;
62 static ObjectPath fromString(
const QString& str)
noexcept;
65 explicit ObjectPath(std::vector<ObjectIdentifier> vec) noexcept
66 : m_objectIdentifiers{std::move(vec)}
70 ObjectPath(std::initializer_list<ObjectIdentifier> lst) noexcept
71 : m_objectIdentifiers(lst)
76 : m_objectIdentifiers{obj.m_objectIdentifiers}
81 : m_objectIdentifiers{std::move(obj.m_objectIdentifiers)}
87 m_objectIdentifiers = std::move(obj.m_objectIdentifiers);
94 m_objectIdentifiers = obj.m_objectIdentifiers;
100 pathBetweenObjects(
const QObject*
const parent_obj,
const QObject* target_object);
115 if(!m_cache.isNull())
117 return *safe_cast<T*>(m_cache.data());
121 auto ptr = safe_cast<typename std::remove_const<T>::type*>(find_impl(ctx));
137 if(!m_cache.isNull())
139 return safe_cast<T*>(m_cache.data());
144 =
static_cast<typename std::remove_const<T>::type*
>(find_impl_unsafe(ctx));
155 const ObjectIdentifierVector& vec() const noexcept {
return m_objectIdentifiers; }
157 ObjectIdentifierVector& vec() noexcept {
return m_objectIdentifiers; }
159 void resetCache() const noexcept { m_cache = {}; }
168 ObjectIdentifierVector m_objectIdentifiers;
169 mutable QPointer<QObject> m_cache;
T & find(const score::DocumentContext &ctx) const
find the object described by the ObjectPath
Definition ObjectPath.hpp:112
Definition DocumentContext.hpp:18