12 #include "RMF/config.h"
22 static std::string get_tag() {
return "f"; }
25 static std::string get_tag() {
return "n"; }
28 static std::string get_tag() {
return "c"; }
35 int compare(
const ID<TagT>& o)
const {
43 std::string get_string()
const {
45 return Tag::get_tag() +
"NULL";
46 else if (i_ == std::numeric_limits<int>::min())
47 return Tag::get_tag() +
"INV";
49 std::ostringstream oss;
50 oss << Tag::get_tag() << i_;
57 #if !defined(RMF_DOXGYGEN) && !defined(SWIG)
59 ID(
int i, SpecialTag) : i_(i) {}
60 int get_index_always()
const {
73 RMF_USAGE_CHECK(static_cast<int>(i_) >= 0,
74 Tag::get_tag() +
": Bad index passed on initialize");
76 ID() : i_(std::numeric_limits<int>::min()) {}
77 unsigned int get_index()
const {
86 RMF_SHOWABLE(
ID, get_string());
87 #if !defined(RMF_DOXYGEN) && !defined(SWIG)
93 int operator-(
const ID& other)
const {
100 template <
class TagT>
119 #if !defined(SWIG) && !defined(RMF_DOXYGEN)
120 template <
class Traits>
121 inline std::ostream& operator<<(std::ostream& out, ID<Traits> null) {
std::vector< Category > Categories
std::size_t hash_value(const BufferConstHandle &t)
Produce hash values for boost hash tables.
A general purpose ID in RMF used, with different tags, to identify things.
ID< CategoryTag > Category
Declarations of the various exception types.
#define RMF_COMPARISONS(Name)
Implement comparison in a class using field as the variable to compare.
#define RMF_HASHABLE(name, hashret)
Implement a hash function for the class.
std::vector< FrameID > FrameIDs
Various general useful macros for IMP.
std::vector< NodeID > NodeIDs