IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
17IMPEM_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 */
24class 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
43 IMP_OBJECT_METHODS(MapReaderWriter);
44};
45
46IMPEM_END_NAMESPACE
47
48#endif /* IMPEM_MAP_READER_WRITER_H */
Metadata for a density file.
A shared base class to help in debugging and things.
#define IMP_FAILURE(message)
A runtime failure for IMP.
Common base class for heavy weight IMP objects.
Definition Object.h:111
Object(std::string name)
Construct an object with the given name.
Helper macros for implementing IMP Objects.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_UNUSED(variable)