#include <stridedPointer.h>
Collaboration diagram for dlr::common::StridedPointer< Type >:

Public Member Functions | |
| StridedPointer () | |
| The default constructor creates a null pointer with stride == 1. | |
| StridedPointer (Type *pointer) | |
| This constructor creates a StridedPointer which points to the same memory as the argument, and has stride == 1. | |
| StridedPointer (Type *pointer, int stride) | |
| This constructor creates a StridedPointer which has the same value as the argument, but has the specified stride. | |
| StridedPointer (const StridedPointer< Type > &source) | |
| This is the copy constructor. | |
| ~StridedPointer () | |
| Destroys the StridedPointer instance. | |
| Type & | operator * () |
| The dereference operator permits reading and writing the value to which this StridedPointer instance currently points. | |
| Type * | operator-> () |
| The access operator allows you to access the member functions and member variables of the value to which this StridedPointer instance currently points, just as you would with a normal pointer. | |
| StridedPointer< Type > & | operator++ () |
| The pre-increment operator actually adds the value of stride (which was set at construction time) to *this. | |
| StridedPointer< Type > | operator++ (int) |
| The post-increment operator is just like the pre-increment operator, above, but returns a copy of the StridedPointer which has not been incremented. | |
| StridedPointer< Type > & | operator-- () |
| The pre-decrement operator is just like the pre-increment operator, above, but increments instead of decrements. | |
| StridedPointer< Type > | operator-- (int) |
| The post-decrement operator is just like the post-increment operator, above, but increments instead of decrements. | |
| StridedPointer< Type > | operator+ (ptrdiff_t offset) |
| This operator has the same effect as incrementing a copy of *this offset times, but runs in O(1) time. | |
| StridedPointer< Type > | operator- (ptrdiff_t offset) |
| This operator works just like operator+() above, but decreases the StridedPointer value instead of increasing it. | |
| ptrdiff_t | operator- (const StridedPointer< Type > &other) |
| This operator attempts to return a value N so that *(*this) == *(other + N). | |
| StridedPointer< Type > & | operator+= (ptrdiff_t offset) |
| This operator has the same effect as incrementing *this offset times, but runs in O(1) time. | |
| StridedPointer< Type > & | operator-= (ptrdiff_t offset) |
| This operator has the same effect as decrementing *this offset times, but runs in O(1) time. | |
| bool | operator== (const StridedPointer< Type > &other) const |
| This operator returns true if its argument references the same memory location as *this, false otherwise. | |
| bool | operator!= (const StridedPointer< Type > &other) const |
| This operator returns false if its argument references the same memory location as *this, true otherwise. | |
| bool | operator< (const StridedPointer< Type > &other) const |
| This operator return true if the address of the memory location referenced by *this is less than the address of the memory location referenced by other, false otherwise. | |
| bool | operator> (const StridedPointer< Type > &other) const |
| This operator return true if the address of the memory location referenced by *this is greater than the address of the memory location referenced by other, false otherwise. | |
| bool | operator<= (const StridedPointer< Type > &other) const |
| This operator return true if the address of the memory location referenced by *this is less than or equal to the address of the memory location referenced by other, false otherwise. | |
| bool | operator>= (const StridedPointer< Type > &other) const |
| This operator return true if the address of the memory location referenced by *this is greater than or equal to the address of the memory location referenced by other, false otherwise. | |
| StridedPointer< Type > & | operator= (const StridedPointer< Type > &source) |
| The assignment operator copies both address and stride from its argument. | |
That is, a StridedPointer instance with stride == 1 acts a lot like an ordinary pointer, while a StridedPointer instance with stride == 2 "sees" only every other element of the array, and so on.
Definition at line 32 of file stridedPointer.h.
| dlr::common::StridedPointer< Type >::StridedPointer | ( | ) | [inline] |
The default constructor creates a null pointer with stride == 1.
Definition at line 40 of file stridedPointer.h.
| dlr::common::StridedPointer< Type >::StridedPointer | ( | Type * | pointer | ) | [inline] |
This constructor creates a StridedPointer which points to the same memory as the argument, and has stride == 1.
| pointer | The pointer from which to take the initial value of *this. |
Definition at line 49 of file stridedPointer.h.
| dlr::common::StridedPointer< Type >::StridedPointer | ( | Type * | pointer, | |
| int | stride | |||
| ) | [inline] |
This constructor creates a StridedPointer which has the same value as the argument, but has the specified stride.
| pointer | The pointer from which to take the initial value of *this. | |
| stride | The StridedPointer instance will be able to access only every stride'th element in the array. |
Definition at line 60 of file stridedPointer.h.
| dlr::common::StridedPointer< Type >::StridedPointer | ( | const StridedPointer< Type > & | source | ) | [inline] |
This is the copy constructor.
It copies both address and stride from its argument.
| source | The StridedPointer instance to be copied. |
Definition at line 69 of file stridedPointer.h.
| dlr::common::StridedPointer< Type >::~StridedPointer | ( | ) | [inline] |
| Type& dlr::common::StridedPointer< Type >::operator * | ( | ) | [inline] |
The dereference operator permits reading and writing the value to which this StridedPointer instance currently points.
For example, you might write:
StridedPointer<char> ptr(...); char ch = *ptr;
just as you would with a native pointer type.
Definition at line 91 of file stridedPointer.h.
| Type* dlr::common::StridedPointer< Type >::operator-> | ( | ) | [inline] |
The access operator allows you to access the member functions and member variables of the value to which this StridedPointer instance currently points, just as you would with a normal pointer.
Use it like this:
StridedPointer<myClass> ptr(...); ptr->someMethod();
Definition at line 105 of file stridedPointer.h.
| StridedPointer<Type>& dlr::common::StridedPointer< Type >::operator++ | ( | ) | [inline] |
The pre-increment operator actually adds the value of stride (which was set at construction time) to *this.
That is, if the value of stride is N, then incrementing a StridedPointer instance makes it point to an array element N spaces away.
Definition at line 115 of file stridedPointer.h.
| StridedPointer<Type> dlr::common::StridedPointer< Type >::operator++ | ( | int | ) | [inline] |
The post-increment operator is just like the pre-increment operator, above, but returns a copy of the StridedPointer which has not been incremented.
Definition at line 124 of file stridedPointer.h.
| StridedPointer<Type>& dlr::common::StridedPointer< Type >::operator-- | ( | ) | [inline] |
The pre-decrement operator is just like the pre-increment operator, above, but increments instead of decrements.
Definition at line 136 of file stridedPointer.h.
| StridedPointer<Type> dlr::common::StridedPointer< Type >::operator-- | ( | int | ) | [inline] |
The post-decrement operator is just like the post-increment operator, above, but increments instead of decrements.
Definition at line 144 of file stridedPointer.h.
| StridedPointer<Type> dlr::common::StridedPointer< Type >::operator+ | ( | ptrdiff_t | offset | ) | [inline] |
This operator has the same effect as incrementing a copy of *this offset times, but runs in O(1) time.
That is, a call to operator+() returns a StridedPointer instance which references a place in memory which is (stride * offset) items advance from value referenced by *this.
| offset | This argument specifies how many steps to advance. |
Definition at line 161 of file stridedPointer.h.
| StridedPointer<Type> dlr::common::StridedPointer< Type >::operator- | ( | ptrdiff_t | offset | ) | [inline] |
This operator works just like operator+() above, but decreases the StridedPointer value instead of increasing it.
| offset | This argument specifies how many steps to move back. |
Definition at line 175 of file stridedPointer.h.
| ptrdiff_t dlr::common::StridedPointer< Type >::operator- | ( | const StridedPointer< Type > & | other | ) | [inline] |
This operator attempts to return a value N so that *(*this) == *(other + N).
Note that this value is meaningless if the two StridedPointer instances have different stride values. Note also that if stride is not equal to 1, it is very possible to have two StridedPointer instances which are "out of phase" so that there is no value of N which satisfies the above equation.
| other | The StridedPointer instance to subtract from *this. |
Definition at line 193 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer.
| StridedPointer<Type>& dlr::common::StridedPointer< Type >::operator+= | ( | ptrdiff_t | offset | ) | [inline] |
This operator has the same effect as incrementing *this offset times, but runs in O(1) time.
| offset | This argument specifies how many steps to advance the StridedPointer. |
Definition at line 206 of file stridedPointer.h.
| StridedPointer<Type>& dlr::common::StridedPointer< Type >::operator-= | ( | ptrdiff_t | offset | ) | [inline] |
This operator has the same effect as decrementing *this offset times, but runs in O(1) time.
| offset | This argument specifies how many steps to decrement the StridedPointer. |
Definition at line 219 of file stridedPointer.h.
| bool dlr::common::StridedPointer< Type >::operator== | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator returns true if its argument references the same memory location as *this, false otherwise.
| other | A StridedPointer instance to be compared with *this. |
Definition at line 232 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer.
| bool dlr::common::StridedPointer< Type >::operator!= | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator returns false if its argument references the same memory location as *this, true otherwise.
| other | A StridedPointer instance to be compared with *this. |
Definition at line 244 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer.
| bool dlr::common::StridedPointer< Type >::operator< | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator return true if the address of the memory location referenced by *this is less than the address of the memory location referenced by other, false otherwise.
| other | The StridedPointer instance to be compared with *this. |
Definition at line 259 of file stridedPointer.h.
| bool dlr::common::StridedPointer< Type >::operator> | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator return true if the address of the memory location referenced by *this is greater than the address of the memory location referenced by other, false otherwise.
| other | The StridedPointer instance to be compared with *this. |
Definition at line 274 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer.
| bool dlr::common::StridedPointer< Type >::operator<= | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator return true if the address of the memory location referenced by *this is less than or equal to the address of the memory location referenced by other, false otherwise.
| other | The StridedPointer instance to be compared with *this. |
Definition at line 289 of file stridedPointer.h.
| bool dlr::common::StridedPointer< Type >::operator>= | ( | const StridedPointer< Type > & | other | ) | const [inline] |
This operator return true if the address of the memory location referenced by *this is greater than or equal to the address of the memory location referenced by other, false otherwise.
| other | The StridedPointer instance to be compared with *this. |
Definition at line 304 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer.
| StridedPointer<Type>& dlr::common::StridedPointer< Type >::operator= | ( | const StridedPointer< Type > & | source | ) | [inline] |
The assignment operator copies both address and stride from its argument.
| source | The StridedPointer instance to be copied. |
Definition at line 315 of file stridedPointer.h.
References dlr::common::StridedPointer< Type >::m_pointer, and dlr::common::StridedPointer< Type >::m_stride.
1.5.2