00001
00002
00003
00004
00005 #ifndef BALL_FORMAT_PDBRECORDS_H
00006 #define BALL_FORMAT_PDBRECORDS_H
00007
00008 #include <vector>
00009 #include <stdexcept>
00010
00011 #ifndef BALL_DATATYPE_HASHMAP_H
00012 # include <BALL/DATATYPE/hashMap.h>
00013 #endif
00014
00015 #ifndef BALL_CONCEPT_PERSISTENCEMANAGER_H
00016 # include <BALL/CONCEPT/persistenceManager.h>
00017 #endif
00018
00019 namespace BALL
00020 {
00021
00031 class BALL_EXPORT PDBRecords
00032 : public PersistentObject
00033 {
00034 public:
00035
00036
00037 typedef std::vector<String>::iterator Iterator;
00038 typedef std::vector<String>::iterator iterator;
00039 typedef std::vector<String>::const_iterator ConstIterator;
00040 typedef std::vector<String>::const_iterator const_iterator;
00041 typedef std::vector<String>::reverse_iterator ReverseIterator;
00042 typedef std::vector<String>::reverse_iterator reverse_iterator;
00043 typedef std::vector<String>::const_reverse_iterator ConstReverseIterator;
00044 typedef std::vector<String>::const_reverse_iterator const_reverse_iterator;
00045 typedef String value_type;
00046 typedef String ValueType;
00047 typedef String& reference;
00048 typedef String& Reference;
00049 typedef const String& const_reference;
00050 typedef const String& ConstReference;
00051 typedef std::vector<String>::difference_type difference_type;
00052 typedef std::vector<String>::difference_type DifferenceType;
00053 typedef std::vector<String>::size_type size_type;
00054 typedef std::vector<String>::size_type SizeType;
00055
00056 BALL_CREATE(PDBRecords)
00057
00058
00060
00061 PDBRecords() ;
00063 PDBRecords(const PDBRecords& pdbi) ;
00065 virtual ~PDBRecords() ;
00067
00071
00072 PDBRecords& operator = (const PDBRecords& rhs);
00074
00080
00081 ConstIterator begin() const { return records_.begin(); }
00083 Iterator begin() { return records_.begin(); }
00085 ConstIterator end() const { return records_.end(); }
00087 Iterator end() { return records_.end(); }
00089 ConstReverseIterator rbegin() const { return records_.rbegin(); }
00091 ReverseIterator rbegin() { return records_.rbegin(); }
00093 ConstReverseIterator rend() const { return records_.rend(); }
00095 ReverseIterator rend() { return records_.rend(); }
00097 SizeType size() const { return records_.size(); }
00099 SizeType max_size() const { return records_.max_size(); }
00101 SizeType capacity() const { return records_.capacity(); }
00103 bool empty() const { return records_.empty(); }
00105 void clear() { records_.clear(); }
00107 void resize(SizeType sz, ValueType c = ValueType()) { records_.resize(sz, c); }
00109 Reference front() { return records_.front(); }
00111 ConstReference front() const { return records_.front(); }
00113 Reference back() { return records_.back(); }
00115 ConstReference back() const { return records_.back(); }
00117 void push_back(ConstReference x) { records_.push_back(x); }
00119 void insert(Iterator pos, ConstReference value) { records_.insert(pos, value); }
00121 void insert(Iterator pos, SizeType n, ConstReference value) { records_.insert(pos, n, value); }
00123 void pop_back() { records_.pop_back(); }
00125 Iterator erase(Iterator pos) { return records_.erase(pos); }
00127 Iterator erase(Iterator first, Iterator last) { return records_.erase(first, last); }
00129 bool operator == (const PDBRecords& rhs) const { return records_ == rhs.records_; }
00131 bool operator != (const PDBRecords& rhs) const { return records_ != rhs.records_; }
00133 bool operator < (const PDBRecords& rhs) const { return records_ < rhs.records_; }
00135 bool operator > (const PDBRecords& rhs) const { return records_ > rhs.records_; }
00137 bool operator <= (const PDBRecords& rhs) const { return records_ <= rhs.records_; }
00139 bool operator >= (const PDBRecords& rhs) const { return records_ >= rhs.records_; }
00141 void swap(PDBRecords& rhs) { records_.swap(rhs.records_); }
00143 ConstReference operator [] (SizeType n) const { return records_[n]; }
00145 Reference operator [] (SizeType n) { return records_[n]; }
00149 ConstReference at(SizeType n) const { return records_.at(n); }
00153 Reference at(SizeType n) { return records_.at(n); }
00155
00159
00162
00163 void persistentWrite(PersistenceManager& pm, const char* name) const;
00164
00167
00168 void persistentRead(PersistenceManager& pm);
00169
00171
00172 protected:
00174 std::vector<String> records_;
00175 };
00176
00177 }
00178
00179 #endif // BALL_FORMAT_PDBRECORDS_H