An intermediate class that allows to operate on the pure type information of some memory array.
More...
#include <TypedArray.hpp>
List of all members.
Public Types
Public Member Functions
-
TypedArray (const MemBase::Creator_t &C)
-
virtual T first () const =0
- Retrieve the first element.
-
virtual T last () const =0
- Retrieve the last element.
-
virtual CreativeIterator< T > * creativeIterator ()=0
-
virtual const CreativeIterator
< T > * creativeIterator () const =0
-
virtual RefPtr
< MemCore::TypedChunk< T > > myChunk () const =0
- Access to a chunk of contiguous data, if such exists.
-
override RefPtr
< MemCore::ChunkBase > getChunk () const
- Get chunk to underlying data, if this is a contiguous array.
- template<class UnaryOperator > RefPtr< MemBase > applyOperator (const UnaryOperator &theOperator, const MemBase::Creator_t &theCreator) const
- Apply an unary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
- template<class BinaryOperator > RefPtr< MemBase > applyOperator (const BinaryOperator &theOperator, const RefPtr< MemBase > &rightValue, const MemBase::Creator_t &theCreator) const
- Apply a binary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
-
override RefPtr< MemBase > createIndirection (const DynamicSize &newSize, const std::vector< index_t > &Indirection, const MemBase::Creator_t &theCreator) const
- Implement indirection.
Static Public Member Functions
Detailed Description
template<class T>
class Fiber::TypedArray< T >
An intermediate class that allows to operate on the pure type information of some memory array.
Type casting into TypedArray<> is allowed. For instance, to check if some MemBase object refers to an array of doubles, just do
if (RefPtr<TypedArray<double> > D = MemBasePtr)
{
....
}
- Author:
- Werner Benger
- Examples:
-
PolychromeSurface.cpp, and TransparentColoredSurface.cpp.
Member Function Documentation
template<class T>
template<class BinaryOperator >
Apply a binary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
- Returns:
- The result will be a NullPtr() if there are no data available here though the creativeIterator() function.
template<class T>
template<class UnaryOperator >
Apply an unary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
- Parameters:
-
| UnaryOperator | The operator object, must provide a function call operator() that takes values of type T and yields values that can be assigned to T. |
- Returns:
- The result will be a NullPtr() if there are no data available here though the creativeIterator() function.