IMP  2.1.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-2013 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/base/Object.h>
14 #include "DensityHeader.h"
15 #include <IMP/base/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::base::Object
25 {
26 public:
27  MapReaderWriter(): base::Object("MapReaderWriter%1%"){}
28 #if !defined(DOXYGEN) && !defined(SWIG)
29  // since swig can't see these methods, it wants to create a wrapper
30  // for the class
31  virtual void read(const char *filename, float **data, DensityHeader &) {
32  IMP_UNUSED(filename); 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); IMP_UNUSED(data);
38  IMP_FAILURE("Don't use the base class");
39  };
40 #endif
41 
43 };
44 
45 IMPEM_END_NAMESPACE
46 
47 #endif /* IMPEM_MAP_READER_WRITER_H */
The base class to handle reading and writing of density maps.
Metadata for a density file.
#define IMP_UNUSED(variable)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Common base class for heavy weight IMP objects.
Various general useful macros for IMP.
#define IMP_FAILURE(message)
A runtime failure for IMP.
A shared base class to help in debugging and things.