20#ifndef _OPENMBV_GROUP_H_
21#define _OPENMBV_GROUP_H_
23#include "hdf5serie/simpledataset.h"
24#include <openmbvcppinterface/objectfactory.h>
25#include <openmbvcppinterface/object.h>
34 ,
public std::enable_shared_from_this<Group>
41 std::vector<std::shared_ptr<Object> > object;
42 std::string expandStr;
43 boost::filesystem::path fileName;
44 std::shared_ptr<H5::File> hdf5File;
45 H5::SimpleDataset<int> *rowSize {
nullptr };
46 std::function<void()> closeRequestCallback;
47 std::function<void()> refreshCallback;
48 void createHDF5File()
override;
49 void openHDF5File()
override;
52 ~Group()
override =
default;
54 std::shared_ptr<xercesc::DOMDocument> writeXMLDoc();
67 void setExpand(
bool expand) { expandStr=(expand)?
"true":
"false"; }
69 bool getExpand() {
return expandStr==
"true"?
true:
false; }
72 void addObject(
const std::shared_ptr<Object>& newObject);
74 std::vector<std::shared_ptr<Object> >& getObjects() {
78 std::shared_ptr<H5::File> getHDF5File()
const {
return hdf5File; }
86 void setFileName(
const boost::filesystem::path &fn) { fileName=fn; }
92 void write(
bool writeXMLFile=
true,
bool writeH5File=
true,
bool embedXMLInH5=
false);
112 void flushIfRequested(
const std::function<
void(
const std::shared_ptr<Group> &)> &postFlushFunc={});
127 void setCloseRequestCallback(
const std::function<
void()> &closeRequestCallback_) { closeRequestCallback=closeRequestCallback_; }
131 void setRefreshCallback(
const std::function<
void()> &refreshCallback_) { refreshCallback=refreshCallback_; }
136 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent)
override;
140 std::shared_ptr<Group> p=parent.lock();
141 return !p?shared_from_this():p->getTopLevelGroup();
void setRowSize(int rs)
Definition: group.cc:206
void setCloseRequestCallback(const std::function< void()> &closeRequestCallback_)
Definition: group.h:127
void readXML()
Definition: group.cc:142
void addObject(const std::shared_ptr< Object > &newObject)
Definition: group.cc:50
void refresh()
Definition: group.cc:229
void write(bool writeXMLFile=true, bool writeH5File=true, bool embedXMLInH5=false)
Definition: group.cc:160
int getRowSize()
Definition: group.cc:211
void initializeUsingXML(xercesc::DOMElement *element) override
Definition: group.cc:119
void writeXML()
Definition: group.cc:115
void setExpand(bool expand)
Definition: group.h:67
void setFileName(const boost::filesystem::path &fn)
Definition: group.h:86
std::string getFullName() override
Definition: group.cc:59
std::shared_ptr< Group > getTopLevelGroup()
Definition: group.h:139
void setRefreshCallback(const std::function< void()> &refreshCallback_)
Definition: group.h:131
void flush()
Definition: group.cc:225
void read()
Definition: group.cc:239
void enableSWMR()
Definition: group.cc:201
std::string getFileName()
Definition: group.h:81
Definition: objectfactory.h:38