A handle for an RMF file.
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 for the non-modifying methods.
Inheritance diagram for RMF::FileHandle:Public Member Functions | |
| FileHandle () | |
| Empty file handle, no open file. | |
| void | validate () 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 | flush () |
| template<class T > | |
| T | get_associated_data (int index) |
| bool | get_has_associated_data (int index) |
| std::string | get_name () const |
| unsigned int | get_number_of_frames () const |
| unsigned int | get_number_of_node_pairs () const |
| unsigned int | get_number_of_node_quads () const |
| template<int Arity> | |
| unsigned int | get_number_of_node_sets () const |
| unsigned int | get_number_of_node_triplets () const |
| operator Showable () const | |
| void | show (std::ostream &out) const |
| template<class TypeT , int Arity> | |
| Key< TypeT, Arity > | get_key (CategoryD< Arity > category_id, std::string name, bool per_frame) const |
| template<class TypeT , int Arity> | |
| bool | get_has_key (CategoryD< Arity > category_id, std::string name, bool per_frame) const |
| template<class TypeT , int Arity> | |
| vector< Key< TypeT, Arity > > | get_keys (CategoryD< Arity > category_id) const |
| ArityTypeKey | get_type_key (ArityCategory category_id, std::string nm, bool per_frame) const |
| bool | get_has_type_key (ArityCategory category_id, std::string nm, bool per_frame) const |
| std::string | get_name (ArityTypeKey k) const |
| ArityCategory | get_category (ArityTypeKey k) const |
| ArityTypeKeys | get_type_keys (ArityCategory category_id) const |
| bool | get_is_per_frame (ArityTypeKey k) const |
| PythonList | get_keys (Category c, int arity=1) const |
| Return a list with all the keys from that category. | |
| PythonList | get_node_sets (int arity) const |
| Return all sets of that arity. | |
| std::string | get_description () const |
| template<int Arity> | |
| bool | get_has_category (std::string name) const |
| template<int Arity> | |
| CategoryD< Arity > | get_category (std::string name) const |
| template<int Arity> | |
| vector< CategoryD< Arity > > | get_categories () const |
| template<int Arity> | |
| std::string | get_category_name (CategoryD< Arity > kc) const |
| bool | get_has_arity_category (std::string name) const |
| ArityCategory | get_arity_category (std::string name) const |
| std::string | get_name (ArityCategory kc) const |
| ArityCategories | get_arity_categories () const |
| std::string | get_prefixcategory_name (ArityCategory kc) const |
Methods for manipulating keys | |
When using C++ it is most convenient to specify types when adding and using keys through template arguments. For python we provide non-template versions, below. | |
| template<class TypeT , int Arity> | |
| Key< TypeT, Arity > | add_key (CategoryD< Arity > category_id, std::string name, bool per_frame) const |
Non-template versions for python | |
Type is one of the standard types an arity is one of the empty string (for single nodes), pair, triplet or quad. | |
| ArityTypeKey | add_type_key (ArityCategory category_id, std::string nm, bool per_frame) const |
Python only | |
| template<int Arity> | |
| NodeSetHandle< Arity > | add_node_set (const NodeHandles &nh, NodeSetType tt) |
| NodeHandle | get_root_node () const |
| Return the root of the hierarchy. | |
| template<int Arity> | |
| vector< NodeSetHandle< Arity > > | get_node_sets () const |
| NodePairHandles | get_node_pairs () const |
| NodePairHandle | add_node_pair (const NodeHandles &nh, NodeSetType tt) |
| NodeTripletHandles | get_node_triplets () const |
| NodeTripletHandle | add_node_triplet (const NodeHandles &nh, NodeSetType tt) |
| NodeQuadHandles | get_node_quads () const |
| NodeQuadHandle | add_node_quad (const NodeHandles &nh, NodeSetType tt) |
| template<class T > | |
| NodeHandle | get_node_from_association (const T &d) const |
| NodeHandle | get_node_from_id (NodeID id) const |
| void | set_number_of_frames_hint (unsigned int i) |
Descriptions | |
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. | |
| void | set_description (std::string descr) |
Key categories template methods | |
Methods for managing the key categories in this RMF. | |
| template<int Arity> | |
| CategoryD< Arity > | add_category (std::string name) |
| RMF::FileHandle::FileHandle | ( | ) |
Empty file handle, no open file.
| Key<TypeT, Arity> RMF::FileHandle::add_key | ( | CategoryD< Arity > | category_id, |
| std::string | name, | ||
| bool | per_frame | ||
| ) | const |
Create a key for a new type of data. There must not already be a key with the same name of any type.
| 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.
Reimplemented from RMF::FileConstHandle.
| NodeHandle RMF::FileHandle::get_root_node | ( | ) | const |
Return the root of the hierarchy.
Reimplemented from RMF::FileConstHandle.
| void RMF::FileHandle::set_number_of_frames_hint | ( | unsigned int | i | ) |
Suggest how many frames the file is likely to have. This can make writing more efficient as space will be preallocated.
| void RMF::FileHandle::validate | ( | ) | const |
Check invariants that should old in the file but are not checked on the fly. New invariants can be added with the IMP_RMF_VALIDATOR() macro.