IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
VersionInfo.h
Go to the documentation of this file.
1 /**
2  * \file IMP/VersionInfo.h \brief Version and authorship of IMP objects.
3  *
4  * Copyright 2007-2016 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPKERNEL_VERSION_INFO_H
9 #define IMPKERNEL_VERSION_INFO_H
10 
11 #include <IMP/kernel_config.h>
12 #include "exception.h"
13 #include "comparison_macros.h"
14 #include "check_macros.h"
15 #include "showable_macros.h"
16 #include "value_macros.h"
17 #include "Value.h"
18 #include <iostream>
19 
20 IMPKERNEL_BEGIN_NAMESPACE
21 
22 //! Version and module information for Objects
23 /** All IMP::Object -derived objects have a method
24  IMP::Object::get_version_info() returning such an object. The
25  version info allows one to determine the module and version of
26  all restraints used to help creating reproducible results.
27  */
28 class IMPKERNELEXPORT VersionInfo : public Value {
29  public:
30  //! Create a VersionInfo object with the given module and version.
31  VersionInfo(std::string module, std::string version);
32 
33  VersionInfo() {}
34 
35  std::string get_module() const { return module_; }
36 
37  std::string get_version() const { return version_; }
39  IMP_USAGE_CHECK(!module_.empty(),
40  "Attempting to use uninitialized version info");
41  out << module_ << " " << version_;
42  });
43  IMP_COMPARISONS_2(VersionInfo, module_, version_);
44 
45  private:
46  std::string module_, version_;
47 };
49 
50 IMPKERNEL_END_NAMESPACE
51 
52 #endif /* IMPKERNEL_VERSION_INFO_H */
#define IMP_COMPARISONS_2(Name, f0, f1)
Implement comparison in a class using field as the variable to compare.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Various general useful macros for IMP.
Exception definitions and assertions.
Base for a simple primitive-like type.
Definition: Value.h:21
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Version and module information for Objects.
Definition: VersionInfo.h:28
Exception definitions and assertions.
Basic types used by IMP.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:168
Various general useful macros for IMP.
Various general useful macros for IMP.