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;
63 explicit ObjectPath(std::vector<ObjectIdentifier> vec) noexcept
64 : m_objectIdentifiers{std::move(vec)}
68 ObjectPath(std::initializer_list<ObjectIdentifier> lst) noexcept
69 : m_objectIdentifiers(lst)
74 : m_objectIdentifiers{obj.m_objectIdentifiers}
79 : m_objectIdentifiers{std::move(obj.m_objectIdentifiers)}
85 m_objectIdentifiers = std::move(obj.m_objectIdentifiers);
92 m_objectIdentifiers = obj.m_objectIdentifiers;
98 pathBetweenObjects(
const QObject*
const parent_obj,
const QObject* target_object);
113 if(!m_cache.isNull())
115 return *safe_cast<T*>(m_cache.data());
119 auto ptr = safe_cast<typename std::remove_const<T>::type*>(find_impl(ctx));
135 if(!m_cache.isNull())
137 return safe_cast<T*>(m_cache.data());
142 =
static_cast<typename std::remove_const<T>::type*
>(find_impl_unsafe(ctx));
153 const ObjectIdentifierVector& vec() const noexcept {
return m_objectIdentifiers; }
155 ObjectIdentifierVector& vec() noexcept {
return m_objectIdentifiers; }
157 void resetCache() const noexcept { m_cache = {}; }
166 ObjectIdentifierVector m_objectIdentifiers;
167 mutable QPointer<QObject> m_cache;
T & find(const score::DocumentContext &ctx) const
find the object described by the ObjectPath
Definition ObjectPath.hpp:110
Definition DocumentContext.hpp:18