35 #include <drain/Log.h>
43 #include <drain/util/Path.h>
44 #include <drain/util/FlagsOld.h>
78 std::ostream & operator<<(std::ostream & ostr,
const ODIMPathElem & p);
171 const dict_t & getDictionary();
181 const index_t INDEX_MAX;
186 ODIMPathElem(
group_t group =
ROOT, index_t index = 1) : group(group), index(index){
196 ODIMPathElem(
const ODIMPathElem &e) : group(e.group), index(e.index){
197 if (e.group ==
OTHER)
198 currentStr = e.currentStr;
202 ODIMPathElem(
const std::string &s) : group(
ROOT), index(0){
207 ODIMPathElem(
const char *s): group(
ROOT), index(0){
268 mout.
note(
"index (" , i ,
") given for non-indexed element:" , *
this );
283 void set(
const std::string &s){
298 return (group ==
ROOT);
329 return ((this->group & groupFilter) == this->group);
339 index_t getIndex()
const {
346 char getCharCode()
const;
355 return getKey(this->group);
360 std::ostream &
toStream(std::ostream & sstr)
const;
366 const std::string &
str()
const {
367 if (this->group !=
OTHER){
368 std::stringstream sstr;
371 currentStr = sstr.str();
387 operator const std::string &()
const {
398 void add(
const std::string &s);
412 std::string currentStr;
421 extern ODIMPathElem odimROOT;
422 extern ODIMPathElem odimWHERE;
423 extern ODIMPathElem odimWHAT;
424 extern ODIMPathElem odimARRAY;
427 bool operator<(
const ODIMPathElem & e1,
const ODIMPathElem & e2);
429 bool operator==(
const ODIMPathElem & e1,
const ODIMPathElem & e2);
432 bool operator!=(
const ODIMPathElem & e1,
const ODIMPathElem & e2){
433 return ! operator==(e1, e2);
438 std::ostream & operator<<(std::ostream & ostr,
const ODIMPathElem & p) {
444 std::istream & operator>>(std::istream & istr, ODIMPathElem & p) {
446 drain::StringTools::read<512>(istr, s);
453 typedef drain::Path<ODIMPathElem,
'/',
true,
false,
true> ODIMPath;
455 typedef std::list<ODIMPath> ODIMPathList;
457 typedef std::vector<ODIMPathElem> ODIMPathElemSeq;
488 ODIMPathElem(elem), elangle(elangle), timestamp(date+time) {
492 std::string timestamp;
499 std::ostream & operator<<(std::ostream & ostr,
const ODIMPathElem2 & elem) {
500 return ostr << (
const ODIMPathElem &)elem <<
'-' << elem.timestamp <<
'-' << elem.elangle;
507 return e1.timestamp < e2.timestamp;
514 return e1.elangle < e2.elangle;
A bit vector with external Dictionary mapping from strings to bits and vice versa.
Definition: FlagsOld.h:45
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Logger & note(const TT &... args)
For top-level information.
Definition: Log.h:485
Definition: ODIMPath.h:476
Definition: ODIMPath.h:82
static const group_t WHAT
Metadata group /what , at any depth.
Definition: ODIMPath.h:124
static const group_t IS_INDEXED
Group index mask for groups that have an index.
Definition: ODIMPath.h:156
virtual void set(const std::string &s)
Assign a string to this path element.
Definition: ODIMPath.h:283
static const group_t LEGEND
Metadata array describing values in the image data (DATA). EXPERIMENTAL.
Definition: ODIMPath.h:143
ODIMPathElem & operator=(const T &s)
Redirects to set(const std::string &) .
Definition: ODIMPath.h:224
static const group_t DATASET
First level group, /dataset + digit .
Definition: ODIMPath.h:103
const std::string & getPrefix() const
Returns the name without the index.
Definition: ODIMPath.cpp:198
static const group_t ALL_LEVELS
Abbreviation for linking (referencing) attributes at different levels (tree depths).
Definition: ODIMPath.h:118
const std::string & getKey() const
Debugging/logging. Returns standard name. Does not check if type is OTHER.
Definition: ODIMPath.h:354
ODIMPathElem & operator=(const char *s)
Calls set(const std::string &) .
Definition: ODIMPath.h:235
static const group_t PALETTE
Palette data (to be linked). EXPERIMENTAL.
Definition: ODIMPath.h:140
bool is(group_t g) const
Abbreviation of (group == NONE)
Definition: ODIMPath.h:291
bool empty() const
Equivalent to isRoot(). This method is required in recognizing the leading empty string....
Definition: ODIMPath.h:303
virtual std::ostream & toStream(std::ostream &sstr) const
For string presentation.
Definition: ODIMPath.cpp:320
bool isRoot() const
Abbreviation of (group == ROOT)
Definition: ODIMPath.h:297
bool belongsTo(int groupFilter) const
Checks if the element belongs to any of groups given.
Definition: ODIMPath.h:327
virtual bool extractPrefix(const std::string &s, bool indexed)
Given the non-numeric prefix of a group, like "dataset" or "data", set the group.
Definition: ODIMPath.cpp:144
virtual void set(group_t g, index_t i=0)
The fundamental assignment operator.
Definition: ODIMPath.h:262
static const group_t ROOT
Definition: ODIMPath.h:99
static const group_t OTHER
User defined group, name stored as a separate string. The string may still contain numbers,...
Definition: ODIMPath.h:150
static const group_t HOW
Metadata group /how , at any depth.
Definition: ODIMPath.h:130
static const group_t ATTRIBUTE_GROUPS
Group index mask for groups that contain only meta data.
Definition: ODIMPath.h:133
static const group_t NONE
None (undefined)
Definition: ODIMPath.h:95
bool isIndexed() const
Abbreviation of (group == NONE)
Definition: ODIMPath.h:318
static const group_t QUALITY
Special group on first or second level, /quality + digit , used for storing quality data.
Definition: ODIMPath.h:112
static const group_t DATA_GROUPS
Group index mask for groups under which data arrays (ARRAY type) are found.
Definition: ODIMPath.h:115
drain::Flagger::ivalue_t group_t
In H5, "groups" correspond to "directories" or "folders" in Unix and Windows.
Definition: ODIMPath.h:91
const std::string & str() const
Writes the name, including the index, to output stream.
Definition: ODIMPath.h:366
static const group_t ALL_GROUPS
User defined group, name stored as a separate string. Index allowed, but only catenated in the string...
Definition: ODIMPath.h:137
static const group_t DATA
Second level group, /data + digit .
Definition: ODIMPath.h:106
static const group_t WHERE
Metadata group /where , at any depth.
Definition: ODIMPath.h:127
static const group_t ARRAY
Data group "data", at deepest level, like /dataset4/data2/quality1/data.
Definition: ODIMPath.h:109
virtual void extractIndex(const std::string &s)
Given a string starting with a numeral, try to extract the index.
Definition: ODIMPath.cpp:138
Definition: DataSelector.cpp:44
bool operator<(const ODIMPathElem &e1, const ODIMPathElem &e2)
Important!
Definition: ODIMPath.cpp:259
std::map< std::string, ODIMPathElem > ODIMPathElemMap
Definition: ODIMPath.h:462
Definition: ODIMPath.h:511
Definition: ODIMPath.h:504
Definition: ODIMPath.h:464