BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PDBRecords.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_FORMAT_PDBRECORDS_H
6 #define BALL_FORMAT_PDBRECORDS_H
7 
8 #include <vector>
9 #include <stdexcept>
10 
11 #ifndef BALL_DATATYPE_HASHMAP_H
12 # include <BALL/DATATYPE/hashMap.h>
13 #endif
14 
15 #ifndef BALL_CONCEPT_PERSISTENCEMANAGER_H
17 #endif
18 
19 namespace BALL
20 {
21 
32  : public PersistentObject
33  {
34  public:
35 
36  /* STL compatibility typedefs */
37  typedef std::vector<String>::iterator Iterator;
38  typedef std::vector<String>::iterator iterator;
39  typedef std::vector<String>::const_iterator ConstIterator;
40  typedef std::vector<String>::const_iterator const_iterator;
41  typedef std::vector<String>::reverse_iterator ReverseIterator;
42  typedef std::vector<String>::reverse_iterator reverse_iterator;
43  typedef std::vector<String>::const_reverse_iterator ConstReverseIterator;
44  typedef std::vector<String>::const_reverse_iterator const_reverse_iterator;
45  typedef String value_type;
46  typedef String ValueType;
47  typedef String& reference;
48  typedef String& Reference;
49  typedef const String& const_reference;
50  typedef const String& ConstReference;
51  typedef std::vector<String>::difference_type difference_type;
52  typedef std::vector<String>::difference_type DifferenceType;
53  typedef std::vector<String>::size_type size_type;
54  typedef std::vector<String>::size_type SizeType;
55 
57 
58 
60  PDBRecords() ;
63  PDBRecords(const PDBRecords& pdbi) ;
65  virtual ~PDBRecords() ;
67 
71  PDBRecords& operator = (const PDBRecords& rhs);
74 
80  ConstIterator begin() const { return records_.begin(); }
83  Iterator begin() { return records_.begin(); }
85  ConstIterator end() const { return records_.end(); }
87  Iterator end() { return records_.end(); }
89  ConstReverseIterator rbegin() const { return records_.rbegin(); }
91  ReverseIterator rbegin() { return records_.rbegin(); }
93  ConstReverseIterator rend() const { return records_.rend(); }
95  ReverseIterator rend() { return records_.rend(); }
97  SizeType size() const { return records_.size(); }
99  SizeType max_size() const { return records_.max_size(); }
101  SizeType capacity() const { return records_.capacity(); }
103  bool empty() const { return records_.empty(); }
105  void clear() { records_.clear(); }
107  void resize(SizeType sz, ValueType c = ValueType()) { records_.resize(sz, c); }
109  Reference front() { return records_.front(); }
111  ConstReference front() const { return records_.front(); }
113  Reference back() { return records_.back(); }
115  ConstReference back() const { return records_.back(); }
117  void push_back(ConstReference x) { records_.push_back(x); }
119  void insert(Iterator pos, ConstReference value) { records_.insert(pos, value); }
121  void insert(Iterator pos, SizeType n, ConstReference value) { records_.insert(pos, n, value); }
123  void pop_back() { records_.pop_back(); }
125  Iterator erase(Iterator pos) { return records_.erase(pos); }
127  Iterator erase(Iterator first, Iterator last) { return records_.erase(first, last); }
129  bool operator == (const PDBRecords& rhs) const { return records_ == rhs.records_; }
131  bool operator != (const PDBRecords& rhs) const { return records_ != rhs.records_; }
133  bool operator < (const PDBRecords& rhs) const { return records_ < rhs.records_; }
135  bool operator > (const PDBRecords& rhs) const { return records_ > rhs.records_; }
137  bool operator <= (const PDBRecords& rhs) const { return records_ <= rhs.records_; }
139  bool operator >= (const PDBRecords& rhs) const { return records_ >= rhs.records_; }
141  void swap(PDBRecords& rhs) { records_.swap(rhs.records_); }
143  ConstReference operator [] (SizeType n) const { return records_[n]; }
145  Reference operator [] (SizeType n) { return records_[n]; }
149  ConstReference at(SizeType n) const { return records_.at(n); }
153  Reference at(SizeType n) { return records_.at(n); }
155 
159 
162  //void write(PersistenceManager& pm) const;
163  void persistentWrite(PersistenceManager& pm, const char* name) const;
164 
167  //bool read(PersistenceManager& pm);
168  void persistentRead(PersistenceManager& pm);
169 
171 
172  protected:
174  std::vector<String> records_;
175  };
176 
177 } // namespace BALL
178 
179 #endif // BALL_FORMAT_PDBRECORDS_H
void clear()
Clear function of the OCI, doing nothing here.
Definition: PDBRecords.h:105
ConstIterator end() const
Definition: PDBRecords.h:85
std::vector< String >::iterator Iterator
Definition: PDBRecords.h:37
ConstIterator begin() const
Definition: PDBRecords.h:81
#define BALL_CREATE(name)
Definition: create.h:62
std::vector< String >::difference_type DifferenceType
Definition: PDBRecords.h:52
ReverseIterator rbegin()
Definition: PDBRecords.h:91
const String & const_reference
Definition: PDBRecords.h:49
ConstReverseIterator rend() const
Definition: PDBRecords.h:93
SizeType capacity() const
Definition: PDBRecords.h:101
ConstReverseIterator rbegin() const
Definition: PDBRecords.h:89
void insert(Iterator pos, SizeType n, ConstReference value)
Definition: PDBRecords.h:121
ReverseIterator rend()
Definition: PDBRecords.h:95
Iterator begin()
Definition: PDBRecords.h:83
SizeType max_size() const
Definition: PDBRecords.h:99
ConstReference at(SizeType n) const
Definition: PDBRecords.h:149
ConstReference back() const
Definition: PDBRecords.h:115
BALL_EXPORT bool operator>(const String &s1, const String &s2)
std::vector< String >::const_reverse_iterator const_reverse_iterator
Definition: PDBRecords.h:44
void push_back(ConstReference x)
Definition: PDBRecords.h:117
std::vector< String >::difference_type difference_type
Definition: PDBRecords.h:51
BALL_EXTERN_VARIABLE const double c
Definition: constants.h:149
std::vector< String >::const_iterator const_iterator
Definition: PDBRecords.h:40
Reference at(SizeType n)
Definition: PDBRecords.h:153
char & at(size_t pos)
bool empty() const
Definition: PDBRecords.h:103
std::vector< String > records_
The PDB record buffer.
Definition: PDBRecords.h:174
std::vector< String >::const_reverse_iterator ConstReverseIterator
Definition: PDBRecords.h:43
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
void swap(PDBRecords &rhs)
Definition: PDBRecords.h:141
SizeType size() const
Definition: PDBRecords.h:97
std::vector< String >::const_iterator ConstIterator
Definition: PDBRecords.h:39
String & Reference
Definition: PDBRecords.h:48
Iterator end()
Definition: PDBRecords.h:87
BALL_EXPORT bool operator>=(const String &s1, const String &s2)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT bool operator<=(const String &s1, const String &s2)
Iterator erase(Iterator pos)
Definition: PDBRecords.h:125
Reference front()
Definition: PDBRecords.h:109
std::vector< String >::iterator iterator
Definition: PDBRecords.h:38
std::vector< String >::size_type SizeType
Definition: PDBRecords.h:54
String ValueType
Definition: PDBRecords.h:46
void resize(SizeType sz, ValueType c=ValueType())
Definition: PDBRecords.h:107
const String & ConstReference
Definition: PDBRecords.h:50
std::vector< String >::reverse_iterator ReverseIterator
Definition: PDBRecords.h:41
Reference back()
Definition: PDBRecords.h:113
std::vector< String >::size_type size_type
Definition: PDBRecords.h:53
Iterator erase(Iterator first, Iterator last)
Definition: PDBRecords.h:127
void insert(Iterator pos, ConstReference value)
Definition: PDBRecords.h:119
String & reference
Definition: PDBRecords.h:47
String value_type
Definition: PDBRecords.h:45
#define BALL_EXPORT
Definition: COMMON/global.h:50
std::vector< String >::reverse_iterator reverse_iterator
Definition: PDBRecords.h:42
ConstReference front() const
Definition: PDBRecords.h:111
BALL_EXPORT bool operator<(const String &s1, const String &s2)