28 #ifndef CORE_METADATA_ROW_BASE_H 29 #define CORE_METADATA_ROW_BASE_H 45 #define rowGetValueOrAbort(__row,__label, __d)\ 46 if (!__row.getValue(__label, __d))\ 47 REPORT_ERROR(ERR_ARG_MISSING,(String)"Cannot find label: " + MDL::label2Str(__label) ); 60 virtual bool empty()
const = 0;
61 virtual int size()
const = 0;
62 virtual void clear() = 0;
65 virtual ~MDRow() =
default;
67 virtual size_t id()
const {
72 virtual std::vector<MDLabel>
labels()
const = 0;
100 throw std::logic_error(
"Object does not exist!");
104 template <
typename T>
108 throw std::logic_error(
"Object does not exist!");
112 template <
typename T>
117 d =
obj->getValue2(T());
125 return (ptr !=
nullptr);
128 template <
typename T>
136 template <
typename T>
144 template <
typename T,
typename T1>
150 template <
typename T>
166 template <
bool IsConst>
184 return row->iteratorValue(i);
201 virtual MDObject* iteratorValue(
size_t i) = 0;
202 virtual const MDObject* iteratorValue(
size_t i)
const = 0;
const_iterator end() const
virtual bool empty() const =0
bool operator!=(const iterator_ptr &other) const
iterator_ptr(size_t i, const MDRow &row)
void addLabels(PyObject *dict)
bool getValue(MDObject &object) const
const int & getValue2(int) const
virtual std::vector< MDLabel > labels() const =0
virtual size_t id() const
virtual void addLabel(MDLabel label)=0
T & getValue(MDLabel label)
iterator_ptr & operator++()
void getValueOrDefault(MDLabel label, T &d, T1 def) const
virtual MDRow & operator=(const MDRow &)=0
bool fromString(const String &str)
friend std::ostream & operator<<(std::ostream &out, const MDRow &row)
virtual void resetGeo(bool addLabels=true)
virtual int size() const =0
const T & getValueOrDefault(MDLabel label, const T &def) const
T & getValueOrDefault(MDLabel label, const T &def)
void setValue(MDLabel label, const T &d, bool addLabel=true)
virtual bool containsLabel(MDLabel label) const =0
iterator_ptr & operator=(iterator_ptr const &right)
bool operator==(const iterator_ptr &other) const
iterator_ptr(iterator_ptr const &right)
TypeHelpers::choose< IsConst, const MDObject *, MDObject * >::type operator*() const
const T & getValue(MDLabel label) const
virtual void setValueFromStr(MDLabel label, const String &value)
bool getValue(MDLabel label, T &d) const
virtual MDObject * getObject(MDLabel label)=0
const_iterator begin() const