src/common/mtag-buffer.h
changeset 3041 a624276a897b
parent 3040 e11e106c7c19
child 3042 d0a9677d5452
equal deleted inserted replaced
3040:e11e106c7c19 3041:a624276a897b
     1 #ifndef MTAG_BUFFER_H
       
     2 #define MTAG_BUFFER_H
       
     3 
       
     4 #include <stdint.h>
       
     5 
       
     6 namespace ns3 {
       
     7 
       
     8 class TagBuffer
       
     9 {
       
    10 public:
       
    11   TagBuffer (uint8_t *start, uint8_t *end);
       
    12   void TrimAtEnd (uint32_t trim);
       
    13 
       
    14   void WriteU8 (uint8_t v);
       
    15   void WriteU16 (uint16_t v);
       
    16   void WriteU32 (uint32_t v);
       
    17   void WriteU64 (uint64_t v);
       
    18   void WriteDouble (double v);
       
    19   void Write (const uint8_t *buffer, uint32_t size);
       
    20   uint8_t  ReadU8 (void);
       
    21   uint16_t ReadU16 (void);
       
    22   uint32_t ReadU32 (void);
       
    23   uint64_t ReadU64 (void);
       
    24   double ReadDouble (void);
       
    25   void Read (uint8_t *buffer, uint32_t size);
       
    26 
       
    27   void CopyFrom (TagBuffer o);
       
    28 private:
       
    29   
       
    30   uint8_t *m_current;
       
    31   uint8_t *m_end;
       
    32 };
       
    33 
       
    34 } // namespace ns3
       
    35 
       
    36 #endif /* MTAG_BUFFER_H */