src/wifi/model/wifi-mode.cc
changeset 10483 e3a02ed14587
parent 10139 17a71cd49da3
child 11450 9f4ae69f12b7
equal deleted inserted replaced
10482:b470331449bc 10483:e3a02ed14587
    22 #include "ns3/assert.h"
    22 #include "ns3/assert.h"
    23 #include "ns3/log.h"
    23 #include "ns3/log.h"
    24 
    24 
    25 namespace ns3 {
    25 namespace ns3 {
    26 
    26 
       
    27 /**
       
    28  * Check if the two WifiModes are identical.
       
    29  *
       
    30  * \param a WifiMode
       
    31  * \param b WifiMode
       
    32  * \return true if the two WifiModes are identical,
       
    33  *         false otherwise
       
    34  */
    27 bool operator == (const WifiMode &a, const WifiMode &b)
    35 bool operator == (const WifiMode &a, const WifiMode &b)
    28 {
    36 {
    29   return a.GetUid () == b.GetUid ();
    37   return a.GetUid () == b.GetUid ();
    30 }
    38 }
       
    39 /**
       
    40  * Serialize WifiMode to ostream (human-readable).
       
    41  *
       
    42  * \param os std::ostream
       
    43  * \param mode
       
    44  * \return std::ostream
       
    45  */
    31 std::ostream & operator << (std::ostream & os, const WifiMode &mode)
    46 std::ostream & operator << (std::ostream & os, const WifiMode &mode)
    32 {
    47 {
    33   os << mode.GetUniqueName ();
    48   os << mode.GetUniqueName ();
    34   return os;
    49   return os;
    35 }
    50 }
       
    51 /**
       
    52  * Serialize WifiMode from istream (human-readable).
       
    53  *
       
    54  * \param is std::istream
       
    55  * \param mode
       
    56  * \return std::istream
       
    57  */
    36 std::istream & operator >> (std::istream &is, WifiMode &mode)
    58 std::istream & operator >> (std::istream &is, WifiMode &mode)
    37 {
    59 {
    38   std::string str;
    60   std::string str;
    39   is >> str;
    61   is >> str;
    40   mode = WifiModeFactory::GetFactory ()->Search (str);
    62   mode = WifiModeFactory::GetFactory ()->Search (str);