IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
base/VersionInfo.h
Go to the documentation of this file.
1
/**
2
* \file IMP/base/VersionInfo.h \brief Version and authorship of IMP objects.
3
*
4
* Copyright 2007-2013 IMP Inventors. All rights reserved.
5
*
6
*/
7
8
#ifndef IMPBASE_VERSION_INFO_H
9
#define IMPBASE_VERSION_INFO_H
10
11
#include <IMP/base/base_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
IMPBASE_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
IMPBASEEXPORT
VersionInfo
:
public
Value
29
{
30
public
:
31
//! Create a VersionInfo object with the given module and version.
32
VersionInfo
(std::string module, std::string version);
33
34
VersionInfo
() {}
35
36
std::string get_module()
const
{
return
module_; }
37
38
std::string get_version()
const
{
return
version_; }
39
IMP_SHOWABLE_INLINE
(
VersionInfo
, {
40
IMP_USAGE_CHECK
(!module_.empty(),
41
"Attempting to use uninitialized version info"
);
42
out << module_ <<
" "
<< version_;
43
}
44
);
45
IMP_COMPARISONS_2
(
VersionInfo
, module_, version_);
46
private
:
47
std::string module_, version_;
48
};
49
IMP_VALUES
(
VersionInfo
,
VersionInfos
);
50
51
IMPBASE_END_NAMESPACE
52
53
#endif
/* IMPBASE_VERSION_INFO_H */