IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
MapReaderWriter.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em/MapReaderWriter.h
3  * \brief An abstract class for reading a map
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM_MAP_READER_WRITER_H
10 #define IMPEM_MAP_READER_WRITER_H
11 
12 #include <IMP/em/em_config.h>
13 #include <IMP/Object.h>
14 #include "DensityHeader.h"
15 #include <IMP/object_macros.h>
16 
17 IMPEM_BEGIN_NAMESPACE
18 
19 /** \brief The base class to handle reading and writing of density maps.
20 
21  They should never be stored, only created immediately and passed to
22  the read or write function.
23  */
24 class IMPEMEXPORT MapReaderWriter : public IMP::Object {
25  public:
26  MapReaderWriter() : Object("MapReaderWriter%1%") {}
27 #if !defined(DOXYGEN) && !defined(SWIG)
28  // since swig can't see these methods, it wants to create a wrapper
29  // for the class
30  virtual void read(const char *filename, float **data, DensityHeader &) {
31  IMP_UNUSED(filename);
32  IMP_UNUSED(data);
33  IMP_FAILURE("Don't use the base class");
34  };
35  virtual void write(const char *filename, const float *data,
36  const DensityHeader &) {
37  IMP_UNUSED(filename);
38  IMP_UNUSED(data);
39  IMP_FAILURE("Don't use the base class");
40  };
41 #endif
42 
44 };
45 
46 IMPEM_END_NAMESPACE
47 
48 #endif /* IMPEM_MAP_READER_WRITER_H */
The base class to handle reading and writing of density maps.
Helper macros for implementing IMP Objects.
#define IMP_FAILURE(message)
A runtime failure for IMP.
Definition: check_macros.h:72
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Metadata for a density file.
Common base class for heavy weight IMP objects.
Definition: Object.h:111
#define IMP_UNUSED(variable)
A shared base class to help in debugging and things.
Object(std::string name)
Construct an object with the given name.