39 #ifndef CASTABLE_ITERATOR
40 #define CASTABLE_ITERATOR
62 setPtr(NULL,
typeid(
void));
82 throw std::runtime_error(
"CastableIterator(std::string *p): std::string iterators not implemented");
88 throw std::runtime_error(
"CastableIterator(void *p): void iterators not allowed");
111 if (
typeid(T) ==
typeid(
void)){
118 if (typeIsSet() && (
getType() !=
typeid(T))){
122 throw std::runtime_error(
"CastableIterator operator=(T *p): implicit type change requested");
156 return (caster.
ptr == it.caster.
ptr);
160 bool operator!=(
const CastableIterator &it)
const {
161 return (caster.
ptr != it.caster.ptr);
165 bool operator<(
const CastableIterator &it)
const {
166 return (caster.
ptr < it.caster.ptr);
170 bool operator>(
const CastableIterator &it)
const {
171 return (caster.
ptr > it.caster.ptr);
175 CastableIterator & operator++(){
176 char *cptr = (
char *)caster.
ptr;
185 char *cptr = (
char *)caster.
ptr;
192 char *cptr = (
char *)caster.
ptr;
201 char *cptr = (
char *)caster.
ptr;
208 const Castable & operator*()
const {
214 Castable & operator*(){
215 return (Castable &)*
this;
219 operator const void*()
const {
235 return (T)(caster.
ptr);
243 std::ostream & operator<<(std::ostream & ostr,
const CastableIterator & it){
Definition: CastableIterator.h:57
CastableIterator operator--(int)
Not recommended, use prefix operator--() instead.
Definition: CastableIterator.h:199
const std::type_info & getType() const
Return the storage type (base type) of the referenced variable.
Definition: CastableIterator.h:149
CastableIterator & operator=(const CastableIterator &it)
Moves iterator to address pointed by &it. Changes the internal type accordingly.
Definition: CastableIterator.h:96
void setType(const std::type_info &type)
Moves iterator to address *p.
Definition: CastableIterator.h:144
CastableIterator operator++(int)
Not recommended, use prefix operator++() instead.
Definition: CastableIterator.h:183
CastableIterator & operator=(T *p)
Moves iterator to address *p.
Definition: CastableIterator.h:109
Definition: Castable.h:76
size_t elementCount
Pointer to the data variable.
Definition: Castable.h:1209
void setPtr(void *p)
Stores the pointer and its storage type F. Assumes elementCount=1.
Definition: Castable.h:875
const std::type_info & getType() const
Returns type_info of the current type.
Definition: Caster.h:144
size_t getElementSize() const
Returns the size of the base type (size of an element, not of element array).
Definition: Caster.h:151
void setType(const std::type_info &t)
Calls setType<T>() for which typeid(T) = t.
Definition: Caster.h:119
void * ptr
Future member: enables setting Caster type.
Definition: Caster.h:247
Definition: DataSelector.cpp:1277