Generic const/non-const dictionary entry searcher. More...
Public Types | |
typedef std::conditional< Const, const dictionary, dictionary >::type | dict_type |
The const/non-const type for the context and sub-dictionaries. More... | |
typedef std::conditional< Const, const entry, entry >::type | value_type |
The const/non-const type for entries. More... | |
typedef dict_type * | dict_pointer |
A pointer to a const/non-const dictionary. More... | |
typedef dict_type & | dict_reference |
A reference to a const/non-const dictionary. More... | |
typedef value_type * | pointer |
A pointer to a const/non-const entry. More... | |
typedef value_type & | reference |
A reference to a const/non-const entry. More... | |
Public Member Functions | |
constexpr | Searcher () noexcept |
Default construct. More... | |
bool | good () const noexcept |
True if entry was found. More... | |
bool | found () const noexcept |
True if entry was found. More... | |
dict_reference | context () const |
The containing dictionary context. More... | |
pointer | ptr () const noexcept |
A pointer to the entry (nullptr if not found) More... | |
reference | ref () const |
A reference to the entry (Error if not found) More... | |
bool | isDict () const noexcept |
True if found entry is a dictionary. More... | |
bool | isStream () const noexcept |
True if found entry is a stream. More... | |
dict_pointer | dictPtr () const noexcept |
Pointer to the found entry as a dictionary, nullptr otherwise. More... | |
ITstream * | streamPtr () const noexcept |
Pointer to the found entry as a stream, nullptr otherwise. More... | |
dict_reference | dict () const |
Return the found entry as a dictionary. Error if not found, or not a dictionary. More... | |
ITstream & | stream () const |
Return the found entry as a ITstream. Error if not found, or not a stream. More... | |
operator const Searcher<!Const > & () const | |
Permit an explicit cast to the other (const/non-const) searcher. More... | |
pointer | operator-> () const noexcept |
A pointer to the entry (nullptr if not found) More... | |
reference | operator* () const |
A reference to the entry (Error if not found) More... | |
Public Attributes | |
friend | dictionary |
Protected Member Functions | |
Searcher (dict_pointer dict) noexcept | |
Implicit construct for the given dictionary context. More... | |
void | set (pointer eptr) noexcept |
Assign the entry. More... | |
Protected Attributes | |
dict_pointer | dict_ |
The dictionary context for the entry. More... | |
pointer | eptr_ |
The entry or nullptr. More... | |
Generic const/non-const dictionary entry searcher.
A searcher provides a uniform means of finding and returning an entry pointer as well as the dictionary context in which the entry was located.
Note that the constructors and set methods are protected such that only friends of the class can set things. This safeguards against inconsistencies in context/entry.
Definition at line 149 of file dictionary.H.
typedef std::conditional<Const, const dictionary, dictionary>::type dict_type |
The const/non-const type for the context and sub-dictionaries.
Definition at line 158 of file dictionary.H.
typedef std::conditional<Const, const entry, entry>::type value_type |
The const/non-const type for entries.
Definition at line 164 of file dictionary.H.
typedef dict_type* dict_pointer |
A pointer to a const/non-const dictionary.
Definition at line 169 of file dictionary.H.
typedef dict_type& dict_reference |
A reference to a const/non-const dictionary.
Definition at line 174 of file dictionary.H.
typedef value_type* pointer |
A pointer to a const/non-const entry.
Definition at line 179 of file dictionary.H.
typedef value_type& reference |
A reference to a const/non-const entry.
Definition at line 184 of file dictionary.H.
|
inlineprotectednoexcept |
Implicit construct for the given dictionary context.
Definition at line 203 of file dictionary.H.
|
inlinenoexcept |
Default construct.
Definition at line 223 of file dictionary.H.
|
inlineprotectednoexcept |
Assign the entry.
Definition at line 212 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
Referenced by dictionary::csearch().
|
inlinenoexcept |
True if entry was found.
Definition at line 233 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
Referenced by dictionary::csearchCompat(), dictionary::optionalSubDict(), dictionary::subDict(), dictionary::subDictOrAdd(), and dictionary::subOrEmptyDict().
|
inlinenoexcept |
True if entry was found.
Definition at line 240 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inline |
The containing dictionary context.
Definition at line 245 of file dictionary.H.
References dictionary::Searcher< Const >::dict_.
|
inlinenoexcept |
A pointer to the entry (nullptr if not found)
Definition at line 250 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inline |
A reference to the entry (Error if not found)
Definition at line 255 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inlinenoexcept |
True if found entry is a dictionary.
Definition at line 260 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inlinenoexcept |
True if found entry is a stream.
Definition at line 268 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inlinenoexcept |
Pointer to the found entry as a dictionary, nullptr otherwise.
Definition at line 276 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
Referenced by dictionary::optionalSubDict(), dictionary::set(), dictionary::subDictOrAdd(), and dictionary::subOrEmptyDict().
|
inlinenoexcept |
Pointer to the found entry as a stream, nullptr otherwise.
Definition at line 284 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
|
inline |
Return the found entry as a dictionary. Error if not found, or not a dictionary.
Definition at line 293 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
Referenced by dictionary::subDict().
|
inline |
Return the found entry as a ITstream. Error if not found, or not a stream.
Definition at line 299 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
Permit an explicit cast to the other (const/non-const) searcher.
Definition at line 304 of file dictionary.H.
A pointer to the entry (nullptr if not found)
Definition at line 312 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
A reference to the entry (Error if not found)
Definition at line 317 of file dictionary.H.
References dictionary::Searcher< Const >::eptr_.
friend dictionary |
Definition at line 152 of file dictionary.H.
|
protected |
The dictionary context for the entry.
Definition at line 192 of file dictionary.H.
Referenced by dictionary::Searcher< Const >::context().
|
protected |
The entry or nullptr.
Definition at line 197 of file dictionary.H.
Referenced by dictionary::Searcher< Const >::dict(), dictionary::Searcher< Const >::dictPtr(), dictionary::Searcher< Const >::found(), dictionary::Searcher< Const >::good(), dictionary::Searcher< Const >::isDict(), dictionary::Searcher< Const >::isStream(), dictionary::Searcher< Const >::operator*(), dictionary::Searcher< Const >::operator->(), dictionary::Searcher< Const >::ptr(), dictionary::Searcher< Const >::ref(), dictionary::Searcher< Const >::set(), dictionary::Searcher< Const >::stream(), and dictionary::Searcher< Const >::streamPtr().