Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ODIMPathElem Class Reference
Inheritance diagram for ODIMPathElem:
Inheritance graph
[legend]

Public Types

typedef drain::Flagger flag_t
 
typedef drain::Flagger::dict_t dict_t
 
typedef drain::Flagger::ivalue_t group_t
 In H5, "groups" correspond to "directories" or "folders" in Unix and Windows.
 
typedef int index_t
 

Public Member Functions

 ODIMPathElem (group_t group=ROOT, index_t index=1)
 
 ODIMPathElem (const ODIMPathElem &e)
 
 ODIMPathElem (const std::string &s)
 
 ODIMPathElem (const char *s)
 
void reset ()
 
template<class T >
ODIMPathElemoperator= (const T &s)
 Redirects to set(const std::string &) . More...
 
ODIMPathElemoperator= (const char *s)
 Calls set(const std::string &) . More...
 
virtual void set (group_t g, index_t i=0)
 The fundamental assignment operator. More...
 
virtual void set (const std::string &s)
 Assign a string to this path element. More...
 
bool is (group_t g) const
 Abbreviation of (group == NONE)
 
bool isRoot () const
 Abbreviation of (group == ROOT)
 
bool empty () const
 Equivalent to isRoot(). This method is required in recognizing the leading empty string. Consider "/usr/include".
 
bool isIndexed () const
 Abbreviation of (group == NONE) More...
 
bool belongsTo (int groupFilter) const
 Checks if the element belongs to any of groups given.
 
group_t getType () const
 
index_t getIndex () const
 
const std::string & getPrefix () const
 Returns the name without the index.
 
char getCharCode () const
 
const std::string & getKey () const
 Debugging/logging. Returns standard name. Does not check if type is OTHER.
 
virtual std::ostream & toStream (std::ostream &sstr) const
 For string presentation. More...
 
const std::string & str () const
 Writes the name, including the index, to output stream.
 
 operator const std::string & () const
 
virtual bool extractPrefix (const std::string &s, bool indexed)
 Given the non-numeric prefix of a group, like "dataset" or "data", set the group. More...
 
template<>
void extractIndex (const std::string &s, ODIMPathElem::index_t &idx)
 
template<>
void extractIndex (const std::string &s, ODIMPathElemMatcher::idx_range_t &idx)
 

Static Public Member Functions

static bool isIndexed (group_t group)
 
static bool isQuality (group_t group)
 
static const dict_tgetDictionary ()
 
static const std::string & getKey (group_t g)
 Debugging/logging. Returns standard name. Does not check if type is OTHER.
 

Public Attributes

group_t group
 
index_t index
 

Static Public Attributes

static const group_t NONE = 0
 None (undefined)
 
static const group_t ROOT = 1
 
static const group_t DATASET = 2
 First level group, /dataset + digit .
 
static const group_t DATA = 4
 Second level group, /data + digit .
 
static const group_t ARRAY = 8
 Data group "data", at deepest level, like /dataset4/data2/quality1/data.
 
static const group_t QUALITY = 16
 Special group on first or second level, /quality + digit , used for storing quality data.
 
static const group_t DATA_GROUPS = DATASET | DATA | QUALITY
 Group index mask for groups under which data arrays (ARRAY type) are found.
 
static const group_t ALL_LEVELS = (ROOT | DATASET | DATA)
 Abbreviation for linking (referencing) attributes at different levels (tree depths).
 
static const group_t WHAT = 32
 Metadata group /what , at any depth.
 
static const group_t WHERE = 64
 Metadata group /where , at any depth.
 
static const group_t HOW = 128
 Metadata group /how , at any depth.
 
static const group_t ATTRIBUTE_GROUPS = WHAT|WHERE|HOW
 Group index mask for groups that contain only meta data.
 
static const group_t ALL_GROUPS = 255
 User defined group, name stored as a separate string. Index allowed, but only catenated in the string.
 
static const group_t PALETTE = 256
 Palette data (to be linked). EXPERIMENTAL.
 
static const group_t LEGEND = 512
 Metadata array describing values in the image data (DATA). EXPERIMENTAL.
 
static const group_t OTHER = 1024
 User defined group, name stored as a separate string. The string may still contain numbers, but no indices will be extracted. More...
 
static const group_t IS_INDEXED = (DATASET | DATA | QUALITY )
 Group index mask for groups that have an index.
 
static const index_t INDEX_MAX = std::numeric_limits<unsigned short int>::max()
 

Protected Member Functions

void add (const std::string &s)
 
virtual void extractIndex (const std::string &s)
 Given a string starting with a numeral, try to extract the index.
 

Static Protected Member Functions

template<class T >
static void extractIndex (const std::string &s, T &idx)
 

Protected Attributes

std::string currentStr
 

Member Function Documentation

◆ extractPrefix()

bool extractPrefix ( const std::string &  s,
bool  indexed 
)
virtual

Given the non-numeric prefix of a group, like "dataset" or "data", set the group.

Check first if prefix AND index match.

Reimplemented in ODIMPathElemMatcher.

◆ isIndexed()

bool isIndexed ( ) const
inline

Abbreviation of (group == NONE)

Returns true, if group is DATASET, DATA or QUALITY

◆ operator=() [1/2]

ODIMPathElem& operator= ( const char *  s)
inline

Calls set(const std::string &) .

Parameters
s- string corresponding a path element.

◆ operator=() [2/2]

ODIMPathElem& operator= ( const T &  s)
inline

Redirects to set(const std::string &) .

Template Parameters
T- something castable to std::string.
Parameters
s- std::string, or something directly castable to it.

◆ set() [1/2]

virtual void set ( const std::string &  s)
inlinevirtual

Assign a string to this path element.

Parameters
s- path element as a string, "dataset4" for example

Note that path separator is not recognized; instead, it will be assigned as a part of the string.

Returns
- true if a valid ODIM path element was created

Reimplemented in ODIMPathElemMatcher.

◆ set() [2/2]

virtual void set ( group_t  g,
index_t  i = 0 
)
inlinevirtual

The fundamental assignment operator.

The fundamental assignment operator

◆ toStream()

std::ostream & toStream ( std::ostream &  sstr) const
virtual

For string presentation.

Step 1: prefix (by group type)

Step 2: index

Reimplemented in ODIMPathElemMatcher.

Member Data Documentation

◆ OTHER

const ODIMPathElem::group_t OTHER = 1024
static

User defined group, name stored as a separate string. The string may still contain numbers, but no indices will be extracted.

Not indexed.

◆ ROOT

const ODIMPathElem::group_t ROOT = 1
static

Root of a path Zeroth level group, identified with empty string "", or "/" which is the separator prefixed with empty string.


The documentation for this class was generated from the following files: