RMF
SetCurrentFrame.h
Go to the documentation of this file.
1 /**
2  * \file RMF/SetCurrentFrame.h
3  * \brief Temporarily change the current frame.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef RMF_SET_CURRENT_FRAME_H
10 #define RMF_SET_CURRENT_FRAME_H
11 
12 #include <string>
13 
14 #include "FileConstHandle.h"
15 #include "RMF/ID.h"
16 #include "RMF/config.h"
18 
19 RMF_ENABLE_WARNINGS
20 namespace RMF {
21 
22 /** \brief Set the current frame to a value and then return it to the old value
23  when this goes out of scope.
24 
25  \note This does not check that the current frame is the expected value
26  when restoring the frame, so you are free to change it all you want in
27  between.
28  */
29 class RMFEXPORT SetCurrentFrame {
30  FileConstHandle file_;
31  FrameID old_frame_;
32 
33  public:
34  SetCurrentFrame(FileConstHandle file, FrameID current_frame);
35  ~SetCurrentFrame();
36  RMF_SHOWABLE(SetCurrentFrame, "To: " << old_frame_);
37 };
38 
39 } /* namespace RMF */
40 
41 RMF_DISABLE_WARNINGS
42 
43 #endif /* RMF_SET_CURRENT_FRAME_H */
Declaration of RMF::ID.
A handle for a read-only RMF file.
Set the current frame to a value and then return it to the old value when this goes out of scope...
Handle read/write of Model data from/to files.
Various general useful macros for IMP.