EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Buffer::iterator< T > Class Template Reference

Buffer's iterator. More...

#include "Buffer.h"

Inheritance diagram for Buffer::iterator< T >:
Collaboration diagram for Buffer::iterator< T >:

Public Types

typedef _Base::iterator_category iterator_category
 Typedef for iterator category. More...
 
typedef _Base::value_type value_type
 Typedef for value type. More...
 
typedef _Base::difference_type difference_type
 Typedef for difference type. More...
 
typedef _Base::pointer pointer
 Typedef for pointer. More...
 
typedef _Base::const_pointer const_pointer
 Typedef for const pointer. More...
 
typedef _Base::reference reference
 Typedef for reference. More...
 
typedef _Base::const_reference const_reference
 Typedef for const reference. More...
 
- Public Types inherited from Buffer::const_iterator< T >
typedef _Base::iterator_category iterator_category
 Typedef for iterator category. More...
 
typedef _Base::value_type value_type
 Typedef for value type. More...
 
typedef _Base::difference_type difference_type
 Typedef for difference type. More...
 
typedef _Base::pointer pointer
 Typedef for pointer. More...
 
typedef _Base::reference reference
 Typedef for reference. More...
 
typedef const T * const_pointer
 Typedef for const pointer. More...
 
typedef const T & const_reference
 Typedef for const reference. More...
 

Public Member Functions

 iterator (Buffer *buffer=NULL, size_type index=0)
 Default constructor. More...
 
 iterator (const iterator &oth)
 Copy constructor. More...
 
iteratoroperator= (const iterator &oth)
 Copy operator. More...
 
template<typename T2 >
iterator< T2 > As () const
 Converts iterator to another iterator with different type. More...
 
reference operator* () const
 Dereference operator. More...
 
pointer operator-> () const
 Dereference operator. More...
 
reference operator[] (difference_type diff) const
 Subscript operator. More...
 
iterator operator+ (difference_type diff) const
 Sum operator. More...
 
iterator operator+= (difference_type diff)
 Add operator. More...
 
iteratoroperator++ ()
 Preincrement operator. More...
 
iterator operator++ (int)
 Postincrement operator. More...
 
iterator operator- (difference_type diff) const
 Diff operator. More...
 
iteratoroperator-= (difference_type diff)
 Subtract operator. More...
 
iteratoroperator-- ()
 Predecrement operator. More...
 
iterator operator-- (int)
 Postdecrement operator. More...
 
difference_type operator- (const _Base &oth) const
 Diff operator. More...
 
- Public Member Functions inherited from Buffer::const_iterator< T >
 const_iterator (const Buffer *buffer=NULL, size_type index=0)
 Default constructor. More...
 
 const_iterator (const const_iterator &oth)
 Copy constructor. More...
 
const_iteratoroperator= (const const_iterator &oth)
 Copy operator. More...
 
template<typename T2 >
const_iterator< T2 > As () const
 Converts const_iterator to another const_iterator with different type. More...
 
const_reference operator* () const
 Dereference operator. More...
 
const_pointer operator-> () const
 Dereference operator. More...
 
const_reference operator[] (difference_type diff) const
 Subscript operator. More...
 
const_iterator operator+ (difference_type diff) const
 Sum operator. More...
 
const_iteratoroperator+= (difference_type diff)
 Add operator. More...
 
const_iteratoroperator++ ()
 Preincrement operator. More...
 
const_iterator operator++ (int)
 Postincrement operator. More...
 
const_iterator operator- (difference_type diff) const
 Diff operator. More...
 
const_iteratoroperator-= (difference_type diff)
 Subtract operator. More...
 
const_iteratoroperator-- ()
 Predecrement operator. More...
 
const_iterator operator-- (int)
 Postdecrement operator. More...
 
difference_type operator- (const const_iterator &oth) const
 Diff operator. More...
 
bool operator== (const const_iterator &oth) const
 Equal operator. More...
 
bool operator!= (const const_iterator &oth) const
 Non-equal operator. More...
 
bool operator< (const const_iterator &oth) const
 Less-than operator. More...
 
bool operator> (const const_iterator &oth) const
 Greater-than operator. More...
 
bool operator<= (const const_iterator &oth) const
 Less-equal operator. More...
 
bool operator>= (const const_iterator &oth) const
 Greater-equal operator. More...
 

Private Types

typedef const_iterator< T > _Base
 Typedef for our base due to readibility. More...
 

Additional Inherited Members

- Protected Attributes inherited from Buffer::const_iterator< T >
size_type mIndex
 Index in buffer, in bytes. More...
 
const BuffermBuffer
 The parent Buffer. More...
 

Detailed Description

template<typename T>
class Buffer::iterator< T >

Buffer's iterator.

Author
Bloody.Rabbit

Definition at line 232 of file Buffer.h.

Member Typedef Documentation

template<typename T>
typedef const_iterator< T > Buffer::iterator< T >::_Base
private

Typedef for our base due to readibility.

Definition at line 236 of file Buffer.h.

template<typename T>
typedef _Base::const_pointer Buffer::iterator< T >::const_pointer

Typedef for const pointer.

Definition at line 248 of file Buffer.h.

template<typename T>
typedef _Base::const_reference Buffer::iterator< T >::const_reference

Typedef for const reference.

Definition at line 252 of file Buffer.h.

template<typename T>
typedef _Base::difference_type Buffer::iterator< T >::difference_type

Typedef for difference type.

Definition at line 244 of file Buffer.h.

template<typename T>
typedef _Base::iterator_category Buffer::iterator< T >::iterator_category

Typedef for iterator category.

Definition at line 240 of file Buffer.h.

template<typename T>
typedef _Base::pointer Buffer::iterator< T >::pointer

Typedef for pointer.

Definition at line 246 of file Buffer.h.

template<typename T>
typedef _Base::reference Buffer::iterator< T >::reference

Typedef for reference.

Definition at line 250 of file Buffer.h.

template<typename T>
typedef _Base::value_type Buffer::iterator< T >::value_type

Typedef for value type.

Definition at line 242 of file Buffer.h.

Constructor & Destructor Documentation

template<typename T>
Buffer::iterator< T >::iterator ( Buffer buffer = NULL,
size_type  index = 0 
)
inline

Default constructor.

Parameters
[in]bufferThe parent Buffer.
[in]indexThe index.

Definition at line 260 of file Buffer.h.

260 : _Base( buffer, index ) {}
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
Buffer::iterator< T >::iterator ( const iterator< T > &  oth)
inline

Copy constructor.

Definition at line 262 of file Buffer.h.

262 : _Base( oth ) {}
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236

Member Function Documentation

template<typename T>
template<typename T2 >
iterator< T2 > Buffer::iterator< T >::As ( ) const
inline

Converts iterator to another iterator with different type.

Returns
The new iterator.

Definition at line 274 of file Buffer.h.

References Buffer::const_iterator< T >::mBuffer, and Buffer::const_iterator< T >::mIndex.

274 { return iterator< T2 >( _Base::mBuffer, _Base::mIndex ); }
const Buffer * mBuffer
The parent Buffer.
Definition: Buffer.h:223
size_type mIndex
Index in buffer, in bytes.
Definition: Buffer.h:221
template<typename T>
reference Buffer::iterator< T >::operator* ( ) const
inline

Dereference operator.

Definition at line 277 of file Buffer.h.

277 { return const_cast< reference >( **(_Base*)this ); }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
_Base::reference reference
Typedef for reference.
Definition: Buffer.h:250
template<typename T>
iterator Buffer::iterator< T >::operator+ ( difference_type  diff) const
inline

Sum operator.

Definition at line 284 of file Buffer.h.

285  {
286  iterator res( *this );
287  return ( res += diff );
288  }
iterator(Buffer *buffer=NULL, size_type index=0)
Default constructor.
Definition: Buffer.h:260
template<typename T>
iterator& Buffer::iterator< T >::operator++ ( )
inline

Preincrement operator.

Definition at line 292 of file Buffer.h.

292 { ++*(_Base*)this; return *this; }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
iterator Buffer::iterator< T >::operator++ ( int  )
inline

Postincrement operator.

Definition at line 294 of file Buffer.h.

295  {
296  iterator res( *this );
297  ++*this;
298  return res;
299  }
iterator(Buffer *buffer=NULL, size_type index=0)
Default constructor.
Definition: Buffer.h:260
template<typename T>
iterator Buffer::iterator< T >::operator+= ( difference_type  diff)
inline

Add operator.

Definition at line 290 of file Buffer.h.

290 { *(_Base*)this += diff; return *this; }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
iterator Buffer::iterator< T >::operator- ( difference_type  diff) const
inline

Diff operator.

Definition at line 302 of file Buffer.h.

303  {
304  iterator res( *this );
305  return ( res -= diff );
306  }
iterator(Buffer *buffer=NULL, size_type index=0)
Default constructor.
Definition: Buffer.h:260
template<typename T>
difference_type Buffer::iterator< T >::operator- ( const _Base oth) const
inline

Diff operator.

Definition at line 320 of file Buffer.h.

320 { return ( *(_Base*)this - oth ); }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
iterator& Buffer::iterator< T >::operator-- ( )
inline

Predecrement operator.

Definition at line 310 of file Buffer.h.

310 { --*(_Base*)this; return *this; }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
iterator Buffer::iterator< T >::operator-- ( int  )
inline

Postdecrement operator.

Definition at line 312 of file Buffer.h.

313  {
314  iterator res( *this );
315  --*this;
316  return res;
317  }
iterator(Buffer *buffer=NULL, size_type index=0)
Default constructor.
Definition: Buffer.h:260
template<typename T>
iterator& Buffer::iterator< T >::operator-= ( difference_type  diff)
inline

Subtract operator.

Definition at line 308 of file Buffer.h.

308 { *(_Base*)this -= diff; return *this; }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
pointer Buffer::iterator< T >::operator-> ( ) const
inline

Dereference operator.

Definition at line 279 of file Buffer.h.

279 { return &**this; }
template<typename T>
iterator& Buffer::iterator< T >::operator= ( const iterator< T > &  oth)
inline

Copy operator.

Definition at line 265 of file Buffer.h.

265 { *(_Base*)this = oth; return *this; }
const_iterator< T > _Base
Typedef for our base due to readibility.
Definition: Buffer.h:236
template<typename T>
reference Buffer::iterator< T >::operator[] ( difference_type  diff) const
inline

Subscript operator.

Definition at line 281 of file Buffer.h.

281 { return *( *this + diff ); }

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