9#ifndef RMF_FILE_HANDLE_H
10#define RMF_FILE_HANDLE_H
19#include "RMF/config.h"
20#include "RMF/internal/SharedData.h"
23#include "internal/SharedData.h"
55 friend class NodeHandle;
56 friend class std::shared_ptr<internal::SharedData>;
61#if !defined(RMF_DOXYGEN) && !defined(SWIG)
62 FileHandle(std::shared_ptr<internal::SharedData> shared_);
67 RMF_USAGE_CHECK(!
get_is_closed(),
"Operation on closed file.");
68 return NodeHandle(
NodeID(0), shared_);
84 if (!shared_->get_has_associated_node(d)) {
87 return NodeHandle(shared_->get_associated_node(d), shared_);
91 NodeHandle get_node_from_association(
void* d)
const;
Handle read/write of Model data from/to files.
Declaration of NodeHandle.
Manage a shared buffer for storing a RMF.
FileConstHandle()
Empty root handle, no open file.
bool get_is_closed() const
Return True iff the file is closed.
A handle for an RMF file.
void flush() const
Make sure all data gets written to disk.
void set_description(std::string descr) const
NodeHandle get_root_node() const
Return the root of the hierarchy stored in the file.
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.
NodeHandle get_node_from_association(const T &d) const
NodeHandle add_node(std::string name, NodeType t) const
Add a node with no parents.
void set_producer(std::string) const
NodeHandle get_node(NodeID id) const
Return a NodeHandle from a NodeID.
FrameID add_frame(std::string name, FrameType t=FRAME) const
Add a frame and make it the current frame.
A handle for a particular node in the hierarchy.
Various compiler workarounds.
The various enums used in RMF.
The namespace for all functionality in the library.
std::vector< FileHandle > FileHandles
Pass a list of them.
Enum< NodeTypeTag > NodeType
const FrameType FRAME
A frame in a sequence of frames.
FileHandle create_rmf_file(std::string path)
Create an RMF from a file system path.
Enum< FrameTypeTag > FrameType
FileHandle create_rmf_buffer(BufferHandle buffer)
Create an RMF in a buffer.
Default implementation for types.h.