Chemical Data Processing Library C++ API - Version 1.2.0
PDBData.hpp
Go to the documentation of this file.
1 /*
2  * PDBData.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_BIOMOL_PDBDATA_HPP
30 #define CDPL_BIOMOL_PDBDATA_HPP
31 
32 #include <cstddef>
33 #include <string>
34 #include <map>
35 #include <memory>
36 
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Biomol
44  {
45 
50  {
51 
52  public:
53  typedef std::shared_ptr<PDBData> SharedPointer;
54 
56  {
57 
78  HET,
101  RESOLUTION
102  };
103 
104  private:
105  typedef std::map<RecordType, std::string> TypeToDataMap;
106 
107  public:
108  typedef typename TypeToDataMap::value_type Record;
109 
110  typedef typename TypeToDataMap::const_iterator ConstRecordIterator;
111 
112  typedef typename TypeToDataMap::iterator RecordIterator;
113 
115  data() {}
116 
117  PDBData(const PDBData& other):
118  data(other.data) {}
119 
120  void clear();
121 
122  std::size_t getNumRecords() const;
123 
124  bool isEmpty() const;
125 
126  bool containsRecord(const RecordType& type) const;
127 
129 
131 
132  std::string& getData(const RecordType& type);
133 
134  const std::string& getData(const RecordType& type) const;
135 
136  void removeRecord(const RecordIterator& it);
137 
138  bool removeRecord(const RecordType& type);
139 
141 
142  RecordIterator setRecord(const RecordType& type, const std::string& data);
143 
145 
147 
149 
151 
153 
155 
157 
159 
160  private:
161  TypeToDataMap data;
162  };
163  } // namespace Biomol
164 } // namespace CDPL
165 
166 #endif // CDPL_BIOMOL_PDBDATA_HPP
Definition of the preprocessor macro CDPL_BIOMOL_API.
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
A data structure for the storage of imported PDB data records (see [CTFILE]).
Definition: PDBData.hpp:50
PDBData(const PDBData &other)
Definition: PDBData.hpp:117
ConstRecordIterator end() const
ConstRecordIterator begin() const
RecordIterator setRecord(const RecordType &type, const std::string &data)
ConstRecordIterator getRecordsBegin() const
bool containsRecord(const RecordType &type) const
RecordIterator getRecord(const RecordType &type)
ConstRecordIterator getRecordsEnd() const
TypeToDataMap::value_type Record
Definition: PDBData.hpp:108
bool removeRecord(const RecordType &type)
RecordType
Definition: PDBData.hpp:56
@ REVDAT
Definition: PDBData.hpp:68
@ OBSLTE
Definition: PDBData.hpp:59
@ TURN
Definition: PDBData.hpp:84
@ SHEET
Definition: PDBData.hpp:83
@ SITE
Definition: PDBData.hpp:88
@ HELIX
Definition: PDBData.hpp:82
@ MTRIX3
Definition: PDBData.hpp:92
@ JRNL
Definition: PDBData.hpp:70
@ MTRIX1
Definition: PDBData.hpp:90
@ LINK
Definition: PDBData.hpp:86
@ ORIGX3
Definition: PDBData.hpp:95
@ TITLE
Definition: PDBData.hpp:60
@ CISPEP
Definition: PDBData.hpp:87
@ MTRIX2
Definition: PDBData.hpp:91
@ DBREF
Definition: PDBData.hpp:72
@ SEQADV
Definition: PDBData.hpp:75
@ AUTHOR
Definition: PDBData.hpp:67
@ SEQRES
Definition: PDBData.hpp:76
@ CAVEAT
Definition: PDBData.hpp:62
@ SSBOND
Definition: PDBData.hpp:85
@ SPRSDE
Definition: PDBData.hpp:69
@ STRUCTURE_ID
Definition: PDBData.hpp:99
@ ORIGX2
Definition: PDBData.hpp:94
@ DBREF2
Definition: PDBData.hpp:74
@ SCALE1
Definition: PDBData.hpp:96
@ DEPOSITION_DATE
Definition: PDBData.hpp:100
@ HETSYN
Definition: PDBData.hpp:81
@ ORIGX1
Definition: PDBData.hpp:93
@ FORMUL
Definition: PDBData.hpp:79
@ CRYST1
Definition: PDBData.hpp:89
@ KEYWDS
Definition: PDBData.hpp:65
@ REMARK
Definition: PDBData.hpp:71
@ COMPND
Definition: PDBData.hpp:63
@ HEADER
Definition: PDBData.hpp:58
@ EXPDTA
Definition: PDBData.hpp:66
@ SOURCE
Definition: PDBData.hpp:64
@ SPLIT
Definition: PDBData.hpp:61
@ HET
Definition: PDBData.hpp:78
@ SCALE3
Definition: PDBData.hpp:98
@ MODRES
Definition: PDBData.hpp:77
@ HETNAM
Definition: PDBData.hpp:80
@ SCALE2
Definition: PDBData.hpp:97
@ DBREF1
Definition: PDBData.hpp:73
std::shared_ptr< PDBData > SharedPointer
Definition: PDBData.hpp:53
void removeRecord(const RecordIterator &it)
std::size_t getNumRecords() const
std::string & getData(const RecordType &type)
PDBData()
Definition: PDBData.hpp:114
RecordIterator begin()
TypeToDataMap::iterator RecordIterator
Definition: PDBData.hpp:112
RecordIterator getRecordsBegin()
RecordIterator end()
ConstRecordIterator getRecord(const RecordType &type) const
const std::string & getData(const RecordType &type) const
bool isEmpty() const
RecordIterator setRecord(const Record &rec)
TypeToDataMap::const_iterator ConstRecordIterator
Definition: PDBData.hpp:110
RecordIterator getRecordsEnd()
The namespace of the Chemical Data Processing Library.