OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
SbeGroupEntries< EntryType, BlockLength, NumInGroup, Length >::Iterator Class Reference

Public Types

typedef EntryType Entry
typedef Entry value_type
typedef Entrypointer
typedef Entryreference
typedef ptrdiff_t difference_type
typedef std::random_access_iterator_tag iterator_category

Public Member Functions

 Iterator () noexcept
 Iterator (void *entry, Size size, SchemaVersion version) noexcept
bool valid () const noexcept
Entry get () const
Entry operator* () const
bool operator== (const Iterator &other) const noexcept
bool operator!= (const Iterator &other) const noexcept
bool operator< (const Iterator &other) const noexcept
bool operator> (const Iterator &other) const noexcept
Iteratoroperator++ ()
Iteratoroperator-- ()
Iterator operator+ (difference_type distance) const
Iterator operator- (difference_type distance) const

Detailed Description

template<class EntryType, class BlockLength, class NumInGroup, class Length>
class OnixS::ICE::BOE::Messaging::SbeGroupEntries< EntryType, BlockLength, NumInGroup, Length >::Iterator

Definition at line 454 of file SbeMessage.h.

Member Typedef Documentation

◆ difference_type

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef ptrdiff_t difference_type

Definition at line 463 of file SbeMessage.h.

◆ Entry

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef EntryType Entry

Definition at line 457 of file SbeMessage.h.

◆ iterator_category

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef std::random_access_iterator_tag iterator_category

Definition at line 465 of file SbeMessage.h.

◆ pointer

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef Entry* pointer

Definition at line 460 of file SbeMessage.h.

◆ reference

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef Entry& reference

Definition at line 461 of file SbeMessage.h.

◆ value_type

template<class EntryType, class BlockLength, class NumInGroup, class Length>
typedef Entry value_type

Definition at line 458 of file SbeMessage.h.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator ( )
inlinenoexcept

Initializes the instance that refers to nothing.

Definition at line 468 of file SbeMessage.h.

469 : entry_(nullptr)
470 , size_(0)
471 , version_(0)
472 {
473 }

◆ Iterator() [2/2]

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator ( void * entry,
Size size,
SchemaVersion version )
inlinenoexcept

Initializes the instance to the given repeating group.

Definition at line 477 of file SbeMessage.h.

478 : entry_(entry)
479 , size_(size)
480 , version_(version)
481 {
482 assert(valid());
483 }

Member Function Documentation

◆ get()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Entry get ( ) const
inline
Returns
the repeating group entry.

Definition at line 493 of file SbeMessage.h.

494 {
495 assert(valid());
496
497 return Entry(entry_, size_, version_);
498 }

◆ operator!=()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
bool operator!= ( const Iterator & other) const
inlinenoexcept

Compares iterators.

Definition at line 513 of file SbeMessage.h.

514 {
515 return entry_ != other.entry_;
516 }

◆ operator*()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Entry operator* ( ) const
inline
Returns
the repeating group entry.

Definition at line 501 of file SbeMessage.h.

502 {
503 return get();
504 }

◆ operator+()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator operator+ ( difference_type distance) const
inline

Advances by given number of entries.

Definition at line 552 of file SbeMessage.h.

553 {
554 assert(valid());
555
556 return Iterator(advanceByBytes(entry_, distance * size_), size_, version_);
557 }
ONIXS_ICEBOE_FORCEINLINE Type * advanceByBytes(Type *pointer, ptrdiff_t distance) noexcept
Advances the pointer to a given offset (distance) in bytes.
Definition Memory.h:110

◆ operator++()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator & operator++ ( )
inline

Advances the next repeating group entry.

Definition at line 531 of file SbeMessage.h.

532 {
533 assert(valid());
534
535 entry_ = advanceByBytes(entry_, size_);
536
537 return *this;
538 }

◆ operator-()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator operator- ( difference_type distance) const
inline

Advances back by given number of entries.

Definition at line 561 of file SbeMessage.h.

562 {
563 assert(valid());
564
565 return Iterator(advanceBackByBytes(entry_, distance * size_), size_, version_);
566 }
ONIXS_ICEBOE_FORCEINLINE Type * advanceBackByBytes(Type *pointer, ptrdiff_t distance) noexcept
Definition Memory.h:123

◆ operator--()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
Iterator & operator-- ( )
inline

Advances to the previous repeating group entry.

Definition at line 541 of file SbeMessage.h.

542 {
543 assert(valid());
544
545 entry_ = advanceBackByBytes(entry_, size_);
546
547 return *this;
548 }

◆ operator<()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
bool operator< ( const Iterator & other) const
inlinenoexcept

Established the order between two iterators.

Definition at line 519 of file SbeMessage.h.

520 {
521 return entry_ < other.entry_;
522 }

◆ operator==()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
bool operator== ( const Iterator & other) const
inlinenoexcept

Compares iterators.

Definition at line 507 of file SbeMessage.h.

508 {
509 return entry_ == other.entry_;
510 }

◆ operator>()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
bool operator> ( const Iterator & other) const
inlinenoexcept

Established the order between two iterators.

Definition at line 525 of file SbeMessage.h.

526 {
527 return entry_ > other.entry_;
528 }

◆ valid()

template<class EntryType, class BlockLength, class NumInGroup, class Length>
bool valid ( ) const
inlinenoexcept
Returns
true if the instance is valid, otherwise - false.

Definition at line 486 of file SbeMessage.h.

487 {
488 return (entry_ != nullptr);
489 }