An iterator that goes forward in an EndpointContainer skipping the NULLs, that also acts a bit like a pointer/smart pointer (can treat it as a vrpn_Endpoint *) More...
#include <vrpn_EndpointContainer.h>
Public Types | |
typedef EndpointIterator | type |
typedef EndpointContainer const | container_type |
typedef container_type::pointer | pointer |
typedef container_type::reference | reference |
typedef container_type::size_type | size_type |
Public Member Functions | |
EndpointIterator () | |
Default constructor, equal to all other default-constructed instances and all end() | |
EndpointIterator (container_type &container) | |
Constructor with container, points to beginning of container. | |
EndpointIterator (container_type &container, size_type index) | |
Constructor with container and raw index into container. | |
bool | valid () const |
Does this iterator refer to a valid element? | |
pointer | get_pointer () const |
Extract the pointer (NULL if iterator is invalid) | |
operator pointer () const | |
Implicit conversion operator to pointer. | |
type & | operator++ () |
prefix ++ operator, increments (and skips any nulls) | |
Smart pointer idiom operators | |
pointer | operator-> () const |
reference | operator* () const |
Comparison operators, primarily for loop use | |
bool | operator== (type const &other) const |
bool | operator!= (type const &other) const |
An iterator that goes forward in an EndpointContainer skipping the NULLs, that also acts a bit like a pointer/smart pointer (can treat it as a vrpn_Endpoint *)
Because we know at design time that it iterates through pointers, we have pointer-related operator overloads that mean there's no need to double-dereference.
Fulfills the InputIterator concept: http://en.cppreference.com/w/cpp/concept/InputIterator
All end() iterators compare equal to each other and to the default-constructed iterator. They are the only invalid iterators: incrementing an iterator past the end makes it the same as the default-constructed iterator.
That is, for all EndpointIterators it, we enforce the class invariant it.valid() || (it == EndpointIterator())
(and that's actually an XOR)
Definition at line 164 of file vrpn_EndpointContainer.h.
typedef EndpointContainer const vrpn::EndpointIterator::container_type |
Definition at line 168 of file vrpn_EndpointContainer.h.
typedef container_type::pointer vrpn::EndpointIterator::pointer |
Definition at line 169 of file vrpn_EndpointContainer.h.
typedef container_type::reference vrpn::EndpointIterator::reference |
Definition at line 170 of file vrpn_EndpointContainer.h.
typedef container_type::size_type vrpn::EndpointIterator::size_type |
Definition at line 171 of file vrpn_EndpointContainer.h.
Definition at line 167 of file vrpn_EndpointContainer.h.
|
inline |
Default constructor, equal to all other default-constructed instances and all end()
Definition at line 175 of file vrpn_EndpointContainer.h.
References valid(), and VRPN_ASSERT_MSG.
|
inline |
Constructor with container, points to beginning of container.
Definition at line 188 of file vrpn_EndpointContainer.h.
References VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
Constructor with container and raw index into container.
Definition at line 198 of file vrpn_EndpointContainer.h.
References VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
Extract the pointer (NULL if iterator is invalid)
Definition at line 217 of file vrpn_EndpointContainer.h.
References VRPN_ECITERATOR_ASSERT_INVARIANT.
Referenced by operator pointer(), and operator->().
|
inline |
Implicit conversion operator to pointer.
Definition at line 226 of file vrpn_EndpointContainer.h.
References get_pointer(), and VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
Definition at line 272 of file vrpn_EndpointContainer.h.
|
inline |
Definition at line 259 of file vrpn_EndpointContainer.h.
References VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
prefix ++ operator, increments (and skips any nulls)
Invariant might be invalid here, since the user might have just deleted something.
Definition at line 233 of file vrpn_EndpointContainer.h.
References VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
Definition at line 253 of file vrpn_EndpointContainer.h.
References get_pointer(), and VRPN_ECITERATOR_ASSERT_INVARIANT.
|
inline |
Definition at line 268 of file vrpn_EndpointContainer.h.
|
inline |
Does this iterator refer to a valid element?
Class invariant: valid() || (*this == type()) That is, there is only one invalid value.
Definition at line 211 of file vrpn_EndpointContainer.h.
Referenced by EndpointIterator().