RMF
RMF::FileHandle Class Reference

A handle for an RMF file. More...

#include <RMF/FileHandle.h>

Inheritance diagram for RMF::FileHandle:

Public Member Functions

 FileHandle ()
 Empty file handle, no open file.
FrameID add_frame (std::string name, FrameID parent, FrameType t=FRAME) const
 Add a frame and make it the current frame.
FrameID add_frame (std::string name, FrameType t=FRAME) const
 Add a frame and make it the current frame.
NodeHandle add_node (std::string name, NodeType t) const
 Add a node with no parents.
void flush () const
 Make sure all data gets written to disk.
NodeHandle get_node (NodeID id) const
 Return a NodeHandle from a NodeID.
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.
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.
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_

Detailed Description

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.

See also
create_rmf_file
create_rmf_buffer
Examples
benchmark/benchmark_rmf.cpp.

Definition at line 54 of file FileHandle.h.

Constructor & Destructor Documentation

◆ FileHandle()

RMF::FileHandle::FileHandle ( )

Definition at line 60 of file FileHandle.h.

Here is the call graph for this function:

Member Function Documentation

◆ add_frame() [1/2]

FrameID RMF::FileHandle::add_frame ( std::string name,
FrameID parent,
FrameType t = FRAME ) const

It will be the child of the passed frame.

◆ add_frame() [2/2]

FrameID RMF::FileHandle::add_frame ( std::string name,
FrameType t = FRAME ) const

◆ add_node()

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.

◆ flush()

void RMF::FileHandle::flush ( ) const

Once flush is called, it should be safe to open the file in another process for reading.

◆ get_node()

NodeHandle RMF::FileHandle::get_node ( NodeID id) const

The NodeID must refer to a valid NodeHandle.

Examples
benchmark/benchmark_rmf.cpp.

◆ get_node_from_association()

template<class T>
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.

◆ get_root_node()

NodeHandle RMF::FileHandle::get_root_node ( ) const
Examples
benchmark/benchmark_rmf.cpp.

Definition at line 66 of file FileHandle.h.

Here is the call graph for this function:

◆ set_description()

void RMF::FileHandle::set_description ( std::string descr) const

Each RMF structure has an associated description. This should consist of unstructured text describing the contents of the RMF data. Conventionally. this description can consist of multiple paragraphs, each separated by a newline character and should end in a newline.

◆ set_producer()

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.


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