IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
links.h
Go to the documentation of this file.
1
/**
2
* \file IMP/rmf/links.h
3
* \brief Handle read/write of Model data from/to files.
4
*
5
* Copyright 2007-2013 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPRMF_LINKS_H
10
#define IMPRMF_LINKS_H
11
12
#include <IMP/rmf/rmf_config.h>
13
#include <RMF/NodeHandle.h>
14
#include <RMF/FileHandle.h>
15
#include <
IMP/base/Object.h
>
16
#include <
IMP/base/Pointer.h
>
17
#include <
IMP/base/object_macros.h
>
18
#include <
IMP/base/log_macros.h
>
19
20
IMPRMF_BEGIN_NAMESPACE
21
22
23
#ifndef IMP_DOXYGEN
24
IMPRMFEXPORT
25
unsigned
int
get_load_linker_index(std::string st);
26
IMPRMFEXPORT
27
unsigned
int
get_save_linker_index(std::string st);
28
#endif
29
30
class
SaveLink;
31
class
LoadLink
;
32
IMP_OBJECTS
(
SaveLink
,
SaveLinks
);
33
34
IMP_OBJECTS
(
LoadLink
,
LoadLinks
);
35
36
/** Manage a link between an \imp object and a part
37
of the RMF file. This allows conformations to be
38
loaded flexibly.
39
40
LoadLinks must not save any handles to RMF objects.
41
*/
42
class
IMPRMFEXPORT
LoadLink
:
public
base::Object
{
43
bool
frame_loaded_;
44
IMP_PROTECTED_METHOD
(
virtual
void
, do_load,
45
(RMF::FileConstHandle fh),,=0);
46
IMP_PROTECTED_CONSTRUCTOR
(
LoadLink
,(std::string name),);
47
public
:
48
void
load(RMF::FileConstHandle fh) {
49
IMP_OBJECT_LOG
;
50
set_was_used
(
true
);
51
do_load(fh);
52
frame_loaded_=
true
;
53
}
54
IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR
(
LoadLink
);
55
};
56
/** Manage a link between an \imp object and a part
57
of the RMF file. This allows conformations to be
58
saved flexibly.
59
60
SaveLinks must not save any handles to RMF objects.
61
*/
62
class
IMPRMFEXPORT
SaveLink
:
public
base::Object
{
63
bool
frame_saved_;
64
IMP_PROTECTED_METHOD
(
virtual
void
,
65
do_save, (RMF::FileHandle hf),,=0);
66
IMP_PROTECTED_CONSTRUCTOR
(
SaveLink
, (std::string name),);
67
public
:
68
void
save(RMF::FileHandle fh) {
69
IMP_OBJECT_LOG
;
70
set_was_used
(
true
);
71
do_save(fh);
72
frame_saved_=
true
;
73
}
74
IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR
(
SaveLink
);
75
};
76
77
78
IMPRMF_END_NAMESPACE
79
80
#endif
/* IMPRMF_LINKS_H */