39 #if !defined(TAWARA_TRACKS_H_)
40 #define TAWARA_TRACKS_H_
42 #include <boost/operators.hpp>
62 public boost::equality_comparable<Tracks>
86 typedef storage_type_::value_type value_type;
100 typedef storage_type_::const_reverse_iterator
109 {
return entries_.at(pos); }
116 {
return entries_.at(pos); }
124 mapped_type& operator[](key_type
const& key);
131 mapped_type
const& operator[](key_type
const& key)
const;
155 bool empty()
const {
return entries_.empty(); }
180 std::pair<iterator, bool> insert(mapped_type
const& value);
190 void insert(const_iterator first, const_iterator last);
196 { entries_.erase(position); }
203 { entries_.erase(first, last); }
210 {
return entries_.erase(number); }
225 {
return entries_.find(number); }
233 {
return entries_.find(number); }
246 virtual std::streamsize body_size()
const;
255 virtual std::streamsize write_body(std::ostream& output);
264 virtual std::streamsize read_body(std::istream& input,
265 std::streamsize
size);
274 void validate_entries()
const;
299 #endif // TAWARA_TRACKS_H_
boost::shared_ptr< TrackEntry > Ptr
The type of a shared pointer to a TrackEntry.
const ID Tracks(0x1654AE6B)
storage_type_::const_reverse_iterator const_reverse_iterator
The constant reversed random access iterator type.
storage_type_::reference reference
The reference type.
mapped_type const & at(key_type const &pos) const
Get the TrackEntry with the given track number.
uint64_t key_type
The key type (Key) of this container.
std::streamsize size(ID id)
Get the number of bytes required by an ID.
void clear()
Remove all TrackElements.
std::map< key_type, mapped_type > storage_type_
The type of the internal storage.
The MasterElement interface.
virtual ~Tracks()
Destructor.
storage_type_::size_type size_type
The size type of this container.
const_reverse_iterator rbegin() const
Get a reverse iterator to the last TrackEntry.
storage_type_ entries_
The track entry store.
bool empty() const
Check if there are no TrackElements.
bool operator==(AttachedFile const &lhs, AttachedFile const &rhs)
Equality operator for the AttachedFile object.
iterator begin()
Get an iterator to the first TrackEntry.
The Tracks element, listing all tracks in the segment.
iterator find(key_type const &number)
Search for the TrackEntry with the given track number.
TrackEntry::Ptr mapped_type
The mapped type (T) of this container.
storage_type_::const_iterator const_iterator
The constant random access iterator type.
iterator end()
Get an iterator to the position past the last TrackEntry.
void swap(Tracks &other)
Swaps the contents of this Tracks element with another.
const_iterator begin() const
Get an iterator to the first TrackEntry.
reverse_iterator rbegin()
Get a reverse iterator to the last TrackEntry.
storage_type_::const_reference const_reference
The constant reference type.
size_type max_count() const
Get the maximum number of TrackElements.
const_iterator end() const
Get an iterator to the position past the last TrackEntry.
const_reverse_iterator rend() const
Get a reverse iterator to the position before the first TrackEntry.
mapped_type & at(key_type const &pos)
Get the TrackEntry with the given track number.
storage_type_::reverse_iterator reverse_iterator
The reversed random access iterator type.
storage_type_::iterator iterator
The random access iterator type.
const_iterator find(key_type const &number) const
Search for the TrackEntry with the given track number.
void erase(iterator first, iterator last)
Erase a range of TrackEntries.
size_type count() const
Get the number of TrackElements.
size_type erase(key_type const &number)
Erase the TrackEntry with the given track number.
reverse_iterator rend()
Get a reverse iterator to the position before the first TrackEntry.
void erase(iterator position)
Erase the TrackEntry at the specified iterator.