RMF
|
A handle for an RMF file. More...
#include <RMF/FileHandle.h>
Public Member Functions | |
FileHandle () | |
Empty file handle, no open file. | |
FrameID | add_frame (std::string name, FrameType t=FRAME) const |
Add a frame and make it the current frame. | |
FrameID | add_frame (std::string name, FrameID parent, FrameType t=FRAME) const |
Add a frame and make it the current frame. More... | |
NodeHandle | add_node (std::string name, NodeType t) const |
Add a node with no parents. More... | |
void | flush () const |
Make sure all data gets written to disk. More... | |
NodeHandle | get_node (NodeID id) const |
Return a NodeHandle from a NodeID. More... | |
template<class T > | |
NodeHandle | get_node_from_association (const T &d) const |
NodeHandle | get_root_node () const |
Return the root of the hierarchy stored in the file. | |
void | set_description (std::string descr) const |
void | set_producer (std::string) const |
Public Member Functions inherited from RMF::FileConstHandle | |
FileConstHandle () | |
Empty root handle, no open file. | |
template<class T > | |
void | add_associated_data (int index, const T &t) |
void | close () |
Explicitly close the file handle. More... | |
template<class T > | |
T | get_associated_data (int index) |
std::string | get_description () const |
bool | get_has_associated_data (int index) |
bool | get_is_closed () const |
Return True iff the file is closed. | |
std::string | get_name () const |
NodeConstHandle | get_node (NodeID id) const |
template<class T > | |
NodeConstHandle | get_node_from_association (const T &d) const |
std::string | get_path () const |
std::string | get_producer () const |
NodeConstHandle | get_root_node () const |
Return the root of the hierarchy. | |
void | reload () |
Reread the file. More... | |
template<class Tag > | |
ID< Tag > | get_key (Category category, std::string name) const |
template<class Tag > | |
std::vector< ID< Tag > > | get_keys (Category category_id, const Strings &names) const |
template<class Tag > | |
std::vector< ID< Tag > > | get_keys (Category category) const |
template<class Tag > | |
ID< Tag > | get_key (Category category_id, std::string nm, Tag) const |
template<class Tag > | |
std::string | get_name (ID< Tag > k) const |
template<class Tag > | |
Category | get_category (ID< Tag > k) const |
template<class Tag > | |
std::vector< ID< Tag > > | get_keys (Category category_id, Tag) |
FrameID | get_current_frame () const |
FrameType | get_type (FrameID fr) const |
std::string | get_name (FrameID fr) const |
FrameIDs | get_children (FrameID id) const |
FrameIDs | get_parents (FrameID id) const |
void | set_current_frame (FrameID frame) const |
unsigned int | get_number_of_frames () const |
unsigned int | get_number_of_nodes () const |
std::string | get_file_type () const |
FrameIDs | get_root_frames () const |
boost::iterator_range < internal::integer_iterator < FrameID > > | get_frames () const |
boost::iterator_range < internal::integer_iterator < NodeID > > | get_node_ids () const |
PythonList | get_keys (Category c) const |
Return a list with all the keys from that category. | |
Category | get_category (std::string name) |
Categories | get_categories () const |
std::string | get_name (Category kc) const |
Additional Inherited Members | |
Protected Attributes inherited from RMF::FileConstHandle | |
std::shared_ptr < internal::SharedData > | shared_ |
Use this handle to perform operations relevant to the whole RMF hierarchy as well as to start traversal of the hierarchy.
Make sure to check out the base class documentation for the non-modifying methods.
Definition at line 54 of file FileHandle.h.
It will be the child of the passed frame.
NodeHandle RMF::FileHandle::add_node | ( | std::string | name, |
NodeType | t | ||
) | const |
This node will not be accessible in the hierarchy unless you add it as a child of something.
void RMF::FileHandle::flush | ( | ) | const |
Once flush is called, it should be safe to open the file in another process for reading.
NodeHandle RMF::FileHandle::get_node | ( | NodeID | id | ) | const |
The NodeID must refer to a valid NodeHandle.
NodeHandle RMF::FileHandle::get_node_from_association | ( | const T & | d | ) | const |
Each node in the hierarchy can be associated with some arbitrary bit of external data. Nodes can be extracted using these bits of data.
Definition at line 83 of file FileHandle.h.
void RMF::FileHandle::set_description | ( | std::string | descr | ) | const |
void RMF::FileHandle::set_producer | ( | std::string | ) | const |
Each RMF structure has an associated field that the code that produced the file can use to describe itself.