src/wifi/model/snr-tag.h
changeset 9234 310d371059d5
child 10424 9d29c9a5ddcb
equal deleted inserted replaced
9233:4a9feececbf3 9234:310d371059d5
       
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2005,2006 INRIA
       
     4  * Copyright (c) 2009 MIRKO BANCHI
       
     5  * Copyright (c) 2013 University of Surrey
       
     6  *
       
     7  * This program is free software; you can redistribute it and/or modify
       
     8  * it under the terms of the GNU General Public License version 2 as
       
     9  * published by the Free Software Foundation;
       
    10  *
       
    11  * This program is distributed in the hope that it will be useful,
       
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    14  * GNU General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU General Public License
       
    17  * along with this program; if not, write to the Free Software
       
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    19  *
       
    20  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    21  * Author: Mirko Banchi <mk.banchi@gmail.com>
       
    22  * Author: Konstantinos Katsaros <dinos.katsaros@gmail.com>
       
    23  */
       
    24 
       
    25 #ifndef SNR_TAG_H
       
    26 #define SNR_TAG_H
       
    27 
       
    28 #include "ns3/packet.h"
       
    29 
       
    30 namespace ns3 {
       
    31 
       
    32 class Tag;
       
    33 
       
    34 class SnrTag : public Tag
       
    35 {
       
    36 public:
       
    37   static TypeId GetTypeId (void);
       
    38   virtual TypeId GetInstanceTypeId (void) const;
       
    39 
       
    40   /**
       
    41    * Create a SnrTag with the default snr 0 
       
    42    */
       
    43   SnrTag();
       
    44 
       
    45   /**
       
    46    * Create a SnrTag with the given snr value
       
    47    */
       
    48   SnrTag(double snr);
       
    49 
       
    50   virtual uint32_t GetSerializedSize (void) const;
       
    51   virtual void Serialize (TagBuffer i) const;
       
    52   virtual void Deserialize (TagBuffer i);
       
    53   virtual void Print (std::ostream &os) const;
       
    54 
       
    55   /**
       
    56    * Set the SNR to the given value.
       
    57    *
       
    58    * @param snr the value of the snr to set
       
    59    */
       
    60   void Set (double snr);
       
    61   double Get (void) const;
       
    62 private:
       
    63   double m_snr;
       
    64 };
       
    65 
       
    66 
       
    67 }
       
    68 #endif /* SNR_TAG_H */