utils/bench-packets.cc
changeset 1323 08174b13d76f
parent 1322 b6a4885a92df
child 1814 21c9c4dd9768
child 1866 e7dbcc4df546
equal deleted inserted replaced
1322:b6a4885a92df 1323:08174b13d76f
    33   BenchHeader ();
    33   BenchHeader ();
    34   bool IsOk (void) const;
    34   bool IsOk (void) const;
    35 
    35 
    36   static uint32_t GetUid (void);
    36   static uint32_t GetUid (void);
    37 
    37 
    38   std::string GetName (void) const;
    38   static std::string GetName (void);
    39   void Print (std::ostream &os) const;
    39   void Print (std::ostream &os) const;
    40   uint32_t GetSerializedSize (void) const;
    40   uint32_t GetSerializedSize (void) const;
    41   void Serialize (Buffer::Iterator start) const;
    41   void Serialize (Buffer::Iterator start) const;
    42   uint32_t Deserialize (Buffer::Iterator start);
    42   uint32_t Deserialize (Buffer::Iterator start);
    43 private:
    43 private:
    58 
    58 
    59 template <int N>
    59 template <int N>
    60 uint32_t 
    60 uint32_t 
    61 BenchHeader<N>::GetUid (void)
    61 BenchHeader<N>::GetUid (void)
    62 {
    62 {
       
    63   static uint32_t uid = AllocateUid<BenchHeader<N> > (GetName ());
       
    64   return uid;
       
    65 }
       
    66 
       
    67 template <int N>
       
    68 std::string 
       
    69 BenchHeader<N>::GetName (void)
       
    70 {
    63   std::ostringstream oss;
    71   std::ostringstream oss;
    64   oss << "BenchHeader" << N;
    72   oss << "BenchHeader" << N;
    65   static uint32_t uid = AllocateUid<BenchHeader<N> > (oss.str ());
       
    66   return uid;
       
    67 }
       
    68 
       
    69 template <int N>
       
    70 std::string 
       
    71 BenchHeader<N>::GetName (void) const
       
    72 {
       
    73   std::ostringstream oss;
       
    74   oss << N;
       
    75   return oss.str ();
    73   return oss.str ();
    76 }
    74 }
    77 
    75 
    78 template <int N>
    76 template <int N>
    79 void 
    77 void