35#include <drain/image/CoordinatePolicy.h>
41#include <drain/RegExp.h>
43#include <drain/util/BeanLike.h>
45#include <drain/util/ReferenceMap.h>
89 void getAttributes(
const Hi5Tree &src,
const Hi5Tree::path_t & path, M & attributes,
bool updateOnly =
false);
134 typedef std::map<std::string, ODIMPathElem> quantity_map;
148 void markExcluded(Hi5Tree &src,
const Hi5Tree::path_t & path,
bool exclude=
true);
163 bool treeToStream(
const Hi5Tree::node_data_t & data, std::ostream &ostr);
223void DataTools::getAttributes(
const Hi5Tree &src,
const Hi5Tree::path_t & p, M & attributes,
bool updateOnly){
237 if (p.empty() || !p.front().isRoot()){
238 mout.
debug(
"add root and restart with path= '" , p ,
"' (revised code)" );
240 Hi5Tree::path_t pRooted;
241 pRooted.appendElem(Hi5Tree::path_t::elem_t::ROOT);
249 mout.
debug(
"path= '" , p ,
"'" );
251 Hi5Tree::path_t path;
252 std::stringstream sstr;
255 for (Hi5Tree::path_t::elem_t elem: p){
257 path.appendElem(elem);
259 mout.
debug(
"check='" , path ,
"'" );
261 const Hi5Tree & s = src(path);
269 for(
const auto & entry: group.attributes){
272 sstr << elem <<
':' << entry.first;
331 for (std::set<ODIMPathElem>::const_iterator git = EncodingODIM::attributeGroups.begin(); git != EncodingODIM::attributeGroups.end(); ++git){
332 const hi5::NodeHi5 & group = s[*git].data;
333 for(drain::VariableMap::const_iterator ait = group.attributes.begin(); ait != group.attributes.end(); ait++){
335 sstr << *git << ':' << ait->first;
336 //mout.debug(8) << "getAttributes: " << sstr.toStr() << '=' << it->second << mout.endl;
338 attributes[sstr.str()] = ait->second;
340 typename M::iterator it = attributes.find(sstr.str());
341 if (it != attributes.end())
342 it->second = ait->second;
348 if (i == std::string::npos){
349 //if (drain::Debug > 4){ std::cerr << "attributes " << attributes << '\n'; }
353 i = path.find('/', i+1);
355 //while (i < path.size()); //(i != std::string::npos);
A map of FlexVariable:s.
Definition VariableMap.h:138
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:312
Logger & debug(const TT &... args)
Debug information.
Definition Log.h:666
A map of Variables.
Definition VariableMap.h:61
Policies for coordinate underflows and overflows.
Definition CoordinatePolicy.h:106
static const ODIMPathElemSeq & attributeGroups
Copies contents of this to a h5 group.
Definition EncodingODIM.h:325
Definition DataSelector.cpp:44
std::map< std::string, ODIMPathElem > ODIMPathElemMap
Definition ODIMPath.h:465
QuantityMap & getQuantityMap()
Definition QuantityMap.cpp:279
Rack's hi5 structure that uses Rack classes (Tree, Data, Image).
Definition Hi5.h:74