yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis  1.9.0
YODA::Index Class Reference

Index of a file. More...

#include "YODA/Index.h"

Public Types

using AOIndex = std::unordered_map< std::string, std::unordered_map< std::string, int > >
 Alias for nested unordered_map for index. More...
 

Public Member Functions

 Index ()=default
 
 Index (AOIndex &&idx) noexcept
 
 Index (const AOIndex &idx)
 
 Index (Index &&other)
 
Indexoperator= (const Index &rhs)
 
Indexoperator= (Index &&rhs)
 
 operator AOIndex () const
 Implicitly cast to a nested index map. More...
 
AOIndex getAOIndex () const
 Get nested index map. More...
 
std::string toString () const
 Get string representation of index. More...
 

Detailed Description

Index of a file.

This class holds index of a file in form of nested unordered_map.

Definition at line 13 of file Index.h.

Member Typedef Documentation

◆ AOIndex

using YODA::Index::AOIndex = std::unordered_map<std::string, std::unordered_map<std::string, int> >

Alias for nested unordered_map for index.

Structure: { "Scatter2D": { "/ATLAS_2017_I1514251/d09-x01-y01": 3 } }

Definition at line 26 of file Index.h.

Constructor & Destructor Documentation

◆ Index() [1/4]

YODA::Index::Index ( )
default

◆ Index() [2/4]

YODA::Index::Index ( AOIndex &&  idx)
inlinenoexcept

Definition at line 30 of file Index.h.

30 : _index(idx) {}

◆ Index() [3/4]

YODA::Index::Index ( const AOIndex idx)
inline

Definition at line 32 of file Index.h.

32 : _index(idx) {}

◆ Index() [4/4]

YODA::Index::Index ( Index &&  other)
inline

Definition at line 34 of file Index.h.

34 : _index(std::move(other._index)) {}

Member Function Documentation

◆ getAOIndex()

AOIndex YODA::Index::getAOIndex ( ) const
inline

Get nested index map.

Definition at line 50 of file Index.h.

50 { return _index; }

◆ operator AOIndex()

YODA::Index::operator AOIndex ( ) const
inline

Implicitly cast to a nested index map.

Definition at line 47 of file Index.h.

47 {return _index; }

◆ operator=() [1/2]

Index& YODA::Index::operator= ( const Index rhs)
inline

Definition at line 36 of file Index.h.

36  {
37  _index = rhs._index;
38  return *this;
39  }

◆ operator=() [2/2]

Index& YODA::Index::operator= ( Index &&  rhs)
inline

Definition at line 41 of file Index.h.

41  {
42  _index = std::move(rhs._index);
43  return *this;
44  }

◆ toString()

std::string YODA::Index::toString ( ) const
inline

Get string representation of index.

Definition at line 53 of file Index.h.

53  {
54  std::ostringstream indexStr;
55  for (const auto& kv : this->_index) {
56  indexStr << "OBJECT TYPE: " << kv.first << "\n";
57 
58  for (const auto& path_to_bincount : kv.second) {
59  indexStr << " ----------\n";
60  indexStr << " "
61  << "PATH: " << path_to_bincount.first << "\n";
62  indexStr << " "
63  << "BIN COUNT: " << path_to_bincount.second << "\n";
64  indexStr << " ----------\n";
65  }
66  }
67  return indexStr.str();
68  }

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