header_utils
Loading...
Searching...
No Matches
ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS > Struct Template Reference

A value that references an object via a (usually string-like) "path"; it lazily resolves the pointer to the object, and caches it. More...

#include <path_reference.h>

Public Types

using resolver_type
using path_type
using pointer_type

Public Member Functions

 caching_path_reference (caching_path_reference const &) noexcept=default
 caching_path_reference (caching_path_reference &&) noexcept=default
caching_path_reference & operator= (caching_path_reference const &obj) noexcept=default
caching_path_reference & operator= (caching_path_reference &&obj) noexcept=default
template<typename T>
 caching_path_reference (T &&p)
 Construction from path.
template<typename T>
auto & operator= (T &&p)
 Assignment from path.
template<typename T>
 caching_path_reference (T &&p)
 Construction from pointer.
template<typename T>
auto & operator= (T &&p)
 Assignment from pointer.
pointer_type operator-> () const
auto & operator* () const
template<typename T>
requires ( (std::same_as<std::remove_cvref_t<T>, caching_path_reference>) || (std::same_as<std::remove_cvref_t<T>, pointer_type>) || (std::same_as<std::remove_cvref_t<T>, path_type>) || (std::constructible_from<std::string_view, T const&> && std::equality_comparable_with<path_type const&, std::string_view>) )
bool operator== (T const &other) const
template<typename T>
requires ( (std::same_as<std::remove_cvref_t<T>, caching_path_reference>) || (std::same_as<std::remove_cvref_t<T>, pointer_type>) || (std::same_as<std::remove_cvref_t<T>, path_type>) || (std::constructible_from<std::string_view, T const&> && std::equality_comparable_with<path_type const&, std::string_view>) )
auto operator<=> (T const &other) const
void reset ()
 Sets both the path and pointer to their defaults.
path_type const & path () const &
bool path_empty () const
path_type path () &&
pointer_type const & pointer () const &
pointer_type pointer () &&
 operator bool () const noexcept
 operator path_type () const noexcept

Static Public Attributes

static constexpr bool can_resolve_path_from_pointer
 Doesn't work for some reason... static_assert(detail::valid_resolver<resolver_type, path_type, pointer_type, TAGS...>, "Invalid resolver type - must implement the ResolveReferenceFromPath function template as specified by the valid_resolver concept");.

Detailed Description

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
struct ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >

A value that references an object via a (usually string-like) "path"; it lazily resolves the pointer to the object, and caches it.

\usage TODO

Template Parameters
POINTER_TYPEthe type to store the pointer in - must be copyable, so should be a pointer of some sort
PATH_TYPE(optional) the type to store the path in; if not given, will use std::string
RESOLVER_TYPE(optional) type used to resolve the pointer from the path; if not given, will use a thread-safe global storage for these pointer+path types
TAGS...a list of tags that modify the behavior of this type; currently none are available

Definition at line 94 of file path_reference.h.

Member Typedef Documentation

◆ path_type

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
using ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::path_type

Definition at line 101 of file path_reference.h.

◆ pointer_type

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
using ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::pointer_type

Definition at line 102 of file path_reference.h.

◆ resolver_type

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
using ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::resolver_type

Definition at line 100 of file path_reference.h.

Constructor & Destructor Documentation

◆ caching_path_reference() [1/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::caching_path_reference ( T && p)
inline

Construction from path.

Definition at line 119 of file path_reference.h.

◆ caching_path_reference() [2/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::caching_path_reference ( T && p)
inline

Construction from pointer.

Definition at line 134 of file path_reference.h.

Member Function Documentation

◆ operator bool()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 214 of file path_reference.h.

◆ operator path_type()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator path_type ( ) const
inlineexplicitnoexcept

Definition at line 215 of file path_reference.h.

◆ operator*()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
auto & ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator* ( ) const
inline

Definition at line 146 of file path_reference.h.

◆ operator->()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
pointer_type ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator-> ( ) const
inline

Definition at line 145 of file path_reference.h.

◆ operator<=>()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
requires ( (std::same_as<std::remove_cvref_t<T>, caching_path_reference>) || (std::same_as<std::remove_cvref_t<T>, pointer_type>) || (std::same_as<std::remove_cvref_t<T>, path_type>) || (std::constructible_from<std::string_view, T const&> && std::equality_comparable_with<path_type const&, std::string_view>) )
auto ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator<=> ( T const & other) const
inline

Definition at line 168 of file path_reference.h.

◆ operator=() [1/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
auto & ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator= ( T && p)
inline

Assignment from pointer.

Definition at line 139 of file path_reference.h.

◆ operator=() [2/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
auto & ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator= ( T && p)
inline

Assignment from path.

Definition at line 124 of file path_reference.h.

◆ operator==()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
template<typename T>
requires ( (std::same_as<std::remove_cvref_t<T>, caching_path_reference>) || (std::same_as<std::remove_cvref_t<T>, pointer_type>) || (std::same_as<std::remove_cvref_t<T>, path_type>) || (std::constructible_from<std::string_view, T const&> && std::equality_comparable_with<path_type const&, std::string_view>) )
bool ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::operator== ( T const & other) const
inline

Definition at line 149 of file path_reference.h.

◆ path() [1/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
path_type ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::path ( ) &&
inline

Definition at line 199 of file path_reference.h.

◆ path() [2/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
path_type const & ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::path ( ) const &
inline

Definition at line 189 of file path_reference.h.

◆ path_empty()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
bool ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::path_empty ( ) const
inline

Definition at line 194 of file path_reference.h.

◆ pointer() [1/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
pointer_type ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::pointer ( ) &&
inline

Definition at line 209 of file path_reference.h.

◆ pointer() [2/2]

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
pointer_type const & ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::pointer ( ) const &
inline

Definition at line 204 of file path_reference.h.

◆ reset()

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
void ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::reset ( )
inline

Sets both the path and pointer to their defaults.

Definition at line 187 of file path_reference.h.

Member Data Documentation

◆ can_resolve_path_from_pointer

template<typename POINTER_TYPE, typename PATH_TYPE = std::string, typename RESOLVER_TYPE = detail::flyweight_resolver<POINTER_TYPE, PATH_TYPE>, typename... TAGS>
bool ghassanpl::caching_path_reference< POINTER_TYPE, PATH_TYPE, RESOLVER_TYPE, TAGS >::can_resolve_path_from_pointer
staticconstexpr

Doesn't work for some reason... static_assert(detail::valid_resolver<resolver_type, path_type, pointer_type, TAGS...>, "Invalid resolver type - must implement the ResolveReferenceFromPath function template as specified by the valid_resolver concept");.

Definition at line 108 of file path_reference.h.