cphot 0.1
A C++ tool for computing photometry from spectra.
GenericMemberIterator< Const, Encoding, Allocator > Class Template Reference

(Constant) member iterator for a JSON object value More...

#include <document.h>

+ Inheritance diagram for GenericMemberIterator< Const, Encoding, Allocator >:

Public Types

typedef GenericMemberIterator Iterator
 Iterator type itself. More...
 
typedef GenericMemberIterator< true, Encoding, AllocatorConstIterator
 Constant iterator type. More...
 
typedef GenericMemberIterator< false, Encoding, AllocatorNonConstIterator
 Non-constant iterator type. More...
 
typedef BaseType::pointer Pointer
 Pointer to (const) GenericMember. More...
 
typedef BaseType::reference Reference
 Reference to (const) GenericMember. More...
 
typedef BaseType::difference_type DifferenceType
 Signed integer type (e.g. ptrdiff_t) More...
 

Public Member Functions

 GenericMemberIterator ()
 Default constructor (singular value) More...
 
 GenericMemberIterator (const NonConstIterator &it)
 Iterator conversions to more const. More...
 
Iteratoroperator= (const NonConstIterator &it)
 
stepping
Iteratoroperator++ ()
 
Iteratoroperator-- ()
 
Iterator operator++ (int)
 
Iterator operator-- (int)
 
increment/decrement
Iterator operator+ (DifferenceType n) const
 
Iterator operator- (DifferenceType n) const
 
Iteratoroperator+= (DifferenceType n)
 
Iteratoroperator-= (DifferenceType n)
 
relations
bool operator== (ConstIterator that) const
 
bool operator!= (ConstIterator that) const
 
bool operator<= (ConstIterator that) const
 
bool operator>= (ConstIterator that) const
 
bool operator< (ConstIterator that) const
 
bool operator> (ConstIterator that) const
 

Friends

class GenericValue< Encoding, Allocator >
 
template<bool , typename , typename >
class GenericMemberIterator
 

dereference

Reference operator* () const
 
Pointer operator-> () const
 
Reference operator[] (DifferenceType n) const
 
DifferenceType operator- (ConstIterator that) const
 Distance. More...
 

Detailed Description

template<bool Const, typename Encoding, typename Allocator>
class GenericMemberIterator< Const, Encoding, Allocator >

(Constant) member iterator for a JSON object value

Template Parameters
ConstIs this a constant iterator?
EncodingEncoding of the value. (Even non-string values need to have the same encoding in a document)
AllocatorAllocator type for allocating memory of object, array and string.

This class implements a Random Access Iterator for GenericMember elements of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements].

Note
This iterator implementation is mainly intended to avoid implicit conversions from iterator values to NULL, e.g. from GenericValue::FindMember.
Define RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a pointer-based implementation, if your platform doesn't provide the C++ <iterator> header.
See also
GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator

Definition at line 101 of file document.h.

Member Typedef Documentation

◆ ConstIterator

template<bool Const, typename Encoding , typename Allocator >
typedef GenericMemberIterator<true,Encoding,Allocator> GenericMemberIterator< Const, Encoding, Allocator >::ConstIterator

Constant iterator type.

Definition at line 116 of file document.h.

◆ DifferenceType

template<bool Const, typename Encoding , typename Allocator >
typedef BaseType::difference_type GenericMemberIterator< Const, Encoding, Allocator >::DifferenceType

Signed integer type (e.g. ptrdiff_t)

Definition at line 125 of file document.h.

◆ Iterator

template<bool Const, typename Encoding , typename Allocator >
typedef GenericMemberIterator GenericMemberIterator< Const, Encoding, Allocator >::Iterator

Iterator type itself.

Definition at line 114 of file document.h.

◆ NonConstIterator

template<bool Const, typename Encoding , typename Allocator >
typedef GenericMemberIterator<false,Encoding,Allocator> GenericMemberIterator< Const, Encoding, Allocator >::NonConstIterator

Non-constant iterator type.

Definition at line 118 of file document.h.

◆ Pointer

template<bool Const, typename Encoding , typename Allocator >
typedef BaseType::pointer GenericMemberIterator< Const, Encoding, Allocator >::Pointer

Pointer to (const) GenericMember.

Definition at line 121 of file document.h.

◆ Reference

template<bool Const, typename Encoding , typename Allocator >
typedef BaseType::reference GenericMemberIterator< Const, Encoding, Allocator >::Reference

Reference to (const) GenericMember.

Definition at line 123 of file document.h.

Constructor & Destructor Documentation

◆ GenericMemberIterator() [1/2]

template<bool Const, typename Encoding , typename Allocator >
GenericMemberIterator< Const, Encoding, Allocator >::GenericMemberIterator ( )
inline

Default constructor (singular value)

Creates an iterator pointing to no element.

Note
All operations, except for comparisons, are undefined on such values.

Definition at line 131 of file document.h.

◆ GenericMemberIterator() [2/2]

template<bool Const, typename Encoding , typename Allocator >
GenericMemberIterator< Const, Encoding, Allocator >::GenericMemberIterator ( const NonConstIterator it)
inline

Iterator conversions to more const.

Parameters
it(Non-const) iterator to copy from

Allows the creation of an iterator from another GenericMemberIterator that is "less const". Especially, creating a non-constant iterator from a constant iterator are disabled:

  • const -> non-const (not ok)
  • const -> const (ok)
  • non-const -> const (ok)
  • non-const -> non-const (ok)
Note
If the Const template parameter is already false, this constructor effectively defines a regular copy-constructor. Otherwise, the copy constructor is implicitly defined.

Definition at line 149 of file document.h.

Member Function Documentation

◆ operator!=()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator!= ( ConstIterator  that) const
inline

Definition at line 172 of file document.h.

◆ operator*()

template<bool Const, typename Encoding , typename Allocator >
Reference GenericMemberIterator< Const, Encoding, Allocator >::operator* ( ) const
inline

Definition at line 181 of file document.h.

◆ operator+()

template<bool Const, typename Encoding , typename Allocator >
Iterator GenericMemberIterator< Const, Encoding, Allocator >::operator+ ( DifferenceType  n) const
inline

Definition at line 162 of file document.h.

◆ operator++() [1/2]

template<bool Const, typename Encoding , typename Allocator >
Iterator& GenericMemberIterator< Const, Encoding, Allocator >::operator++ ( )
inline

Definition at line 154 of file document.h.

◆ operator++() [2/2]

template<bool Const, typename Encoding , typename Allocator >
Iterator GenericMemberIterator< Const, Encoding, Allocator >::operator++ ( int  )
inline

Definition at line 156 of file document.h.

◆ operator+=()

template<bool Const, typename Encoding , typename Allocator >
Iterator& GenericMemberIterator< Const, Encoding, Allocator >::operator+= ( DifferenceType  n)
inline

Definition at line 165 of file document.h.

◆ operator-() [1/2]

template<bool Const, typename Encoding , typename Allocator >
DifferenceType GenericMemberIterator< Const, Encoding, Allocator >::operator- ( ConstIterator  that) const
inline

Distance.

Definition at line 187 of file document.h.

◆ operator-() [2/2]

template<bool Const, typename Encoding , typename Allocator >
Iterator GenericMemberIterator< Const, Encoding, Allocator >::operator- ( DifferenceType  n) const
inline

Definition at line 163 of file document.h.

◆ operator--() [1/2]

template<bool Const, typename Encoding , typename Allocator >
Iterator& GenericMemberIterator< Const, Encoding, Allocator >::operator-- ( )
inline

Definition at line 155 of file document.h.

◆ operator--() [2/2]

template<bool Const, typename Encoding , typename Allocator >
Iterator GenericMemberIterator< Const, Encoding, Allocator >::operator-- ( int  )
inline

Definition at line 157 of file document.h.

◆ operator-=()

template<bool Const, typename Encoding , typename Allocator >
Iterator& GenericMemberIterator< Const, Encoding, Allocator >::operator-= ( DifferenceType  n)
inline

Definition at line 166 of file document.h.

◆ operator->()

template<bool Const, typename Encoding , typename Allocator >
Pointer GenericMemberIterator< Const, Encoding, Allocator >::operator-> ( ) const
inline

Definition at line 182 of file document.h.

◆ operator<()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator< ( ConstIterator  that) const
inline

Definition at line 175 of file document.h.

◆ operator<=()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator<= ( ConstIterator  that) const
inline

Definition at line 173 of file document.h.

◆ operator=()

template<bool Const, typename Encoding , typename Allocator >
Iterator& GenericMemberIterator< Const, Encoding, Allocator >::operator= ( const NonConstIterator it)
inline

Definition at line 150 of file document.h.

◆ operator==()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator== ( ConstIterator  that) const
inline

Definition at line 171 of file document.h.

◆ operator>()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator> ( ConstIterator  that) const
inline

Definition at line 176 of file document.h.

◆ operator>=()

template<bool Const, typename Encoding , typename Allocator >
bool GenericMemberIterator< Const, Encoding, Allocator >::operator>= ( ConstIterator  that) const
inline

Definition at line 174 of file document.h.

◆ operator[]()

template<bool Const, typename Encoding , typename Allocator >
Reference GenericMemberIterator< Const, Encoding, Allocator >::operator[] ( DifferenceType  n) const
inline

Definition at line 183 of file document.h.

Friends And Related Function Documentation

◆ GenericMemberIterator

template<bool Const, typename Encoding , typename Allocator >
template<bool , typename , typename >
friend class GenericMemberIterator
friend

Definition at line 106 of file document.h.

◆ GenericValue< Encoding, Allocator >

template<bool Const, typename Encoding , typename Allocator >
friend class GenericValue< Encoding, Allocator >
friend

Definition at line 105 of file document.h.


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