Bitstream Interpretation Library (BIL)  0.1
Bitstream.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 #ifndef BIL_BITSTREAM_HPP
8 #define BIL_BITSTREAM_HPP
9 
10 #include <memory>
11 #include <boost/ptr_container/ptr_vector.hpp>
12 #include <bitstream/Packet.hpp>
13 
14 
15 namespace bil {
16 
24  class Bitstream {
25  public:
26 
27  /**********************************************************************/
28  /* MODIFIERS */
29  /**********************************************************************/
30 
35  void append(std::auto_ptr<Packet> packet);
36 
42  void insert(std::auto_ptr<Packet> packet, size_t packetIndex);
43 
48  void erase(size_t packetIndex);
49 
53  void clear();
54 
55 
56  /**********************************************************************/
57  /* CONTENT ITERATION */
58  /**********************************************************************/
59 
64  size_t size() const;
65 
72  Packet& at(size_t packetIndex);
73 
80  const Packet& at(size_t packetIndex) const;
81 
82 
83  /**********************************************************************/
84  /* VISITOR INTERFACE */
85  /**********************************************************************/
86 
91  void runVisitor(PacketVisitor& visitor) const;
92 
93 
94  private:
95 
96  boost::ptr_vector<Packet> m_packets;
97 
98  };
99 
100 }
101 
102 #endif