openmbvcppinterface 3.1.0 OpenMBV C++ Interface

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OpenMBV::Group Class Reference

`#include <group.h>`

Inheritance diagram for OpenMBV::Group:
[legend]

## Public Member Functions

void | setExpand (bool expand)
bool | getExpand ()
void | addObject (const std::shared_ptr< Object > &newObject)
std::vector< std::shared_ptr< Object > > & | getObjects ()
std::shared_ptr< H5::File > & | getHDF5File ()
std::string | getFileName ()
std::string | getFullName () override
void | setFileName (const std::string &fn)
void | write (bool writeXMLFile=true, bool writeH5File=true)
void | read ()
void | enableSWMR ()
void | flushIfRequested ()
void | refresh ()
void | requestFlush ()
void | setCloseRequestCallback (const std::function< void()> &closeRequestCallback_)
void | setRefreshCallback (const std::function< void()> &refreshCallback_)
void | initializeUsingXML (xercesc::DOMElement *element) override
xercesc::DOMElement * | writeXMLFile (xercesc::DOMNode *parent) override
std::shared_ptr< Group > | getTopLevelGroup ()
Public Member Functions inherited from OpenMBV::Object
void | setEnable (bool enable)
bool | getEnable ()
void | setBoundingBox (bool bbox)
bool | getBoundingBox ()
void | setName (const std::string &name_)
std::string | getName ()
void | setEnvironment (bool env)
bool | getEnvironment ()
std::shared_ptr< Group > | getTopLevelGroup ()
std::weak_ptr< Group > | getParent ()
H5::GroupBase * | getHDF5Group ()
std::string | getID () const
void | setID (std::string ID_)

## Protected Member Functions

void | createHDF5File () override
void | openHDF5File () override
void | writeXML ()
void | readXML ()

## Protected Attributes

std::vector< std::shared_ptr< Object > > | object
std::string | expandStr
std::string | fileName
std::shared_ptr< H5::File > | hdf5File
std::function< void()> | closeRequestCallback
std::function< void()> | refreshCallback
Protected Attributes inherited from OpenMBV::Object
std::string | name
std::string | enableStr
std::string | boundingBoxStr
std::string | ID
std::string | environmentStr
std::weak_ptr< Group > | parent
H5::GroupBase * | hdf5Group {nullptr}
std::string | fullName

## Friends

class | Body
class | Object
class | ObjectFactory

## Detailed Description

A container for bodies

## Member Function Documentation

## ◆ addObject()

void OpenMBV::Group::addObject | ( | const std::shared_ptr< Object > & | newObject | ) |

Add a object to this object container

## ◆ enableSWMR()

void OpenMBV::Group::enableSWMR | ( |  | ) |

Enable SWMR if a H5 file is written.

## ◆ flushIfRequested()

void OpenMBV::Group::flushIfRequested | ( |  | ) |

Flush the H5 file if reader has requested a flush.

## ◆ getFileName()

std::string OpenMBV::Group::getFileName | ( |  | ) |

inline

Returns the file name of the .ombvx file including the absolute or relatvie path

## ◆ getFullName()

string OpenMBV::Group::getFullName | ( |  | ) |

override virtual

Returns the full name (path) of the object

Reimplemented from OpenMBV::Object.

## ◆ getTopLevelGroup()

std::shared_ptr<Group> OpenMBV::Group::getTopLevelGroup | ( |  | ) |

inline

return the top level Group

## ◆ initializeUsingXML()

void OpenMBV::Group::initializeUsingXML | ( | xercesc::DOMElement * | element | ) |

override virtual

Initializes the time invariant part of the object using a XML node

Reimplemented from OpenMBV::Object.

## ◆ read()

void OpenMBV::Group::read | ( |  | ) |

Read the tree (XML and h5).

## ◆ readXML()

void OpenMBV::Group::readXML | ( |  | ) |

protected

Read the XML file. Call this function to read an OpenMBV XML file and creating the Object tree.

## ◆ refresh()

void OpenMBV::Group::refresh | ( |  | ) |

Refresh the H5 file.

## ◆ requestFlush()

void OpenMBV::Group::requestFlush | ( |  | ) |

Request a flush of the writer

## ◆ setCloseRequestCallback()

void OpenMBV::Group::setCloseRequestCallback | ( | const std::function< void()> & | closeRequestCallback_ | ) |

inline

Set the callback which is called, by HDF5Serie, if reading this file should be closed (and reopened immediately after)

## ◆ setExpand()

void OpenMBV::Group::setExpand | ( | bool | expand | ) |

inline

Expand this tree node in a view if true (the default)

## ◆ setFileName()

void OpenMBV::Group::setFileName | ( | const std::string & | fn | ) |

inline

Sets the file name of the .ombvx file including the absolute or relatvie path

## ◆ setRefreshCallback()

void OpenMBV::Group::setRefreshCallback | ( | const std::function< void()> & | refreshCallback_ | ) |

inline

Set the callback which is called, by HDF5Serie, if, after a writer flush, the writer has finished the flush and this reader should now refresh the file.

## ◆ write()

void OpenMBV::Group::write | ( | bool | writeXMLFile = `true`,
|  | bool | writeH5File = `true`
| ) |  |

Initialize/Write the tree (XML and h5). Call this function for the root node of the tree to init the h5 file. (Only the h5 tree is written, but do data. Use append() to write date to h5 file after calling this function)

## ◆ writeXML()

void OpenMBV::Group::writeXML | ( |  | ) |

protected

Initialisze/Write the XML file. Call this function for the root node of the tree to create/write/ the XML file.

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

- /mbsim-env/openmbv/openmbvcppinterface/openmbvcppinterface/group.h
- /mbsim-env/openmbv/openmbvcppinterface/openmbvcppinterface/group.cc