equal
deleted
inserted
replaced
31 * \anchor bool |
31 * \anchor bool |
32 * |
32 * |
33 * This class can be used to hold bool variables |
33 * This class can be used to hold bool variables |
34 * which must go through the Attribute system. |
34 * which must go through the Attribute system. |
35 */ |
35 */ |
36 class Boolean |
36 class BooleanValue : public AttributeValue |
37 { |
37 { |
38 public: |
38 public: |
39 Boolean (); |
39 BooleanValue (); |
40 Boolean (bool value); |
40 BooleanValue (bool value); |
41 void Set (bool value); |
41 void Set (bool value); |
42 bool Get (void) const; |
42 bool Get (void) const; |
43 |
43 |
44 operator bool () const; |
44 operator bool () const; |
45 |
45 |
46 ATTRIBUTE_CONVERTER_DEFINE (Boolean); |
46 virtual Ptr<AttributeValue> Copy (void) const; |
|
47 virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const; |
|
48 virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker); |
47 private: |
49 private: |
48 bool m_value; |
50 bool m_value; |
49 }; |
51 }; |
50 |
52 |
51 std::ostream & operator << (std::ostream &os, const Boolean &value); |
53 std::ostream & operator << (std::ostream &os, const BooleanValue &value); |
52 std::istream & operator >> (std::istream &is, Boolean &value); |
|
53 |
54 |
54 ATTRIBUTE_VALUE_DEFINE (Boolean); |
|
55 ATTRIBUTE_CHECKER_DEFINE (Boolean); |
55 ATTRIBUTE_CHECKER_DEFINE (Boolean); |
56 ATTRIBUTE_ACCESSOR_DEFINE (Boolean); |
56 ATTRIBUTE_ACCESSOR_DEFINE (Boolean); |
57 |
57 |
58 } // namespace ns3 |
58 } // namespace ns3 |
59 |
59 |