--- a/src/core/attribute-test.cc Thu Feb 21 18:54:02 2008 +0100
+++ b/src/core/attribute-test.cc Thu Feb 21 18:57:34 2008 +0100
@@ -1,7 +1,7 @@
#ifdef RUN_SELF_TESTS
#include "test.h"
#include "object.h"
-#include "boolean-value.h"
+#include "boolean.h"
#include "int-value.h"
#include "uint-value.h"
#include "enum-value.h"
--- a/src/core/boolean-value.cc Thu Feb 21 18:54:02 2008 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#include "boolean-value.h"
-#include "fatal-error.h"
-
-namespace ns3 {
-
-Boolean::Boolean ()
- : m_value (false)
-{}
-Boolean::Boolean (bool value)
- : m_value (value)
-{}
-void
-Boolean::Set (bool value)
-{
- m_value = value;
-}
-bool
-Boolean::Get (void) const
-{
- return m_value;
-}
-Boolean::operator bool () const
-{
- return m_value;
-}
-
-std::ostream & operator << (std::ostream &os, const Boolean &value)
-{
- if (value.Get ())
- {
- os << "true";
- }
- else
- {
- os << "false";
- }
- return os;
-}
-std::istream & operator >> (std::istream &is, Boolean &value)
-{
- std::string v;
- is >> v;
- if (v == "true" ||
- v == "1" ||
- v == "t")
- {
- value.Set (true);
- }
- else if (v == "false" ||
- v == "0" ||
- v == "f")
- {
- value.Set (false);
- }
- else
- {
- is.setstate (std::ios_base::badbit);
- }
- return is;
-}
-
-ATTRIBUTE_CONVERTER_IMPLEMENT (Boolean);
-ATTRIBUTE_VALUE_IMPLEMENT (Boolean);
-ATTRIBUTE_CHECKER_IMPLEMENT (Boolean);
-
-} // namespace ns3
--- a/src/core/boolean-value.h Thu Feb 21 18:54:02 2008 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#ifndef BOOLEAN_VALUE_H
-#define BOOLEAN_VALUE_H
-
-#include "attribute.h"
-#include "attribute-helper.h"
-
-namespace ns3 {
-
-class Boolean
-{
-public:
- Boolean ();
- Boolean (bool value);
- void Set (bool value);
- bool Get (void) const;
-
- operator bool () const;
-
- ATTRIBUTE_CONVERTER_DEFINE (Boolean);
-private:
- bool m_value;
-};
-
-std::ostream & operator << (std::ostream &os, const Boolean &value);
-std::istream & operator >> (std::istream &is, Boolean &value);
-
-ATTRIBUTE_VALUE_DEFINE (Boolean);
-ATTRIBUTE_CHECKER_DEFINE (Boolean);
-ATTRIBUTE_ACCESSOR_DEFINE (Boolean);
-
-} // namespace ns3
-
-#endif /* BOOLEAN_PARAMETER_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/boolean.cc Thu Feb 21 18:57:34 2008 +0100
@@ -0,0 +1,66 @@
+#include "boolean.h"
+#include "fatal-error.h"
+
+namespace ns3 {
+
+Boolean::Boolean ()
+ : m_value (false)
+{}
+Boolean::Boolean (bool value)
+ : m_value (value)
+{}
+void
+Boolean::Set (bool value)
+{
+ m_value = value;
+}
+bool
+Boolean::Get (void) const
+{
+ return m_value;
+}
+Boolean::operator bool () const
+{
+ return m_value;
+}
+
+std::ostream & operator << (std::ostream &os, const Boolean &value)
+{
+ if (value.Get ())
+ {
+ os << "true";
+ }
+ else
+ {
+ os << "false";
+ }
+ return os;
+}
+std::istream & operator >> (std::istream &is, Boolean &value)
+{
+ std::string v;
+ is >> v;
+ if (v == "true" ||
+ v == "1" ||
+ v == "t")
+ {
+ value.Set (true);
+ }
+ else if (v == "false" ||
+ v == "0" ||
+ v == "f")
+ {
+ value.Set (false);
+ }
+ else
+ {
+ is.setstate (std::ios_base::badbit);
+ }
+ return is;
+}
+
+ATTRIBUTE_CONVERTER_IMPLEMENT (Boolean);
+ATTRIBUTE_VALUE_IMPLEMENT (Boolean);
+ATTRIBUTE_CHECKER_IMPLEMENT (Boolean);
+
+} // namespace ns3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/boolean.h Thu Feb 21 18:57:34 2008 +0100
@@ -0,0 +1,33 @@
+#ifndef BOOLEAN_VALUE_H
+#define BOOLEAN_VALUE_H
+
+#include "attribute.h"
+#include "attribute-helper.h"
+
+namespace ns3 {
+
+class Boolean
+{
+public:
+ Boolean ();
+ Boolean (bool value);
+ void Set (bool value);
+ bool Get (void) const;
+
+ operator bool () const;
+
+ ATTRIBUTE_CONVERTER_DEFINE (Boolean);
+private:
+ bool m_value;
+};
+
+std::ostream & operator << (std::ostream &os, const Boolean &value);
+std::istream & operator >> (std::istream &is, Boolean &value);
+
+ATTRIBUTE_VALUE_DEFINE (Boolean);
+ATTRIBUTE_CHECKER_DEFINE (Boolean);
+ATTRIBUTE_ACCESSOR_DEFINE (Boolean);
+
+} // namespace ns3
+
+#endif /* BOOLEAN_PARAMETER_H */
--- a/src/core/wscript Thu Feb 21 18:54:02 2008 +0100
+++ b/src/core/wscript Thu Feb 21 18:57:34 2008 +0100
@@ -54,7 +54,7 @@
'array-trace-resolver.cc',
'type-id-default-value.cc',
'attribute.cc',
- 'boolean-value.cc',
+ 'boolean.cc',
'attribute-test.cc',
'int-value.cc',
'uint-value.cc',
@@ -109,6 +109,7 @@
'type-id-default-value.h',
'attribute.h',
'attribute-accessor-helper.h',
+ 'boolean.h',
'int-value.h',
'uint-value.h',
'fp-value.h',