ISIS Core Library 0.7.2 (api 3.0.0)
|
#include <valuearray_base.hpp>
Data Structures | |
class | DelProxy |
Proxy-Deleter to encapsulate the real deleter/shared_ptr when creating shared_ptr for parts of a shared_ptr. More... | |
Public Types | |
typedef _internal::GenericValueIterator < true > | const_value_iterator |
typedef const_value_iterator | const_value_reference |
typedef _internal::ValueArrayConverterMap::mapped_type::mapped_type | Converter |
typedef util::_internal::GenericReference < ValueArrayBase > | Reference |
typedef _internal::GenericValueIterator < false > | value_iterator |
typedef value_iterator | value_reference |
Public Member Functions | |
template<typename T > | |
ValueArray< T > | as (scaling_pair scaling=scaling_pair()) |
Get this as a ValueArray of a specific type. | |
virtual value_iterator | beginGeneric ()=0 |
virtual const_value_iterator | beginGeneric () const =0 |
virtual size_t | bytesPerElem () const =0 |
template<typename T > | |
const ValueArray< T > & | castToValueArray () const |
Dynamically cast the ValueBase up to its actual ValueArray<T>. | |
template<typename T > | |
ValueArray< T > & | castToValueArray () |
Dynamically cast the ValueBase up to its actual ValueArray<T>. | |
ValueArrayBase::Reference | cloneToNew (size_t length) const |
Create a new ValueArray, of the same type, but differnent size in memory. | |
size_t | compare (size_t start, size_t end, const ValueArrayBase &dst, size_t dst_start) const |
Compare the data of two ValueArray. | |
ValueArrayBase::Reference | convertByID (unsigned short ID, scaling_pair scaling=scaling_pair()) |
Get this as a ValueArray of a specific type. | |
template<typename T > | |
ValueArray< T > | copyAs (scaling_pair scaling=scaling_pair()) const |
Copy this to a new ValueArray<T> using newly allocated memory. | |
Reference | copyByID (unsigned short ID=0, scaling_pair scaling=scaling_pair()) const |
Create new data in memory containg a (converted) copy of this. | |
template<typename T > | |
bool | copyFromMem (const T *const src, size_t len, scaling_pair scaling=scaling_pair()) |
Copies elements from raw memory into this. | |
void | copyRange (size_t start, size_t end, ValueArrayBase &dst, size_t dst_start) const |
Copy a range of elements to another ValueArray of the same type. | |
bool | copyTo (isis::data::ValueArrayBase &dst, scaling_pair scaling=scaling_pair()) const |
Copies elements from this into another ValueArray. | |
template<typename T > | |
bool | copyToMem (T *dst, size_t len, scaling_pair scaling=scaling_pair()) const |
Copies elements from this into raw memory. | |
value_iterator | endGeneric () |
const_value_iterator | endGeneric () const |
virtual void | endianSwap ()=0 |
const Converter & | getConverterTo (unsigned short ID) const |
size_t | getLength () const |
virtual std::pair < util::ValueReference, util::ValueReference > | getMinMax () const =0 |
Get minimum/maximum of a ValueArray. | |
virtual boost::shared_ptr < const void > | getRawAddress (size_t offset=0) const =0 |
Get the raw address the ValueArray points to. | |
virtual boost::shared_ptr< void > | getRawAddress (size_t offset=0)=0 |
virtual scaling_pair | getScalingTo (unsigned short typeID, const std::pair< util::ValueReference, util::ValueReference > &minmax, autoscaleOption scaleopt=autoscale) const |
virtual scaling_pair | getScalingTo (unsigned short typeID, autoscaleOption scaleopt=autoscale) const =0 |
get the scaling (and offset) which would be used in an conversion | |
template<typename T > | |
bool | is () const |
virtual std::vector< Reference > | splice (size_t size) const =0 |
Splice up the ValueArray into equal sized blocks. | |
size_t | useCount () const |
virtual | ~ValueArrayBase () |
Static Public Member Functions | |
static Reference | createByID (unsigned short ID, size_t len) |
Create a ValueArray of given type and length. | |
Protected Member Functions | |
virtual ValueArrayBase * | clone () const =0 |
Create a ValueArray of the same type pointing at the same address. | |
ValueArrayBase (size_t len=0) | |
Protected Attributes | |
size_t | m_len |
Friends | |
class | util::_internal::GenericReference< ValueArrayBase > |
Definition at line 125 of file valuearray_base.hpp.
typedef _internal::GenericValueIterator<true> isis::data::ValueArrayBase::const_value_iterator |
Definition at line 139 of file valuearray_base.hpp.
Definition at line 141 of file valuearray_base.hpp.
typedef _internal::ValueArrayConverterMap::mapped_type::mapped_type isis::data::ValueArrayBase::Converter |
Definition at line 174 of file valuearray_base.hpp.
Definition at line 173 of file valuearray_base.hpp.
typedef _internal::GenericValueIterator<false> isis::data::ValueArrayBase::value_iterator |
Definition at line 138 of file valuearray_base.hpp.
Definition at line 140 of file valuearray_base.hpp.
isis::data::ValueArrayBase::ValueArrayBase | ( | size_t | len = 0 | ) | [protected] |
Definition at line 28 of file valuearray_base.cpp.
isis::data::ValueArrayBase::~ValueArrayBase | ( | ) | [virtual] |
Definition at line 32 of file valuearray_base.cpp.
ValueArray<T> isis::data::ValueArrayBase::as | ( | scaling_pair | scaling = scaling_pair() | ) | [inline] |
Get this as a ValueArray of a specific type.
This does an automatic conversion into a new ValueArray if one of following is true:
Otherwise a cheap copy is done.
scaling | the scaling to be used (determined automatically if not given) |
Definition at line 310 of file valuearray_base.hpp.
virtual value_iterator isis::data::ValueArrayBase::beginGeneric | ( | ) | [pure virtual] |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
virtual const_value_iterator isis::data::ValueArrayBase::beginGeneric | ( | ) | const [pure virtual] |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
virtual size_t isis::data::ValueArrayBase::bytesPerElem | ( | ) | const [pure virtual] |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
const ValueArray<T>& isis::data::ValueArrayBase::castToValueArray | ( | ) | const [inline] |
Dynamically cast the ValueBase up to its actual ValueArray<T>.
Constant version. Will send an error if T is not the actual type and _ENABLE_CORE_LOG is true.
Definition at line 185 of file valuearray_base.hpp.
ValueArray<T>& isis::data::ValueArrayBase::castToValueArray | ( | ) | [inline] |
Dynamically cast the ValueBase up to its actual ValueArray<T>.
Referenced version. Will send an error if T is not the actual type and _ENABLE_CORE_LOG is true.
Definition at line 194 of file valuearray_base.hpp.
virtual ValueArrayBase* isis::data::ValueArrayBase::clone | ( | ) | const [protected, pure virtual] |
Create a ValueArray of the same type pointing at the same address.
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
ValueArrayBase::Reference isis::data::ValueArrayBase::cloneToNew | ( | size_t | length | ) | const |
Create a new ValueArray, of the same type, but differnent size in memory.
(The actual data are _not_ copied)
length | length of the new memory block in elements of the given TYPE |
Definition at line 161 of file valuearray_base.cpp.
size_t isis::data::ValueArrayBase::compare | ( | size_t | start, |
size_t | end, | ||
const ValueArrayBase & | dst, | ||
size_t | dst_start | ||
) | const |
Compare the data of two ValueArray.
Counts how many elements in this and the given ValueArray are different within the given range. If the type of this is not equal to the type of the given ValueArray the whole length is assumed to be different. If the given range does not fit into this or the given ValueArray an error is send to the runtime log and the function will probably crash.
start | the first element in this, which schould be compared to the first element in the given TyprPtr |
end | the first element in this, which should _not_ be compared anymore to the given TyprPtr |
dst | the given ValueArray this should be compared to |
dst_start | the first element in the given TyprPtr, which schould be compared to the first element in this |
Definition at line 64 of file valuearray_base.cpp.
ValueArrayBase::Reference isis::data::ValueArrayBase::convertByID | ( | unsigned short | ID, |
scaling_pair | scaling = scaling_pair() |
||
) |
Get this as a ValueArray of a specific type.
This does an automatic conversion into a new ValueArray if one of following is true:
Otherwise a cheap copy is done.
ID | the ID of the requeseted type (use ValueArray::staticID) |
scaling | the scaling to be used (determined automatically if not given) |
Definition at line 148 of file valuearray_base.cpp.
ValueArray<T> isis::data::ValueArrayBase::copyAs | ( | scaling_pair | scaling = scaling_pair() | ) | const [inline] |
Copy this to a new ValueArray<T> using newly allocated memory.
This will create a new ValueArray of type T and the length of this. The memory will be allocated and the data of this will be copy-converted to T using min/max as value range. If the conversion fails, an error will be send to CoreLog and the data of the newly created ValueArray will be undefined.
Definition at line 279 of file valuearray_base.hpp.
ValueArrayBase::Reference isis::data::ValueArrayBase::copyByID | ( | unsigned short | ID = 0 , |
scaling_pair | scaling = scaling_pair() |
||
) | const |
Create new data in memory containg a (converted) copy of this.
Allocates new memory of the requested type and copies the (converted) content of this into that memory.
ID | the ID of the type the new ValueArray (referenced by the Reference returned) should have (if not given, type of the source is used) |
scaling | the scaling to be used if a conversion is necessary (computed automatically if not given) |
Definition at line 87 of file value_base.cpp.
bool isis::data::ValueArrayBase::copyFromMem | ( | const T *const | src, |
size_t | len, | ||
scaling_pair | scaling = scaling_pair() |
||
) | [inline] |
Copies elements from raw memory into this.
This is allways a deep copy, regardless of the types. If the this and the target are not of the same length:
src | pointer to the target memory |
len | size (in elements) of the target memory |
scaling | the scaling to be used if a conversion is necessary (computed automatically if not given) |
Definition at line 260 of file valuearray_base.hpp.
void isis::data::ValueArrayBase::copyRange | ( | size_t | start, |
size_t | end, | ||
ValueArrayBase & | dst, | ||
size_t | dst_start | ||
) | const |
Copy a range of elements to another ValueArray of the same type.
start | first element in this to be copied |
end | last element in this to be copied |
dst | target for the copy |
dst_start | starting element in dst to be overwritten |
Definition at line 167 of file valuearray_base.cpp.
bool isis::data::ValueArrayBase::copyTo | ( | isis::data::ValueArrayBase & | dst, |
scaling_pair | scaling = scaling_pair() |
||
) | const |
Copies elements from this into another ValueArray.
This is allways a deep copy, regardless of the types. If necessary, a conversion will be done. If the this and the target are not of the same length:
dst | the ValueArray-object to copy into |
scaling | the scaling to be used if a conversion is necessary (computed automatically if not given) |
Definition at line 116 of file valuearray_base.cpp.
bool isis::data::ValueArrayBase::copyToMem | ( | T * | dst, |
size_t | len, | ||
scaling_pair | scaling = scaling_pair() |
||
) | const [inline] |
Copies elements from this into raw memory.
This is allways a deep copy, regardless of the types. If the this and the target are not of the same length:
dst | pointer to the target memory |
len | size (in elements) of the target memory |
scaling | the scaling to be used if a conversion is necessary (computed automatically if not given) |
Definition at line 245 of file valuearray_base.hpp.
ValueArrayBase::Reference isis::data::ValueArrayBase::createByID | ( | unsigned short | ID, |
size_t | len | ||
) | [static] |
Create a ValueArray of given type and length.
This allocates memory as needed but does not initialize it.
ValueArrayBase::value_iterator isis::data::ValueArrayBase::endGeneric | ( | ) |
Definition at line 209 of file valuearray_base.cpp.
ValueArrayBase::const_value_iterator isis::data::ValueArrayBase::endGeneric | ( | ) | const |
Definition at line 213 of file valuearray_base.cpp.
virtual void isis::data::ValueArrayBase::endianSwap | ( | ) | [pure virtual] |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
const ValueArrayBase::Converter & isis::data::ValueArrayBase::getConverterTo | ( | unsigned short | ID | ) | const |
Definition at line 55 of file valuearray_base.cpp.
size_t isis::data::ValueArrayBase::getLength | ( | ) | const |
Definition at line 30 of file valuearray_base.cpp.
virtual std::pair<util::ValueReference, util::ValueReference> isis::data::ValueArrayBase::getMinMax | ( | ) | const [pure virtual] |
Get minimum/maximum of a ValueArray.
This computes the minimum and maximum value of the stored data and stores them in ValueReference-Objects. This actually returns the bounding box of the values in the value space of the type. This means:
std::pair<util::ValueReference,util::ValueReference> minmax1=data1.getMinMax(), minmax2=data2.getMinMax(); if(minmax1.first->gt(minmax2.second) && minmax1.second->lt(minmax2.second) std::cout << minmax1 << " is a subset of " minmax2 << std::endl;
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
virtual boost::shared_ptr<void> isis::data::ValueArrayBase::getRawAddress | ( | size_t | offset = 0 | ) | [pure virtual] |
Get the raw address the ValueArray points to.
An offset can be added to the result. If it is not zero, the resulting shared_ptr will use DelProxy as deleter. Thus, it will increase the reference count of the original pointer by one and decrease it when the deletion of the offset pointer is triggered.
offset | ammount of bytes to displace the resulting pointer from the actual pointer |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
virtual boost::shared_ptr<const void> isis::data::ValueArrayBase::getRawAddress | ( | size_t | offset = 0 | ) | const [pure virtual] |
Get the raw address the ValueArray points to.
An offset can be added to the result. If it is not zero, the resulting shared_ptr will use DelProxy as deleter. Thus, it will increase the reference count of the original pointer by one and decrease it when the deletion of the offset pointer is triggered.
offset | ammount of bytes to displace the resulting pointer from the actual pointer |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
scaling_pair isis::data::ValueArrayBase::getScalingTo | ( | unsigned short | typeID, |
const std::pair< util::ValueReference, util::ValueReference > & | minmax, | ||
autoscaleOption | scaleopt = autoscale |
||
) | const [virtual] |
Definition at line 192 of file valuearray_base.cpp.
virtual scaling_pair isis::data::ValueArrayBase::getScalingTo | ( | unsigned short | typeID, |
autoscaleOption | scaleopt = autoscale |
||
) | const [pure virtual] |
get the scaling (and offset) which would be used in an conversion
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
bool isis::data::ValueArrayBase::is | ( | ) | const |
Definition at line 382 of file valuearray.hpp.
virtual std::vector<Reference> isis::data::ValueArrayBase::splice | ( | size_t | size | ) | const [pure virtual] |
Splice up the ValueArray into equal sized blocks.
This virtually creates new data blocks of the given size by computing new pointers into the block and creating ValueArray objects for them. This ValueArray objects use the reference counting of the original ValueArray via DelProxy, so the original data are only deleted (as a whole) when all spliced and all "normal" ValueArray for this data are deleted.
size | the maximum size of the spliced parts of the data (the last part can be smaller) |
Implemented in isis::data::ValueArray< TYPE >, and isis::data::ValueArray< uint8_t >.
size_t isis::data::ValueArrayBase::useCount | ( | ) | const |
Definition at line 205 of file valuearray_base.cpp.
friend class util::_internal::GenericReference< ValueArrayBase > [friend] |
Definition at line 127 of file valuearray_base.hpp.
size_t isis::data::ValueArrayBase::m_len [protected] |
Definition at line 131 of file valuearray_base.hpp.