--- a/src/core/bindings/module_helpers.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/bindings/module_helpers.cc Fri May 13 14:52:27 2011 -0400
@@ -2,7 +2,7 @@
#include "ns3/ref-count-base.h"
-namespace ns3{
+namespace ns3 {
void PythonCompleteConstruct (Ptr<Object> object, TypeId typeId, const AttributeList &attributes)
{
@@ -17,46 +17,46 @@
class PythonEventImpl : public ns3::EventImpl
{
private:
- PyObject *m_callback;
- PyObject *m_args;
+ PyObject *m_callback;
+ PyObject *m_args;
public:
- PythonEventImpl (PyObject *callback, PyObject *args)
- {
- m_callback = callback;
- Py_INCREF(m_callback);
- m_args = args;
- Py_INCREF(m_args);
- }
- virtual ~PythonEventImpl ()
- {
- PyGILState_STATE __py_gil_state;
- __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
+ PythonEventImpl (PyObject *callback, PyObject *args)
+ {
+ m_callback = callback;
+ Py_INCREF(m_callback);
+ m_args = args;
+ Py_INCREF(m_args);
+ }
+ virtual ~PythonEventImpl ()
+ {
+ PyGILState_STATE __py_gil_state;
+ __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
- Py_DECREF(m_callback);
- Py_DECREF(m_args);
+ Py_DECREF(m_callback);
+ Py_DECREF(m_args);
- if (PyEval_ThreadsInitialized())
- PyGILState_Release(__py_gil_state);
- }
- virtual void Notify ()
- {
- PyGILState_STATE __py_gil_state;
- __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
-
- PyObject *retval = PyObject_CallObject(m_callback, m_args);
- if (retval) {
- if (retval != Py_None) {
- PyErr_SetString(PyExc_TypeError, "event callback should return None");
- PyErr_Print();
- }
- Py_DECREF(retval);
- } else {
- PyErr_Print();
- }
+ if (PyEval_ThreadsInitialized())
+ PyGILState_Release(__py_gil_state);
+ }
+ virtual void Notify ()
+ {
+ PyGILState_STATE __py_gil_state;
+ __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
- if (PyEval_ThreadsInitialized())
- PyGILState_Release(__py_gil_state);
- }
+ PyObject *retval = PyObject_CallObject(m_callback, m_args);
+ if (retval) {
+ if (retval != Py_None) {
+ PyErr_SetString(PyExc_TypeError, "event callback should return None");
+ PyErr_Print();
+ }
+ Py_DECREF(retval);
+ } else {
+ PyErr_Print();
+ }
+
+ if (PyEval_ThreadsInitialized())
+ PyGILState_Release(__py_gil_state);
+ }
};
@@ -64,48 +64,48 @@
_wrap_Simulator_Schedule(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- PyObject *exc_type, *traceback;
- PyObject *py_time;
- PyObject *py_callback;
- PyObject *user_args;
- ns3::Ptr<PythonEventImpl> py_event_impl;
- PyNs3EventId *py_EventId;
+ PyObject *exc_type, *traceback;
+ PyObject *py_time;
+ PyObject *py_callback;
+ PyObject *user_args;
+ ns3::Ptr<PythonEventImpl> py_event_impl;
+ PyNs3EventId *py_EventId;
- if (kwargs && PyObject_Length(kwargs) > 0) {
- PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
- goto error;
+ if (kwargs && PyObject_Length(kwargs) > 0) {
+ PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
+ goto error;
}
- if (PyTuple_GET_SIZE(args) < 2) {
- PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 2 arguments");
- goto error;
+ if (PyTuple_GET_SIZE(args) < 2) {
+ PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 2 arguments");
+ goto error;
}
- py_time = PyTuple_GET_ITEM(args, 0);
- py_callback = PyTuple_GET_ITEM(args, 1);
+ py_time = PyTuple_GET_ITEM(args, 0);
+ py_callback = PyTuple_GET_ITEM(args, 1);
- if (!PyObject_IsInstance(py_time, (PyObject*) &PyNs3Time_Type)) {
- PyErr_SetString(PyExc_TypeError, "Parameter 1 should be a ns3.Time instance");
- goto error;
+ if (!PyObject_IsInstance(py_time, (PyObject*) &PyNs3Time_Type)) {
+ PyErr_SetString(PyExc_TypeError, "Parameter 1 should be a ns3.Time instance");
+ goto error;
}
- if (!PyCallable_Check(py_callback)) {
- PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
- goto error;
+ if (!PyCallable_Check(py_callback)) {
+ PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
+ goto error;
}
- user_args = PyTuple_GetSlice(args, 2, PyTuple_GET_SIZE(args));
- py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
- Py_DECREF(user_args);
+ user_args = PyTuple_GetSlice(args, 2, PyTuple_GET_SIZE(args));
+ py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
+ Py_DECREF(user_args);
- py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
- py_EventId->obj = new ns3::EventId(
- ns3::Simulator::Schedule(*((PyNs3Time *) py_time)->obj, py_event_impl));
- py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
- return (PyObject *) py_EventId;
+ py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
+ py_EventId->obj = new ns3::EventId(
+ ns3::Simulator::Schedule(*((PyNs3Time *) py_time)->obj, py_event_impl));
+ py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
+ return (PyObject *) py_EventId;
error:
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
@@ -113,41 +113,41 @@
_wrap_Simulator_ScheduleNow(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- PyObject *exc_type, *traceback;
- PyObject *py_callback;
- PyObject *user_args;
- ns3::Ptr<PythonEventImpl> py_event_impl;
- PyNs3EventId *py_EventId;
+ PyObject *exc_type, *traceback;
+ PyObject *py_callback;
+ PyObject *user_args;
+ ns3::Ptr<PythonEventImpl> py_event_impl;
+ PyNs3EventId *py_EventId;
- if (kwargs && PyObject_Length(kwargs) > 0) {
- PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
- goto error;
+ if (kwargs && PyObject_Length(kwargs) > 0) {
+ PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
+ goto error;
}
- if (PyTuple_GET_SIZE(args) < 1) {
- PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
- goto error;
+ if (PyTuple_GET_SIZE(args) < 1) {
+ PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
+ goto error;
}
- py_callback = PyTuple_GET_ITEM(args, 0);
+ py_callback = PyTuple_GET_ITEM(args, 0);
- if (!PyCallable_Check(py_callback)) {
- PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
- goto error;
+ if (!PyCallable_Check(py_callback)) {
+ PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
+ goto error;
}
- user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
- py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
- Py_DECREF(user_args);
+ user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
+ Py_DECREF(user_args);
- py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
- py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleNow(py_event_impl));
- py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
- return (PyObject *) py_EventId;
+ py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
+ py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleNow(py_event_impl));
+ py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
+ return (PyObject *) py_EventId;
error:
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
@@ -155,41 +155,41 @@
_wrap_Simulator_ScheduleDestroy(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- PyObject *exc_type, *traceback;
- PyObject *py_callback;
- PyObject *user_args;
- ns3::Ptr<PythonEventImpl> py_event_impl;
- PyNs3EventId *py_EventId;
+ PyObject *exc_type, *traceback;
+ PyObject *py_callback;
+ PyObject *user_args;
+ ns3::Ptr<PythonEventImpl> py_event_impl;
+ PyNs3EventId *py_EventId;
- if (kwargs && PyObject_Length(kwargs) > 0) {
- PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
- goto error;
+ if (kwargs && PyObject_Length(kwargs) > 0) {
+ PyErr_SetString(PyExc_TypeError, "keyword arguments not supported");
+ goto error;
}
- if (PyTuple_GET_SIZE(args) < 1) {
- PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
- goto error;
+ if (PyTuple_GET_SIZE(args) < 1) {
+ PyErr_SetString(PyExc_TypeError, "ns3.Simulator.Schedule needs at least 1 argument");
+ goto error;
}
- py_callback = PyTuple_GET_ITEM(args, 0);
+ py_callback = PyTuple_GET_ITEM(args, 0);
- if (!PyCallable_Check(py_callback)) {
- PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
- goto error;
+ if (!PyCallable_Check(py_callback)) {
+ PyErr_SetString(PyExc_TypeError, "Parameter 2 should be callable");
+ goto error;
}
- user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
- py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
- Py_DECREF(user_args);
+ user_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ py_event_impl = ns3::Create<PythonEventImpl>(py_callback, user_args);
+ Py_DECREF(user_args);
- py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
- py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleDestroy(py_event_impl));
- py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
- return (PyObject *) py_EventId;
+ py_EventId = PyObject_New(PyNs3EventId, &PyNs3EventId_Type);
+ py_EventId->obj = new ns3::EventId(ns3::Simulator::ScheduleDestroy(py_event_impl));
+ py_EventId->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
+ return (PyObject *) py_EventId;
error:
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
@@ -197,89 +197,89 @@
_wrap_TypeId_LookupByNameFailSafe(PyNs3TypeId *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- bool ok;
- const char *name;
- Py_ssize_t name_len;
- ns3::TypeId tid;
- PyNs3TypeId *py_tid;
- const char *keywords[] = {"name", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
- PyObject *exc_type, *traceback;
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
+ bool ok;
+ const char *name;
+ Py_ssize_t name_len;
+ ns3::TypeId tid;
+ PyNs3TypeId *py_tid;
+ const char *keywords[] = { "name", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
+ PyObject *exc_type, *traceback;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
- ok = ns3::TypeId::LookupByNameFailSafe(std::string(name, name_len), &tid);
- if (!ok)
+ ok = ns3::TypeId::LookupByNameFailSafe(std::string(name, name_len), &tid);
+ if (!ok)
{
- PyErr_Format(PyExc_KeyError, "The ns3 type with name `%s' is not registered", name);
- return NULL;
+ PyErr_Format(PyExc_KeyError, "The ns3 type with name `%s' is not registered", name);
+ return NULL;
}
- py_tid = PyObject_New(PyNs3TypeId, &PyNs3TypeId_Type);
- py_tid->obj = new ns3::TypeId (tid);
- PyNs3TypeId_wrapper_registry[(void *) py_tid->obj] = (PyObject *) py_tid;
-
- return (PyObject *) py_tid;
+ py_tid = PyObject_New(PyNs3TypeId, &PyNs3TypeId_Type);
+ py_tid->obj = new ns3::TypeId (tid);
+ PyNs3TypeId_wrapper_registry[(void *) py_tid->obj] = (PyObject *) py_tid;
+
+ return (PyObject *) py_tid;
}
class CommandLinePythonValueSetter : public ns3::RefCountBase
{
- PyObject *m_namespace;
- std::string m_variable;
+ PyObject *m_namespace;
+ std::string m_variable;
public:
- CommandLinePythonValueSetter (PyObject *ns, std::string const &variable) {
- Py_INCREF(ns);
- m_namespace = ns;
- m_variable = variable;
- }
- bool Parse (std::string value) {
- PyObject *pyvalue = PyString_FromStringAndSize (value.data(), value.size());
- PyObject_SetAttrString (m_namespace, (char *) m_variable.c_str(), pyvalue);
- if (PyErr_Occurred()) {
- PyErr_Print();
- return false;
- }
- return true;
- }
- virtual ~CommandLinePythonValueSetter () {
- Py_DECREF (m_namespace);
- m_namespace = NULL;
- }
-
+ CommandLinePythonValueSetter (PyObject *ns, std::string const &variable) {
+ Py_INCREF(ns);
+ m_namespace = ns;
+ m_variable = variable;
+ }
+ bool Parse (std::string value) {
+ PyObject *pyvalue = PyString_FromStringAndSize (value.data(), value.size());
+ PyObject_SetAttrString (m_namespace, (char *) m_variable.c_str(), pyvalue);
+ if (PyErr_Occurred()) {
+ PyErr_Print();
+ return false;
+ }
+ return true;
+ }
+ virtual ~CommandLinePythonValueSetter () {
+ Py_DECREF (m_namespace);
+ m_namespace = NULL;
+ }
+
};
PyObject *
_wrap_CommandLine_AddValue(PyNs3CommandLine *self, PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- const char *name, *help, *variable = NULL;
- PyObject *py_namespace = NULL;
- const char *keywords[] = {"name", "help", "variable", "namespace", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ss|sO", (char **) keywords, &name, &help, &variable, &py_namespace)) {
- PyObject *exc_type, *traceback;
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
- }
-
- if (variable == NULL) {
- variable = name;
- }
- if (py_namespace == NULL) {
- py_namespace = (PyObject *) self;
+ const char *name, *help, *variable = NULL;
+ PyObject *py_namespace = NULL;
+ const char *keywords[] = { "name", "help", "variable", "namespace", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ss|sO", (char **) keywords, &name, &help, &variable, &py_namespace)) {
+ PyObject *exc_type, *traceback;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
- ns3::Ptr<CommandLinePythonValueSetter> setter = ns3::Create<CommandLinePythonValueSetter> (py_namespace, variable);
- self->obj->AddValue (name, help, ns3::MakeCallback (&CommandLinePythonValueSetter::Parse, setter));
+ if (variable == NULL) {
+ variable = name;
+ }
+ if (py_namespace == NULL) {
+ py_namespace = (PyObject *) self;
+ }
- Py_INCREF(Py_None);
- return Py_None;
+ ns3::Ptr<CommandLinePythonValueSetter> setter = ns3::Create<CommandLinePythonValueSetter> (py_namespace, variable);
+ self->obj->AddValue (name, help, ns3::MakeCallback (&CommandLinePythonValueSetter::Parse, setter));
+
+ Py_INCREF(Py_None);
+ return Py_None;
}
@@ -287,53 +287,53 @@
_wrap_Simulator_Run(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs,
PyObject **return_exception)
{
- const char *keywords[] = {"signal_check_frequency", NULL};
- int signal_check_frequency;
+ const char *keywords[] = { "signal_check_frequency", NULL};
+ int signal_check_frequency;
- ns3::Ptr<ns3::DefaultSimulatorImpl> defaultSim =
- ns3::DynamicCast<ns3::DefaultSimulatorImpl> (ns3::Simulator::GetImplementation ());
- if (defaultSim) {
- signal_check_frequency = 100;
+ ns3::Ptr<ns3::DefaultSimulatorImpl> defaultSim =
+ ns3::DynamicCast<ns3::DefaultSimulatorImpl> (ns3::Simulator::GetImplementation ());
+ if (defaultSim) {
+ signal_check_frequency = 100;
} else {
- signal_check_frequency = -1;
+ signal_check_frequency = -1;
}
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|i", (char **) keywords, &signal_check_frequency)) {
- PyObject *exc_type, *traceback;
- PyErr_Fetch(&exc_type, return_exception, &traceback);
- Py_XDECREF(exc_type);
- Py_XDECREF(traceback);
- return NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|i", (char **) keywords, &signal_check_frequency)) {
+ PyObject *exc_type, *traceback;
+ PyErr_Fetch(&exc_type, return_exception, &traceback);
+ Py_XDECREF(exc_type);
+ Py_XDECREF(traceback);
+ return NULL;
}
- PyThreadState *py_thread_state = NULL;
+ PyThreadState *py_thread_state = NULL;
- if (signal_check_frequency == -1)
+ if (signal_check_frequency == -1)
{
- if (PyEval_ThreadsInitialized ())
- py_thread_state = PyEval_SaveThread();
- ns3::Simulator::Run();
- if (py_thread_state)
- PyEval_RestoreThread(py_thread_state);
+ if (PyEval_ThreadsInitialized ())
+ py_thread_state = PyEval_SaveThread();
+ ns3::Simulator::Run();
+ if (py_thread_state)
+ PyEval_RestoreThread(py_thread_state);
} else {
- while (!ns3::Simulator::IsFinished())
- {
- if (PyEval_ThreadsInitialized())
- py_thread_state = PyEval_SaveThread();
+ while (!ns3::Simulator::IsFinished())
+ {
+ if (PyEval_ThreadsInitialized())
+ py_thread_state = PyEval_SaveThread();
- for (int n = signal_check_frequency; n > 0 && !ns3::Simulator::IsFinished(); --n)
- {
- ns3::Simulator::RunOneEvent();
+ for (int n = signal_check_frequency; n > 0 && !ns3::Simulator::IsFinished(); --n)
+ {
+ ns3::Simulator::RunOneEvent();
}
-
- if (py_thread_state)
- PyEval_RestoreThread(py_thread_state);
- PyErr_CheckSignals();
- if (PyErr_Occurred())
- return NULL;
+
+ if (py_thread_state)
+ PyEval_RestoreThread(py_thread_state);
+ PyErr_CheckSignals();
+ if (PyErr_Occurred())
+ return NULL;
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_INCREF(Py_None);
+ return Py_None;
}
--- a/src/core/bindings/scan-header.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/bindings/scan-header.h Fri May 13 14:52:27 2011 -0400
@@ -7,26 +7,26 @@
namespace
{
- static inline Ptr<Object>
- __dummy_function_to_force_template_instantiation (Ptr<Object> obj, TypeId typeId)
- {
- return obj->GetObject<Object> (typeId);
- }
+static inline Ptr<Object>
+__dummy_function_to_force_template_instantiation (Ptr<Object> obj, TypeId typeId)
+{
+ return obj->GetObject<Object> (typeId);
+}
- static inline void
- __dummy_function_to_force_template_instantiation_v2 ()
- {
- Time t1, t2, t3;
- t1 = t2 + t3;
- t1 = t2 - t3;
- t1 < t2;
- t1 <= t2;
- t1 == t2;
- t1 != t2;
- t1 >= t2;
- t1 > t2;
- }
-
+static inline void
+__dummy_function_to_force_template_instantiation_v2 ()
+{
+ Time t1, t2, t3;
+ t1 = t2 + t3;
+ t1 = t2 - t3;
+ t1 < t2;
+ t1 <= t2;
+ t1 == t2;
+ t1 != t2;
+ t1 >= t2;
+ t1 > t2;
}
+}
+
--- a/src/core/examples/main-callback.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/examples/main-callback.cc Fri May 13 14:52:27 2011 -0400
@@ -15,8 +15,8 @@
class MyCb {
public:
int CbTwo (double a) {
- std::cout << "invoke cbTwo a=" << a << std::endl;
- return -5;
+ std::cout << "invoke cbTwo a=" << a << std::endl;
+ return -5;
}
};
@@ -45,7 +45,7 @@
NS_ASSERT (!two.IsNull ());
// invoke MyCb::cbTwo through callback instance
int retTwo;
- retTwo = two (10.0);
+ retTwo = two (10.0);
two = MakeNullCallback<int, double> ();
// invoking a null callback is just like
--- a/src/core/examples/main-test-sync.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/examples/main-test-sync.cc Fri May 13 14:52:27 2011 -0400
@@ -24,7 +24,7 @@
{
NS_ASSERT (gFirstRun);
NS_LOG_UNCOND ("inserted_function() called at " <<
- Simulator::Now ().GetSeconds () << " s");
+ Simulator::Now ().GetSeconds () << " s");
}
void
@@ -32,14 +32,14 @@
{
NS_ASSERT (gFirstRun);
NS_LOG_UNCOND ("background_function() called at " <<
- Simulator::Now ().GetSeconds () << " s");
+ Simulator::Now ().GetSeconds () << " s");
}
void
first_function (void)
{
NS_LOG_UNCOND ("first_function() called at " <<
- Simulator::Now ().GetSeconds () << " s");
+ Simulator::Now ().GetSeconds () << " s");
gFirstRun = true;
}
@@ -90,7 +90,7 @@
test (void)
{
GlobalValue::Bind ("SimulatorImplementationType",
- StringValue ("ns3::RealtimeSimulatorImpl"));
+ StringValue ("ns3::RealtimeSimulatorImpl"));
FakeNetDevice fnd;
@@ -108,11 +108,11 @@
}
Ptr<SystemThread> st3 = Create<SystemThread> (
- MakeCallback (&FakeNetDevice::Doit3, &fnd));
+ MakeCallback (&FakeNetDevice::Doit3, &fnd));
st3->Start ();
Ptr<SystemThread> st4 = Create<SystemThread> (
- MakeCallback (&FakeNetDevice::Doit4, &fnd));
+ MakeCallback (&FakeNetDevice::Doit4, &fnd));
st4->Start ();
Simulator::Stop (Seconds (15.0));
--- a/src/core/examples/sample-random-variable.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/examples/sample-random-variable.cc Fri May 13 14:52:27 2011 -0400
@@ -31,7 +31,7 @@
* pseudo-random number generator, this program should always output the
* same number. Likewise, ns-3 simulations using random variables will
* behave deterministically unless the user changes the RunNumber or the
- * Seed.
+ * Seed.
*
* There are three primary mechanisms to change the seed or run numbers
* from their default integer value of 1
@@ -59,5 +59,5 @@
UniformVariable uv;
cout << uv.GetValue () << endl;
-
+
}
--- a/src/core/examples/sample-simulator.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/examples/sample-simulator.cc Fri May 13 14:52:27 2011 -0400
@@ -84,7 +84,7 @@
EventId id = Simulator::Schedule (Seconds (30.0), &CancelledEvent);
Simulator::Cancel (id);
-
+
Simulator::Run ();
Simulator::Destroy ();
--- a/src/core/model/abort.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/abort.h Fri May 13 14:52:27 2011 -0400
@@ -42,9 +42,9 @@
*/
#define NS_ABORT_MSG(msg) \
do { \
- std::cerr << "aborted. "; \
- NS_FATAL_ERROR (msg); \
- } while (false)
+ std::cerr << "aborted. "; \
+ NS_FATAL_ERROR (msg); \
+ } while (false)
/**
@@ -68,12 +68,12 @@
*/
#define NS_ABORT_IF(cond) \
do { \
- if (cond) \
- { \
- std::cerr << "aborted. cond=\"" << #cond << ", "; \
- NS_FATAL_ERROR_NO_MSG (); \
- } \
- } while (false)
+ if (cond) \
+ { \
+ std::cerr << "aborted. cond=\"" << # cond << ", "; \
+ NS_FATAL_ERROR_NO_MSG (); \
+ } \
+ } while (false)
/**
* \ingroup debugging
@@ -97,12 +97,12 @@
*/
#define NS_ABORT_MSG_IF(cond, msg) \
do { \
- if (cond) \
- { \
- std::cerr << "aborted. cond=\"" << #cond << "\", "; \
- NS_FATAL_ERROR (msg); \
- } \
- } while (false)
+ if (cond) \
+ { \
+ std::cerr << "aborted. cond=\"" << # cond << "\", "; \
+ NS_FATAL_ERROR (msg); \
+ } \
+ } while (false)
/**
* \ingroup debugging
@@ -114,7 +114,7 @@
*
* \see NS_ABORT_IF
*/
-#define NS_ABORT_UNLESS(cond) \
+#define NS_ABORT_UNLESS(cond) \
NS_ABORT_IF(!(cond))
/**
@@ -128,7 +128,7 @@
*
* \see NS_ABORT_MSG_IF
*/
-#define NS_ABORT_MSG_UNLESS(cond, msg) \
+#define NS_ABORT_MSG_UNLESS(cond, msg) \
NS_ABORT_MSG_IF(!(cond),msg)
#endif /* NS3_ABORT_H */
--- a/src/core/model/assert.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/assert.h Fri May 13 14:52:27 2011 -0400
@@ -67,7 +67,7 @@
if (!(condition)) \
{ \
std::cerr << "assert failed. cond=\"" << \
- #condition << "\", "; \
+ # condition << "\", "; \
NS_FATAL_ERROR_NO_MSG(); \
} \
} \
@@ -89,7 +89,7 @@
if (!(condition)) \
{ \
std::cerr << "assert failed. cond=\"" << \
- #condition << "\", "; \
+ # condition << "\", "; \
NS_FATAL_ERROR (message); \
} \
} \
--- a/src/core/model/attribute-accessor-helper.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/attribute-accessor-helper.h Fri May 13 14:52:27 2011 -0400
@@ -64,12 +64,12 @@
const U *value = dynamic_cast<const U *> (&val);
if (value == 0)
{
- return false;
+ return false;
}
T *obj = dynamic_cast<T *> (object);
if (obj == 0)
{
- return false;
+ return false;
}
return DoSet (obj, value);
}
@@ -78,12 +78,12 @@
U *value = dynamic_cast<U *> (&val);
if (value == 0)
{
- return false;
+ return false;
}
const T *obj = dynamic_cast<const T *> (object);
if (obj == 0)
{
- return false;
+ return false;
}
return DoGet (obj, value);
}
@@ -98,200 +98,200 @@
DoMakeAccessorHelperOne (U T::*memberVariable)
{
class MemberVariable : public AccessorHelper<T,V>
- {
- public:
- MemberVariable (U T::*memberVariable)
- : AccessorHelper<T,V> (),
- m_memberVariable (memberVariable)
- {}
- private:
- virtual bool DoSet (T *object, const V *v) const {
- typename AccessorTrait<U>::Result tmp;
- bool ok = v->GetAccessor (tmp);
- if (!ok)
- {
- return false;
- }
- (object->*m_memberVariable) = tmp;
- return true;
- }
- virtual bool DoGet (const T *object, V *v) const {
- v->Set (object->*m_memberVariable);
- return true;
- }
- virtual bool HasGetter (void) const {
- return true;
- }
- virtual bool HasSetter (void) const {
- return true;
- }
-
- U T::*m_memberVariable;
- };
+ {
+public:
+ MemberVariable (U T::*memberVariable)
+ : AccessorHelper<T,V> (),
+ m_memberVariable (memberVariable)
+ {}
+private:
+ virtual bool DoSet (T *object, const V *v) const {
+ typename AccessorTrait<U>::Result tmp;
+ bool ok = v->GetAccessor (tmp);
+ if (!ok)
+ {
+ return false;
+ }
+ (object->*m_memberVariable) = tmp;
+ return true;
+ }
+ virtual bool DoGet (const T *object, V *v) const {
+ v->Set (object->*m_memberVariable);
+ return true;
+ }
+ virtual bool HasGetter (void) const {
+ return true;
+ }
+ virtual bool HasSetter (void) const {
+ return true;
+ }
+
+ U T::*m_memberVariable;
+ };
return Ptr<const AttributeAccessor> (new MemberVariable (memberVariable), false);
}
template <typename V, typename T, typename U>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperOne (U (T::*getter) (void) const)
+DoMakeAccessorHelperOne (U (T::*getter)(void) const)
{
class MemberMethod : public AccessorHelper<T,V>
- {
- public:
- MemberMethod (U (T::*getter) (void) const)
- : AccessorHelper<T,V> (),
- m_getter (getter)
- {}
- private:
- virtual bool DoSet (T *object, const V *v) const {
- return false;
- }
- virtual bool DoGet (const T *object, V *v) const {
- v->Set ((object->*m_getter) ());
- return true;
- }
- virtual bool HasGetter (void) const {
- return true;
- }
- virtual bool HasSetter (void) const {
- return false;
- }
- U (T::*m_getter) (void) const;
- };
+ {
+public:
+ MemberMethod (U (T::*getter)(void) const)
+ : AccessorHelper<T,V> (),
+ m_getter (getter)
+ {}
+private:
+ virtual bool DoSet (T *object, const V *v) const {
+ return false;
+ }
+ virtual bool DoGet (const T *object, V *v) const {
+ v->Set ((object->*m_getter)());
+ return true;
+ }
+ virtual bool HasGetter (void) const {
+ return true;
+ }
+ virtual bool HasSetter (void) const {
+ return false;
+ }
+ U (T::*m_getter)(void) const;
+ };
return Ptr<const AttributeAccessor> (new MemberMethod (getter), false);
}
template <typename V, typename T, typename U>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperOne (void (T::*setter) (U))
+DoMakeAccessorHelperOne (void (T::*setter)(U))
{
class MemberMethod : public AccessorHelper<T,V>
- {
- public:
- MemberMethod (void (T::*setter) (U))
- : AccessorHelper<T,V> (),
- m_setter (setter)
- {}
- private:
- virtual bool DoSet (T *object, const V *v) const {
- typename AccessorTrait<U>::Result tmp;
- bool ok = v->GetAccessor (tmp);
- if (!ok)
- {
- return false;
- }
- (object->*m_setter) (tmp);
- return true;
- }
- virtual bool DoGet (const T *object, V *v) const {
- return false;
- }
- virtual bool HasGetter (void) const {
- return false;
- }
- virtual bool HasSetter (void) const {
- return true;
- }
- void (T::*m_setter) (U);
- };
+ {
+public:
+ MemberMethod (void (T::*setter)(U))
+ : AccessorHelper<T,V> (),
+ m_setter (setter)
+ {}
+private:
+ virtual bool DoSet (T *object, const V *v) const {
+ typename AccessorTrait<U>::Result tmp;
+ bool ok = v->GetAccessor (tmp);
+ if (!ok)
+ {
+ return false;
+ }
+ (object->*m_setter)(tmp);
+ return true;
+ }
+ virtual bool DoGet (const T *object, V *v) const {
+ return false;
+ }
+ virtual bool HasGetter (void) const {
+ return false;
+ }
+ virtual bool HasSetter (void) const {
+ return true;
+ }
+ void (T::*m_setter)(U);
+ };
return Ptr<const AttributeAccessor> (new MemberMethod (setter), false);
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperTwo (void (T::*setter) (U),
- V (T::*getter) (void) const)
+DoMakeAccessorHelperTwo (void (T::*setter)(U),
+ V (T::*getter)(void) const)
{
class MemberMethod : public AccessorHelper<T,W>
- {
- public:
- MemberMethod (void (T::*setter) (U),
- V (T::*getter) (void) const)
- : AccessorHelper<T,W> (),
- m_setter (setter),
- m_getter (getter)
- {}
- private:
- virtual bool DoSet (T *object, const W *v) const {
- typename AccessorTrait<U>::Result tmp;
- bool ok = v->GetAccessor (tmp);
- if (!ok)
- {
- return false;
- }
- (object->*m_setter) (tmp);
- return true;
- }
- virtual bool DoGet (const T *object, W *v) const {
- v->Set ((object->*m_getter) ());
- return true;
- }
- virtual bool HasGetter (void) const {
- return true;
- }
- virtual bool HasSetter (void) const {
- return true;
- }
- void (T::*m_setter) (U);
- V (T::*m_getter) (void) const;
- };
+ {
+public:
+ MemberMethod (void (T::*setter)(U),
+ V (T::*getter)(void) const)
+ : AccessorHelper<T,W> (),
+ m_setter (setter),
+ m_getter (getter)
+ {}
+private:
+ virtual bool DoSet (T *object, const W *v) const {
+ typename AccessorTrait<U>::Result tmp;
+ bool ok = v->GetAccessor (tmp);
+ if (!ok)
+ {
+ return false;
+ }
+ (object->*m_setter)(tmp);
+ return true;
+ }
+ virtual bool DoGet (const T *object, W *v) const {
+ v->Set ((object->*m_getter)());
+ return true;
+ }
+ virtual bool HasGetter (void) const {
+ return true;
+ }
+ virtual bool HasSetter (void) const {
+ return true;
+ }
+ void (T::*m_setter)(U);
+ V (T::*m_getter)(void) const;
+ };
return Ptr<const AttributeAccessor> (new MemberMethod (setter, getter), false);
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperTwo (V (T::*getter) (void) const,
- void (T::*setter) (U))
+DoMakeAccessorHelperTwo (V (T::*getter)(void) const,
+ void (T::*setter)(U))
{
return DoMakeAccessorHelperTwo<W> (setter, getter);
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperTwo (bool (T::*setter) (U),
- V (T::*getter) (void) const)
+DoMakeAccessorHelperTwo (bool (T::*setter)(U),
+ V (T::*getter)(void) const)
{
class MemberMethod : public AccessorHelper<T,W>
- {
- public:
- MemberMethod (bool (T::*setter) (U),
- V (T::*getter) (void) const)
- : AccessorHelper<T,W> (),
- m_setter (setter),
- m_getter (getter)
- {}
- private:
- virtual bool DoSet (T *object, const W *v) const {
- typename AccessorTrait<U>::Result tmp;
- bool ok = v->GetAccessor (tmp);
- if (!ok)
- {
- return false;
- }
- ok = (object->*m_setter) (tmp);
- return ok;
- }
- virtual bool DoGet (const T *object, W *v) const {
- v->Set ((object->*m_getter) ());
- return true;
- }
- virtual bool HasGetter (void) const {
- return true;
- }
- virtual bool HasSetter (void) const {
- return true;
- }
- bool (T::*m_setter) (U);
- V (T::*m_getter) (void) const;
- };
+ {
+public:
+ MemberMethod (bool (T::*setter)(U),
+ V (T::*getter)(void) const)
+ : AccessorHelper<T,W> (),
+ m_setter (setter),
+ m_getter (getter)
+ {}
+private:
+ virtual bool DoSet (T *object, const W *v) const {
+ typename AccessorTrait<U>::Result tmp;
+ bool ok = v->GetAccessor (tmp);
+ if (!ok)
+ {
+ return false;
+ }
+ ok = (object->*m_setter)(tmp);
+ return ok;
+ }
+ virtual bool DoGet (const T *object, W *v) const {
+ v->Set ((object->*m_getter)());
+ return true;
+ }
+ virtual bool HasGetter (void) const {
+ return true;
+ }
+ virtual bool HasSetter (void) const {
+ return true;
+ }
+ bool (T::*m_setter)(U);
+ V (T::*m_getter)(void) const;
+ };
return Ptr<const AttributeAccessor> (new MemberMethod (setter, getter), false);
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
-DoMakeAccessorHelperTwo (bool (T::*getter) (void) const,
- void (T::*setter) (U))
+DoMakeAccessorHelperTwo (bool (T::*getter)(void) const,
+ void (T::*setter)(U))
{
return DoMakeAccessorHelperTwo<W> (setter, getter);
}
--- a/src/core/model/attribute-helper.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/attribute-helper.h Fri May 13 14:52:27 2011 -0400
@@ -97,26 +97,26 @@
* use the template functions defined here. This macro is implemented
* through the helper templates functions ns3::MakeAccessorHelper<>.
*/
-#define ATTRIBUTE_ACCESSOR_DEFINE(type) \
- template <typename T1> \
- Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1) \
- { \
- return MakeAccessorHelper<type##Value> (a1); \
- } \
- template <typename T1, typename T2> \
- Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1, T2 a2) \
- { \
- return MakeAccessorHelper<type##Value> (a1, a2); \
+#define ATTRIBUTE_ACCESSOR_DEFINE(type) \
+ template <typename T1> \
+ Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1) \
+ { \
+ return MakeAccessorHelper<type ## Value> (a1); \
+ } \
+ template <typename T1, typename T2> \
+ Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1, T2 a2) \
+ { \
+ return MakeAccessorHelper<type ## Value> (a1, a2); \
}
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type,name) \
- class name##Value : public AttributeValue \
- { \
- public: \
- name##Value (); \
- name##Value (const type &value); \
- void Set (const type &value); \
- type Get (void) const; \
+ class name ## Value : public AttributeValue \
+ { \
+public: \
+ name ## Value (); \
+ name ## Value (const type &value); \
+ void Set (const type &value); \
+ type Get (void) const; \
template <typename T> \
bool GetAccessor (T &value) const { \
value = T (m_value); \
@@ -125,8 +125,8 @@
virtual Ptr<AttributeValue> Copy (void) const; \
virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const; \
virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker); \
- private: \
- type m_value; \
+private: \
+ type m_value; \
};
@@ -137,7 +137,7 @@
* This macro defines the class XXXValue associated to class XXX.
* This macro is typically invoked in a class header.
*/
-#define ATTRIBUTE_VALUE_DEFINE(type) \
+#define ATTRIBUTE_VALUE_DEFINE(type) \
ATTRIBUTE_VALUE_DEFINE_WITH_NAME (type,type)
@@ -159,38 +159,38 @@
* MakeXXXChecker function.
* Typically invoked from xxx.h.
*/
-#define ATTRIBUTE_CHECKER_DEFINE(type) \
- class type##Checker : public AttributeChecker {}; \
- Ptr<const AttributeChecker> Make##type##Checker (void); \
+#define ATTRIBUTE_CHECKER_DEFINE(type) \
+ class type ## Checker : public AttributeChecker {}; \
+ Ptr<const AttributeChecker> Make ## type ## Checker (void); \
#define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type,name) \
- name##Value::name##Value () \
- : m_value () {} \
- name##Value::name##Value (const type &value) \
- : m_value (value) {} \
- void name##Value::Set (const type &v) { \
- m_value = v; \
- } \
- type name##Value::Get (void) const { \
- return m_value; \
- } \
+ name ## Value::name ## Value () \
+ : m_value () {} \
+ name ## Value::name ## Value (const type &value) \
+ : m_value (value) {} \
+ void name ## Value::Set (const type &v) { \
+ m_value = v; \
+ } \
+ type name ## Value::Get (void) const { \
+ return m_value; \
+ } \
Ptr<AttributeValue> \
- name##Value::Copy (void) const { \
- return ns3::Create<name##Value> (*this); \
+ name ## Value::Copy (void) const { \
+ return ns3::Create<name ## Value> (*this); \
} \
- std::string \
- name##Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \
- std::ostringstream oss; \
- oss << m_value; \
- return oss.str (); \
- } \
- bool \
- name##Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \
- std::istringstream iss; \
- iss.str (value); \
- iss >> m_value; \
- return !iss.bad () && !iss.fail (); \
+ std::string \
+ name ## Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \
+ std::ostringstream oss; \
+ oss << m_value; \
+ return oss.str (); \
+ } \
+ bool \
+ name ## Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \
+ std::istringstream iss; \
+ iss.str (value); \
+ iss >> m_value; \
+ return !iss.bad () && !iss.fail (); \
}
/**
@@ -202,7 +202,7 @@
* methods).
* Typically invoked from xxx.cc.
*/
-#define ATTRIBUTE_VALUE_IMPLEMENT(type) \
+#define ATTRIBUTE_VALUE_IMPLEMENT(type) \
ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type,type)
@@ -213,17 +213,17 @@
* This macro implements the MakeXXXChecker function.
* Typically invoked from xxx.cc.
*/
-#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \
- Ptr<const AttributeChecker> Make##type##Checker (void) \
- { \
- return MakeSimpleAttributeChecker<type##Value,type##Checker> (#type "Value", #type); \
- } \
+#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \
+ Ptr<const AttributeChecker> Make ## type ## Checker (void) \
+ { \
+ return MakeSimpleAttributeChecker<type ## Value,type ## Checker> (# type "Value", # type); \
+ } \
#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type,name) \
- Ptr<const AttributeChecker> Make##type##Checker (void) \
- { \
- return MakeSimpleAttributeChecker<type##Value,type##Checker> (#type "Value", name); \
- } \
+ Ptr<const AttributeChecker> Make ## type ## Checker (void) \
+ { \
+ return MakeSimpleAttributeChecker<type ## Value,type ## Checker> (# type "Value", name); \
+ } \
/**
* \ingroup AttributeHelper
@@ -232,9 +232,9 @@
* This macro should be invoked outside of the class
* declaration in its public header.
*/
-#define ATTRIBUTE_HELPER_HEADER(type) \
- ATTRIBUTE_VALUE_DEFINE (type); \
- ATTRIBUTE_ACCESSOR_DEFINE (type); \
+#define ATTRIBUTE_HELPER_HEADER(type) \
+ ATTRIBUTE_VALUE_DEFINE (type); \
+ ATTRIBUTE_ACCESSOR_DEFINE (type); \
ATTRIBUTE_CHECKER_DEFINE (type);
/**
@@ -244,7 +244,7 @@
* This macro should be invoked from the class implementation file.
*/
#define ATTRIBUTE_HELPER_CPP(type) \
- ATTRIBUTE_CHECKER_IMPLEMENT (type); \
+ ATTRIBUTE_CHECKER_IMPLEMENT (type); \
ATTRIBUTE_VALUE_IMPLEMENT (type);
--- a/src/core/model/attribute-list.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/attribute-list.cc Fri May 13 14:52:27 2011 -0400
@@ -28,7 +28,8 @@
*********************************************************************/
AttributeList::AttributeList ()
-{}
+{
+}
AttributeList::AttributeList (const AttributeList &o)
{
@@ -198,7 +199,7 @@
{
oss << "|";
}
- }
+ }
return oss.str ();
}
bool
@@ -258,7 +259,8 @@
}
UnsafeAttributeList::UnsafeAttributeList ()
-{}
+{
+}
UnsafeAttributeList::UnsafeAttributeList (const UnsafeAttributeList &o)
{
for (uint32_t i = 0; i < o.m_attributes.size (); ++i)
--- a/src/core/model/attribute-list.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/attribute-list.h Fri May 13 14:52:27 2011 -0400
@@ -115,7 +115,7 @@
UnsafeAttributeList (const UnsafeAttributeList &o);
UnsafeAttributeList &operator = (const UnsafeAttributeList &o);
~UnsafeAttributeList ();
-
+
void Set (std::string name, const AttributeValue ¶m);
AttributeList GetSafe (std::string name) const;
--- a/src/core/model/attribute.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/attribute.cc Fri May 13 14:52:27 2011 -0400
@@ -27,34 +27,41 @@
namespace ns3 {
AttributeValue::AttributeValue ()
-{}
+{
+}
AttributeValue::~AttributeValue ()
-{}
+{
+}
AttributeAccessor::AttributeAccessor ()
-{}
+{
+}
AttributeAccessor::~AttributeAccessor ()
-{}
+{
+}
AttributeChecker::AttributeChecker ()
-{}
+{
+}
AttributeChecker::~AttributeChecker ()
-{}
+{
+}
EmptyAttributeValue::EmptyAttributeValue ()
-{}
-Ptr<AttributeValue>
+{
+}
+Ptr<AttributeValue>
EmptyAttributeValue::Copy (void) const
{
return Create<EmptyAttributeValue> ();
}
-std::string
+std::string
EmptyAttributeValue::SerializeToString (Ptr<const AttributeChecker> checker) const
{
return "";
}
-bool
+bool
EmptyAttributeValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
{
return true;
--- a/src/core/model/boolean.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/boolean.cc Fri May 13 14:52:27 2011 -0400
@@ -24,16 +24,18 @@
BooleanValue::BooleanValue ()
: m_value (false)
-{}
+{
+}
BooleanValue::BooleanValue (bool value)
: m_value (value)
-{}
-void
+{
+}
+void
BooleanValue::Set (bool value)
{
m_value = value;
}
-bool
+bool
BooleanValue::Get (void) const
{
return m_value;
@@ -93,7 +95,7 @@
else
{
return false;
- }
+ }
}
--- a/src/core/model/boolean.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/boolean.h Fri May 13 14:52:27 2011 -0400
@@ -44,7 +44,7 @@
bool Get (void) const;
template <typename T>
bool GetAccessor (T &v) const;
-
+
operator bool () const;
virtual Ptr<AttributeValue> Copy (void) const;
--- a/src/core/model/breakpoint.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/breakpoint.cc Fri May 13 14:52:27 2011 -0400
@@ -54,4 +54,4 @@
#endif // HAVE_SIGNAL_H
-}//namespace ns3
+} //namespace ns3
--- a/src/core/model/breakpoint.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/breakpoint.h Fri May 13 14:52:27 2011 -0400
@@ -45,14 +45,14 @@
*/
#if (defined (__i386__) || defined (__amd64__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
# define NS_BREAKPOINT() \
- do{ __asm__ __volatile__ ("int $03"); }while(false)
+ do { __asm__ __volatile__ ("int $03"); }while(false)
#elif defined (_MSC_VER) && defined (_M_IX86)
# define NS_BREAKPOINT() \
- do{ __asm int 3h }while(false)
+ do { __asm int 3h }while(false)
#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2
# define NS_BREAKPOINT() \
- do{ __asm__ __volatile__ ("bpt"); }while(false)
-#else /* !__i386__ && !__alpha__ */
+ do { __asm__ __volatile__ ("bpt"); }while(false)
+#else /* !__i386__ && !__alpha__ */
# define NS_BREAKPOINT() ns3::BreakpointFallback ()
#endif
@@ -69,7 +69,7 @@
void BreakpointFallback (void);
-}//namespace ns3
+} //namespace ns3
#endif /* BREAKPOINT_H */
--- a/src/core/model/cairo-wideint-private.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/cairo-wideint-private.h Fri May 13 14:52:27 2011 -0400
@@ -52,25 +52,25 @@
#elif HAVE_SYS_INT_TYPES_H
# include <sys/int_types.h>
#elif defined(_MSC_VER)
- typedef __int8 int8_t;
- typedef unsigned __int8 uint8_t;
- typedef __int16 int16_t;
- typedef unsigned __int16 uint16_t;
- typedef __int32 int32_t;
- typedef unsigned __int32 uint32_t;
- typedef __int64 int64_t;
- typedef unsigned __int64 uint64_t;
+typedef __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
# ifndef HAVE_UINT64_T
# define HAVE_UINT64_T 1
# endif
# ifndef INT16_MIN
-# define INT16_MIN (-32767-1)
+# define INT16_MIN (-32767-1)
# endif
# ifndef INT16_MAX
-# define INT16_MAX (32767)
+# define INT16_MAX (32767)
# endif
# ifndef UINT16_MAX
-# define UINT16_MAX (65535)
+# define UINT16_MAX (65535)
# endif
#else
#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
@@ -91,94 +91,94 @@
#if !HAVE_UINT64_T
typedef struct _cairo_uint64 {
- uint32_t lo, hi;
+ uint32_t lo, hi;
} cairo_uint64_t, cairo_int64_t;
-cairo_uint64_t I _cairo_uint32_to_uint64 (uint32_t i);
-#define _cairo_uint64_to_uint32(a) ((a).lo)
-cairo_uint64_t I _cairo_uint64_add (cairo_uint64_t a, cairo_uint64_t b);
-cairo_uint64_t I _cairo_uint64_sub (cairo_uint64_t a, cairo_uint64_t b);
-cairo_uint64_t I _cairo_uint64_mul (cairo_uint64_t a, cairo_uint64_t b);
-cairo_uint64_t I _cairo_uint32x32_64_mul (uint32_t a, uint32_t b);
-cairo_uint64_t I _cairo_uint64_lsl (cairo_uint64_t a, int shift);
-cairo_uint64_t I _cairo_uint64_rsl (cairo_uint64_t a, int shift);
-cairo_uint64_t I _cairo_uint64_rsa (cairo_uint64_t a, int shift);
-int I _cairo_uint64_lt (cairo_uint64_t a, cairo_uint64_t b);
-int I _cairo_uint64_eq (cairo_uint64_t a, cairo_uint64_t b);
-cairo_uint64_t I _cairo_uint64_negate (cairo_uint64_t a);
-#define _cairo_uint64_negative(a) (((int32_t) ((a).hi)) < 0)
-cairo_uint64_t I _cairo_uint64_not (cairo_uint64_t a);
+cairo_uint64_t I _cairo_uint32_to_uint64 (uint32_t i);
+#define _cairo_uint64_to_uint32(a) ((a).lo)
+cairo_uint64_t I _cairo_uint64_add (cairo_uint64_t a, cairo_uint64_t b);
+cairo_uint64_t I _cairo_uint64_sub (cairo_uint64_t a, cairo_uint64_t b);
+cairo_uint64_t I _cairo_uint64_mul (cairo_uint64_t a, cairo_uint64_t b);
+cairo_uint64_t I _cairo_uint32x32_64_mul (uint32_t a, uint32_t b);
+cairo_uint64_t I _cairo_uint64_lsl (cairo_uint64_t a, int shift);
+cairo_uint64_t I _cairo_uint64_rsl (cairo_uint64_t a, int shift);
+cairo_uint64_t I _cairo_uint64_rsa (cairo_uint64_t a, int shift);
+int I _cairo_uint64_lt (cairo_uint64_t a, cairo_uint64_t b);
+int I _cairo_uint64_eq (cairo_uint64_t a, cairo_uint64_t b);
+cairo_uint64_t I _cairo_uint64_negate (cairo_uint64_t a);
+#define _cairo_uint64_negative(a) (((int32_t)((a).hi)) < 0)
+cairo_uint64_t I _cairo_uint64_not (cairo_uint64_t a);
-#define _cairo_uint64_to_int64(i) (i)
-#define _cairo_int64_to_uint64(i) (i)
+#define _cairo_uint64_to_int64(i) (i)
+#define _cairo_int64_to_uint64(i) (i)
-cairo_int64_t I _cairo_int32_to_int64(int32_t i);
-#define _cairo_int64_to_int32(a) ((int32_t) _cairo_uint64_to_uint32(a))
-#define _cairo_int64_add(a,b) _cairo_uint64_add (a,b)
-#define _cairo_int64_sub(a,b) _cairo_uint64_sub (a,b)
-#define _cairo_int64_mul(a,b) _cairo_uint64_mul (a,b)
-cairo_int64_t I _cairo_int32x32_64_mul (int32_t a, int32_t b);
-int I _cairo_int64_lt (cairo_uint64_t a, cairo_uint64_t b);
-#define _cairo_int64_eq(a,b) _cairo_uint64_eq (a,b)
-#define _cairo_int64_lsl(a,b) _cairo_uint64_lsl (a,b)
-#define _cairo_int64_rsl(a,b) _cairo_uint64_rsl (a,b)
-#define _cairo_int64_rsa(a,b) _cairo_uint64_rsa (a,b)
-#define _cairo_int64_negate(a) _cairo_uint64_negate(a)
-#define _cairo_int64_negative(a) (((int32_t) ((a).hi)) < 0)
-#define _cairo_int64_not(a) _cairo_uint64_not(a)
+cairo_int64_t I _cairo_int32_to_int64(int32_t i);
+#define _cairo_int64_to_int32(a) ((int32_t) _cairo_uint64_to_uint32(a))
+#define _cairo_int64_add(a,b) _cairo_uint64_add (a,b)
+#define _cairo_int64_sub(a,b) _cairo_uint64_sub (a,b)
+#define _cairo_int64_mul(a,b) _cairo_uint64_mul (a,b)
+cairo_int64_t I _cairo_int32x32_64_mul (int32_t a, int32_t b);
+int I _cairo_int64_lt (cairo_uint64_t a, cairo_uint64_t b);
+#define _cairo_int64_eq(a,b) _cairo_uint64_eq (a,b)
+#define _cairo_int64_lsl(a,b) _cairo_uint64_lsl (a,b)
+#define _cairo_int64_rsl(a,b) _cairo_uint64_rsl (a,b)
+#define _cairo_int64_rsa(a,b) _cairo_uint64_rsa (a,b)
+#define _cairo_int64_negate(a) _cairo_uint64_negate(a)
+#define _cairo_int64_negative(a) (((int32_t)((a).hi)) < 0)
+#define _cairo_int64_not(a) _cairo_uint64_not(a)
#else
typedef uint64_t cairo_uint64_t;
-typedef int64_t cairo_int64_t;
+typedef int64_t cairo_int64_t;
-#define _cairo_uint32_to_uint64(i) ((uint64_t) (i))
-#define _cairo_uint64_to_uint32(i) ((uint32_t) (i))
-#define _cairo_uint64_add(a,b) ((a) + (b))
-#define _cairo_uint64_sub(a,b) ((a) - (b))
-#define _cairo_uint64_mul(a,b) ((a) * (b))
-#define _cairo_uint32x32_64_mul(a,b) ((uint64_t) (a) * (b))
-#define _cairo_uint64_lsl(a,b) ((a) << (b))
-#define _cairo_uint64_rsl(a,b) ((uint64_t) (a) >> (b))
-#define _cairo_uint64_rsa(a,b) ((uint64_t) ((int64_t) (a) >> (b)))
-#define _cairo_uint64_lt(a,b) ((a) < (b))
-#define _cairo_uint64_eq(a,b) ((a) == (b))
-#define _cairo_uint64_negate(a) ((uint64_t) -((int64_t) (a)))
-#define _cairo_uint64_negative(a) ((int64_t) (a) < 0)
-#define _cairo_uint64_not(a) (~(a))
+#define _cairo_uint32_to_uint64(i) ((uint64_t)(i))
+#define _cairo_uint64_to_uint32(i) ((uint32_t)(i))
+#define _cairo_uint64_add(a,b) ((a) + (b))
+#define _cairo_uint64_sub(a,b) ((a) - (b))
+#define _cairo_uint64_mul(a,b) ((a) * (b))
+#define _cairo_uint32x32_64_mul(a,b) ((uint64_t)(a) * (b))
+#define _cairo_uint64_lsl(a,b) ((a) << (b))
+#define _cairo_uint64_rsl(a,b) ((uint64_t)(a) >> (b))
+#define _cairo_uint64_rsa(a,b) ((uint64_t)((int64_t)(a) >> (b)))
+#define _cairo_uint64_lt(a,b) ((a) < (b))
+#define _cairo_uint64_eq(a,b) ((a) == (b))
+#define _cairo_uint64_negate(a) ((uint64_t) -((int64_t)(a)))
+#define _cairo_uint64_negative(a) ((int64_t)(a) < 0)
+#define _cairo_uint64_not(a) (~(a))
-#define _cairo_uint64_to_int64(i) ((int64_t) (i))
-#define _cairo_int64_to_uint64(i) ((uint64_t) (i))
+#define _cairo_uint64_to_int64(i) ((int64_t)(i))
+#define _cairo_int64_to_uint64(i) ((uint64_t)(i))
-#define _cairo_int32_to_int64(i) ((int64_t) (i))
-#define _cairo_int64_to_int32(i) ((int32_t) (i))
-#define _cairo_int64_add(a,b) ((a) + (b))
-#define _cairo_int64_sub(a,b) ((a) - (b))
-#define _cairo_int64_mul(a,b) ((a) * (b))
-#define _cairo_int32x32_64_mul(a,b) ((int64_t) (a) * (b))
-#define _cairo_int64_lt(a,b) ((a) < (b))
-#define _cairo_int64_eq(a,b) ((a) == (b))
-#define _cairo_int64_lsl(a,b) ((a) << (b))
-#define _cairo_int64_rsl(a,b) ((int64_t) ((uint64_t) (a) >> (b)))
-#define _cairo_int64_rsa(a,b) ((int64_t) (a) >> (b))
-#define _cairo_int64_negate(a) (-(a))
-#define _cairo_int64_negative(a) ((a) < 0)
-#define _cairo_int64_not(a) (~(a))
+#define _cairo_int32_to_int64(i) ((int64_t)(i))
+#define _cairo_int64_to_int32(i) ((int32_t)(i))
+#define _cairo_int64_add(a,b) ((a) + (b))
+#define _cairo_int64_sub(a,b) ((a) - (b))
+#define _cairo_int64_mul(a,b) ((a) * (b))
+#define _cairo_int32x32_64_mul(a,b) ((int64_t)(a) * (b))
+#define _cairo_int64_lt(a,b) ((a) < (b))
+#define _cairo_int64_eq(a,b) ((a) == (b))
+#define _cairo_int64_lsl(a,b) ((a) << (b))
+#define _cairo_int64_rsl(a,b) ((int64_t)((uint64_t)(a) >> (b)))
+#define _cairo_int64_rsa(a,b) ((int64_t)(a) >> (b))
+#define _cairo_int64_negate(a) (-(a))
+#define _cairo_int64_negative(a) ((a) < 0)
+#define _cairo_int64_not(a) (~(a))
#endif
/*
* 64-bit comparisions derived from lt or eq
*/
-#define _cairo_uint64_le(a,b) (!_cairo_uint64_gt(a,b))
-#define _cairo_uint64_ne(a,b) (!_cairo_uint64_eq(a,b))
-#define _cairo_uint64_ge(a,b) (!_cairo_uint64_lt(a,b))
-#define _cairo_uint64_gt(a,b) _cairo_uint64_lt(b,a)
+#define _cairo_uint64_le(a,b) (!_cairo_uint64_gt(a,b))
+#define _cairo_uint64_ne(a,b) (!_cairo_uint64_eq(a,b))
+#define _cairo_uint64_ge(a,b) (!_cairo_uint64_lt(a,b))
+#define _cairo_uint64_gt(a,b) _cairo_uint64_lt(b,a)
-#define _cairo_int64_le(a,b) (!_cairo_int64_gt(a,b))
-#define _cairo_int64_ne(a,b) (!_cairo_int64_eq(a,b))
-#define _cairo_int64_ge(a,b) (!_cairo_int64_lt(a,b))
-#define _cairo_int64_gt(a,b) _cairo_int64_lt(b,a)
+#define _cairo_int64_le(a,b) (!_cairo_int64_gt(a,b))
+#define _cairo_int64_ne(a,b) (!_cairo_int64_eq(a,b))
+#define _cairo_int64_ge(a,b) (!_cairo_int64_lt(a,b))
+#define _cairo_int64_gt(a,b) _cairo_int64_lt(b,a)
/*
* As the C implementation always computes both, create
@@ -186,13 +186,13 @@
*/
typedef struct _cairo_uquorem64 {
- cairo_uint64_t quo;
- cairo_uint64_t rem;
+ cairo_uint64_t quo;
+ cairo_uint64_t rem;
} cairo_uquorem64_t;
typedef struct _cairo_quorem64 {
- cairo_int64_t quo;
- cairo_int64_t rem;
+ cairo_int64_t quo;
+ cairo_int64_t rem;
} cairo_quorem64_t;
cairo_uquorem64_t I
@@ -210,98 +210,98 @@
#if !HAVE_UINT128_T
typedef struct cairo_uint128 {
- cairo_uint64_t lo, hi;
+ cairo_uint64_t lo, hi;
} cairo_uint128_t, cairo_int128_t;
-cairo_uint128_t I _cairo_uint32_to_uint128 (uint32_t i);
-cairo_uint128_t I _cairo_uint64_to_uint128 (cairo_uint64_t i);
-#define _cairo_uint128_to_uint64(a) ((a).lo)
-#define _cairo_uint128_to_uint32(a) _cairo_uint64_to_uint32(_cairo_uint128_to_uint64(a))
-cairo_uint128_t I _cairo_uint128_add (cairo_uint128_t a, cairo_uint128_t b);
-cairo_uint128_t I _cairo_uint128_sub (cairo_uint128_t a, cairo_uint128_t b);
-cairo_uint128_t I _cairo_uint128_mul (cairo_uint128_t a, cairo_uint128_t b);
-cairo_uint128_t I _cairo_uint64x64_128_mul (cairo_uint64_t a, cairo_uint64_t b);
-cairo_uint128_t I _cairo_uint128_lsl (cairo_uint128_t a, int shift);
-cairo_uint128_t I _cairo_uint128_rsl (cairo_uint128_t a, int shift);
-cairo_uint128_t I _cairo_uint128_rsa (cairo_uint128_t a, int shift);
-int I _cairo_uint128_lt (cairo_uint128_t a, cairo_uint128_t b);
-int I _cairo_uint128_eq (cairo_uint128_t a, cairo_uint128_t b);
-cairo_uint128_t I _cairo_uint128_negate (cairo_uint128_t a);
-#define _cairo_uint128_negative(a) (_cairo_uint64_negative(a.hi))
-cairo_uint128_t I _cairo_uint128_not (cairo_uint128_t a);
+cairo_uint128_t I _cairo_uint32_to_uint128 (uint32_t i);
+cairo_uint128_t I _cairo_uint64_to_uint128 (cairo_uint64_t i);
+#define _cairo_uint128_to_uint64(a) ((a).lo)
+#define _cairo_uint128_to_uint32(a) _cairo_uint64_to_uint32(_cairo_uint128_to_uint64(a))
+cairo_uint128_t I _cairo_uint128_add (cairo_uint128_t a, cairo_uint128_t b);
+cairo_uint128_t I _cairo_uint128_sub (cairo_uint128_t a, cairo_uint128_t b);
+cairo_uint128_t I _cairo_uint128_mul (cairo_uint128_t a, cairo_uint128_t b);
+cairo_uint128_t I _cairo_uint64x64_128_mul (cairo_uint64_t a, cairo_uint64_t b);
+cairo_uint128_t I _cairo_uint128_lsl (cairo_uint128_t a, int shift);
+cairo_uint128_t I _cairo_uint128_rsl (cairo_uint128_t a, int shift);
+cairo_uint128_t I _cairo_uint128_rsa (cairo_uint128_t a, int shift);
+int I _cairo_uint128_lt (cairo_uint128_t a, cairo_uint128_t b);
+int I _cairo_uint128_eq (cairo_uint128_t a, cairo_uint128_t b);
+cairo_uint128_t I _cairo_uint128_negate (cairo_uint128_t a);
+#define _cairo_uint128_negative(a) (_cairo_uint64_negative(a.hi))
+cairo_uint128_t I _cairo_uint128_not (cairo_uint128_t a);
-#define _cairo_uint128_to_int128(i) (i)
-#define _cairo_int128_to_uint128(i) (i)
+#define _cairo_uint128_to_int128(i) (i)
+#define _cairo_int128_to_uint128(i) (i)
-cairo_int128_t I _cairo_int32_to_int128 (int32_t i);
-cairo_int128_t I _cairo_int64_to_int128 (cairo_int64_t i);
-#define _cairo_int128_to_int64(a) ((cairo_int64_t) (a).lo)
-#define _cairo_int128_to_int32(a) _cairo_int64_to_int32(_cairo_int128_to_int64(a))
-#define _cairo_int128_add(a,b) _cairo_uint128_add(a,b)
-#define _cairo_int128_sub(a,b) _cairo_uint128_sub(a,b)
-#define _cairo_int128_mul(a,b) _cairo_uint128_mul(a,b)
+cairo_int128_t I _cairo_int32_to_int128 (int32_t i);
+cairo_int128_t I _cairo_int64_to_int128 (cairo_int64_t i);
+#define _cairo_int128_to_int64(a) ((cairo_int64_t)(a).lo)
+#define _cairo_int128_to_int32(a) _cairo_int64_to_int32(_cairo_int128_to_int64(a))
+#define _cairo_int128_add(a,b) _cairo_uint128_add(a,b)
+#define _cairo_int128_sub(a,b) _cairo_uint128_sub(a,b)
+#define _cairo_int128_mul(a,b) _cairo_uint128_mul(a,b)
cairo_int128_t I _cairo_int64x64_128_mul (cairo_int64_t a, cairo_int64_t b);
-#define _cairo_int128_lsl(a,b) _cairo_uint128_lsl(a,b)
-#define _cairo_int128_rsl(a,b) _cairo_uint128_rsl(a,b)
-#define _cairo_int128_rsa(a,b) _cairo_uint128_rsa(a,b)
-int I _cairo_int128_lt (cairo_int128_t a, cairo_int128_t b);
-#define _cairo_int128_eq(a,b) _cairo_uint128_eq (a,b)
-#define _cairo_int128_negate(a) _cairo_uint128_negate(a)
-#define _cairo_int128_negative(a) (_cairo_uint128_negative(a))
-#define _cairo_int128_not(a) _cairo_uint128_not(a)
+#define _cairo_int128_lsl(a,b) _cairo_uint128_lsl(a,b)
+#define _cairo_int128_rsl(a,b) _cairo_uint128_rsl(a,b)
+#define _cairo_int128_rsa(a,b) _cairo_uint128_rsa(a,b)
+int I _cairo_int128_lt (cairo_int128_t a, cairo_int128_t b);
+#define _cairo_int128_eq(a,b) _cairo_uint128_eq (a,b)
+#define _cairo_int128_negate(a) _cairo_uint128_negate(a)
+#define _cairo_int128_negative(a) (_cairo_uint128_negative(a))
+#define _cairo_int128_not(a) _cairo_uint128_not(a)
-#else /* !HAVE_UINT128_T */
+#else /* !HAVE_UINT128_T */
-typedef uint128_t cairo_uint128_t;
-typedef int128_t cairo_int128_t;
+typedef uint128_t cairo_uint128_t;
+typedef int128_t cairo_int128_t;
-#define _cairo_uint32_to_uint128(i) ((uint128_t) (i))
-#define _cairo_uint64_to_uint128(i) ((uint128_t) (i))
-#define _cairo_uint128_to_uint64(i) ((uint64_t) (i))
-#define _cairo_uint128_to_uint32(i) ((uint32_t) (i))
-#define _cairo_uint128_add(a,b) ((a) + (b))
-#define _cairo_uint128_sub(a,b) ((a) - (b))
-#define _cairo_uint128_mul(a,b) ((a) * (b))
-#define _cairo_uint64x64_128_mul(a,b) ((uint128_t) (a) * (b))
-#define _cairo_uint128_lsl(a,b) ((a) << (b))
-#define _cairo_uint128_rsl(a,b) ((uint128_t) (a) >> (b))
-#define _cairo_uint128_rsa(a,b) ((uint128_t) ((int128_t) (a) >> (b)))
-#define _cairo_uint128_lt(a,b) ((a) < (b))
-#define _cairo_uint128_eq(a,b) ((a) == (b))
-#define _cairo_uint128_negate(a) ((uint128_t) -((int128_t) (a)))
-#define _cairo_uint128_negative(a) ((int128_t) (a) < 0)
-#define _cairo_uint128_not(a) (~(a))
+#define _cairo_uint32_to_uint128(i) ((uint128_t)(i))
+#define _cairo_uint64_to_uint128(i) ((uint128_t)(i))
+#define _cairo_uint128_to_uint64(i) ((uint64_t)(i))
+#define _cairo_uint128_to_uint32(i) ((uint32_t)(i))
+#define _cairo_uint128_add(a,b) ((a) + (b))
+#define _cairo_uint128_sub(a,b) ((a) - (b))
+#define _cairo_uint128_mul(a,b) ((a) * (b))
+#define _cairo_uint64x64_128_mul(a,b) ((uint128_t)(a) * (b))
+#define _cairo_uint128_lsl(a,b) ((a) << (b))
+#define _cairo_uint128_rsl(a,b) ((uint128_t)(a) >> (b))
+#define _cairo_uint128_rsa(a,b) ((uint128_t)((int128_t)(a) >> (b)))
+#define _cairo_uint128_lt(a,b) ((a) < (b))
+#define _cairo_uint128_eq(a,b) ((a) == (b))
+#define _cairo_uint128_negate(a) ((uint128_t) -((int128_t)(a)))
+#define _cairo_uint128_negative(a) ((int128_t)(a) < 0)
+#define _cairo_uint128_not(a) (~(a))
-#define _cairo_uint128_to_int128(i) ((int128_t) (i))
-#define _cairo_int128_to_uint128(i) ((uint128_t) (i))
+#define _cairo_uint128_to_int128(i) ((int128_t)(i))
+#define _cairo_int128_to_uint128(i) ((uint128_t)(i))
-#define _cairo_int32_to_int128(i) ((int128_t) (i))
-#define _cairo_int64_to_int128(i) ((int128_t) (i))
-#define _cairo_int128_to_int64(i) ((int64_t) (i))
-#define _cairo_int128_to_int32(i) ((int32_t) (i))
-#define _cairo_int128_add(a,b) ((a) + (b))
-#define _cairo_int128_sub(a,b) ((a) - (b))
-#define _cairo_int128_mul(a,b) ((a) * (b))
-#define _cairo_int64x64_128_mul(a,b) ((int128_t) (a) * (b))
-#define _cairo_int128_lt(a,b) ((a) < (b))
-#define _cairo_int128_eq(a,b) ((a) == (b))
-#define _cairo_int128_lsl(a,b) ((a) << (b))
-#define _cairo_int128_rsl(a,b) ((int128_t) ((uint128_t) (a) >> (b)))
-#define _cairo_int128_rsa(a,b) ((int128_t) (a) >> (b))
-#define _cairo_int128_negate(a) (-(a))
-#define _cairo_int128_negative(a) ((a) < 0)
-#define _cairo_int128_not(a) (~(a))
+#define _cairo_int32_to_int128(i) ((int128_t)(i))
+#define _cairo_int64_to_int128(i) ((int128_t)(i))
+#define _cairo_int128_to_int64(i) ((int64_t)(i))
+#define _cairo_int128_to_int32(i) ((int32_t)(i))
+#define _cairo_int128_add(a,b) ((a) + (b))
+#define _cairo_int128_sub(a,b) ((a) - (b))
+#define _cairo_int128_mul(a,b) ((a) * (b))
+#define _cairo_int64x64_128_mul(a,b) ((int128_t)(a) * (b))
+#define _cairo_int128_lt(a,b) ((a) < (b))
+#define _cairo_int128_eq(a,b) ((a) == (b))
+#define _cairo_int128_lsl(a,b) ((a) << (b))
+#define _cairo_int128_rsl(a,b) ((int128_t)((uint128_t)(a) >> (b)))
+#define _cairo_int128_rsa(a,b) ((int128_t)(a) >> (b))
+#define _cairo_int128_negate(a) (-(a))
+#define _cairo_int128_negative(a) ((a) < 0)
+#define _cairo_int128_not(a) (~(a))
-#endif /* HAVE_UINT128_T */
+#endif /* HAVE_UINT128_T */
typedef struct _cairo_uquorem128 {
- cairo_uint128_t quo;
- cairo_uint128_t rem;
+ cairo_uint128_t quo;
+ cairo_uint128_t rem;
} cairo_uquorem128_t;
typedef struct _cairo_quorem128 {
- cairo_int128_t quo;
- cairo_int128_t rem;
+ cairo_int128_t quo;
+ cairo_int128_t rem;
} cairo_quorem128_t;
cairo_uquorem128_t I
@@ -312,21 +312,21 @@
cairo_uquorem64_t I
_cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
- cairo_uint64_t den);
+ cairo_uint64_t den);
cairo_quorem64_t I
_cairo_int_96by64_32x64_divrem (cairo_int128_t num,
- cairo_int64_t den);
+ cairo_int64_t den);
-#define _cairo_uint128_le(a,b) (!_cairo_uint128_gt(a,b))
-#define _cairo_uint128_ne(a,b) (!_cairo_uint128_eq(a,b))
-#define _cairo_uint128_ge(a,b) (!_cairo_uint128_lt(a,b))
-#define _cairo_uint128_gt(a,b) _cairo_uint128_lt(b,a)
+#define _cairo_uint128_le(a,b) (!_cairo_uint128_gt(a,b))
+#define _cairo_uint128_ne(a,b) (!_cairo_uint128_eq(a,b))
+#define _cairo_uint128_ge(a,b) (!_cairo_uint128_lt(a,b))
+#define _cairo_uint128_gt(a,b) _cairo_uint128_lt(b,a)
-#define _cairo_int128_le(a,b) (!_cairo_int128_gt(a,b))
-#define _cairo_int128_ne(a,b) (!_cairo_int128_eq(a,b))
-#define _cairo_int128_ge(a,b) (!_cairo_int128_lt(a,b))
-#define _cairo_int128_gt(a,b) _cairo_int128_lt(b,a)
+#define _cairo_int128_le(a,b) (!_cairo_int128_gt(a,b))
+#define _cairo_int128_ne(a,b) (!_cairo_int128_eq(a,b))
+#define _cairo_int128_ge(a,b) (!_cairo_int128_lt(a,b))
+#define _cairo_int128_gt(a,b) _cairo_int128_lt(b,a)
#undef I
--- a/src/core/model/calendar-scheduler.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/calendar-scheduler.cc Fri May 13 14:52:27 2011 -0400
@@ -125,7 +125,7 @@
NS_ASSERT (!IsEmpty ());
uint32_t i = m_lastBucket;
uint64_t bucketTop = m_bucketTop;
- Scheduler::Event minEvent = {0, {~0, ~0}};
+ Scheduler::Event minEvent = { 0, { ~0, ~0}};
do
{
if (!m_buckets[i].empty ())
@@ -154,7 +154,7 @@
{
uint32_t i = m_lastBucket;
uint64_t bucketTop = m_bucketTop;
- Scheduler::Event minEvent = {0, {~0, ~0}};
+ Scheduler::Event minEvent = { 0, { ~0, ~0}};
do
{
if (!m_buckets[i].empty ())
--- a/src/core/model/callback.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/callback.cc Fri May 13 14:52:27 2011 -0400
@@ -4,30 +4,33 @@
CallbackValue::CallbackValue ()
: m_value ()
-{}
+{
+}
CallbackValue::CallbackValue (const CallbackBase &base)
: m_value (base)
-{}
+{
+}
CallbackValue::~CallbackValue ()
-{}
-void
+{
+}
+void
CallbackValue::Set (CallbackBase base)
{
m_value = base;
}
-Ptr<AttributeValue>
+Ptr<AttributeValue>
CallbackValue::Copy (void) const
{
return Create<CallbackValue> (m_value);
}
-std::string
+std::string
CallbackValue::SerializeToString (Ptr<const AttributeChecker> checker) const
{
std::ostringstream oss;
oss << PeekPointer (m_value.GetImpl ());
return oss.str ();
}
-bool
+bool
CallbackValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
{
return false;
@@ -48,36 +51,36 @@
std::string
CallbackBase::Demangle(const std::string& mangled)
{
- int status;
- char* demangled = abi::__cxa_demangle(mangled.c_str(),
- NULL, NULL, &status);
+ int status;
+ char* demangled = abi::__cxa_demangle(mangled.c_str(),
+ NULL, NULL, &status);
- std::string ret;
- if (status == 0) {
- NS_ASSERT(demangled);
- ret = demangled;
+ std::string ret;
+ if (status == 0) {
+ NS_ASSERT(demangled);
+ ret = demangled;
}
- else if (status == -1) {
- NS_LOG_UNCOND("Callback demangling failed: Memory allocation failure occured.");
- ret = mangled;
+ else if (status == -1) {
+ NS_LOG_UNCOND("Callback demangling failed: Memory allocation failure occured.");
+ ret = mangled;
}
- else if (status == -2) {
- NS_LOG_UNCOND("Callback demangling failed: Mangled name is not a valid under the C++ ABI mangling rules.");
- ret = mangled;
+ else if (status == -2) {
+ NS_LOG_UNCOND("Callback demangling failed: Mangled name is not a valid under the C++ ABI mangling rules.");
+ ret = mangled;
}
- else if (status == -3) {
- NS_LOG_UNCOND("Callback demangling failed: One of the arguments is invalid.");
- ret = mangled;
+ else if (status == -3) {
+ NS_LOG_UNCOND("Callback demangling failed: One of the arguments is invalid.");
+ ret = mangled;
}
- else {
- NS_LOG_UNCOND("Callback demangling failed: status " << status);
- ret = mangled;
+ else {
+ NS_LOG_UNCOND("Callback demangling failed: status " << status);
+ ret = mangled;
}
- if (demangled) {
- free(demangled);
+ if (demangled) {
+ free(demangled);
}
- return ret;
+ return ret;
}
} // namespace ns3
@@ -87,7 +90,7 @@
std::string
ns3::CallbackBase::Demangle(const std::string& mangled)
{
- return mangled;
+ return mangled;
}
#endif
--- a/src/core/model/callback.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/callback.h Fri May 13 14:52:27 2011 -0400
@@ -217,34 +217,34 @@
: m_objPtr (objPtr), m_memPtr (mem_ptr) {}
virtual ~MemPtrCallbackImpl () {}
R operator() (void) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) ();
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)();
}
R operator() (T1 a1) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1);
}
R operator() (T1 a1,T2 a2) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2);
}
R operator() (T1 a1,T2 a2,T3 a3) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4,T5 a5) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4, a5);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4, a5);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4, a5, a6);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4, a5, a6);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4, a5, a6, a7);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4, a5, a6, a7);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4, a5, a6, a7, a8);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4, a5, a6, a7, a8);
}
R operator() (T1 a1,T2 a2,T3 a3,T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, T9 a9) {
- return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr) (a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ return ((CallbackTraits<OBJ_PTR>::GetReference (m_objPtr)).*m_memPtr)(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
virtual bool IsEqual (Ptr<const CallbackImplBase> other) const {
MemPtrCallbackImpl<OBJ_PTR,MEM_PTR,R,T1,T2,T3,T4,T5,T6,T7,T8,T9> const *otherDerived =
@@ -323,7 +323,7 @@
class CallbackBase {
public:
CallbackBase () : m_impl () {}
- Ptr<CallbackImplBase> GetImpl (void) const {return m_impl;}
+ Ptr<CallbackImplBase> GetImpl (void) const { return m_impl;}
protected:
CallbackBase (Ptr<CallbackImplBase> impl) : m_impl (impl) {}
Ptr<CallbackImplBase> m_impl;
@@ -390,48 +390,48 @@
Callback<R,T2,T3,T4,T5,T6,T7,T8,T9> Bind (T a) {
Ptr<CallbackImpl<R,T2,T3,T4,T5,T6,T7,T8,T9,empty> > impl =
Ptr<CallbackImpl<R,T2,T3,T4,T5,T6,T7,T8,T9,empty> > (
- new BoundFunctorCallbackImpl<
- Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9>,
- R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (*this, a), false);
+ new BoundFunctorCallbackImpl<
+ Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9>,
+ R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (*this, a), false);
return Callback<R,T2,T3,T4,T5,T6,T7,T8,T9> (impl);
}
bool IsNull (void) const {
- return (DoPeekImpl () == 0)?true:false;
+ return (DoPeekImpl () == 0) ? true : false;
}
void Nullify (void) {
m_impl = 0;
}
R operator() (void) const {
- return (*(DoPeekImpl ())) ();
+ return (*(DoPeekImpl ()))();
}
R operator() (T1 a1) const {
- return (*(DoPeekImpl ())) (a1);
+ return (*(DoPeekImpl ()))(a1);
}
R operator() (T1 a1, T2 a2) const {
- return (*(DoPeekImpl ())) (a1,a2);
+ return (*(DoPeekImpl ()))(a1,a2);
}
R operator() (T1 a1, T2 a2, T3 a3) const {
- return (*(DoPeekImpl ())) (a1,a2,a3);
+ return (*(DoPeekImpl ()))(a1,a2,a3);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4,T5 a5) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4,a5);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4,a5);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4,T5 a5,T6 a6) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4,a5,a6);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4,a5,a6);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4,T5 a5,T6 a6,T7 a7) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4,a5,a6,a7);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4,a5,a6,a7);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4,T5 a5,T6 a6,T7 a7,T8 a8) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4,a5,a6,a7,a8);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4,a5,a6,a7,a8);
}
R operator() (T1 a1, T2 a2, T3 a3, T4 a4,T5 a5,T6 a6,T7 a7,T8 a8, T9 a9) const {
- return (*(DoPeekImpl ())) (a1,a2,a3,a4,a5,a6,a7,a8,a9);
+ return (*(DoPeekImpl ()))(a1,a2,a3,a4,a5,a6,a7,a8,a9);
}
bool IsEqual (const CallbackBase &other) const {
@@ -499,11 +499,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R>
-Callback<R> MakeCallback (R (T::*memPtr) (void), OBJ objPtr) {
+Callback<R> MakeCallback (R (T::*memPtr)(void), OBJ objPtr) {
return Callback<R> (objPtr, memPtr);
}
template <typename T, typename OBJ, typename R>
-Callback<R> MakeCallback (R (T::*mem_ptr) () const, OBJ objPtr) {
+Callback<R> MakeCallback (R (T::*mem_ptr)() const, OBJ objPtr) {
return Callback<R> (objPtr, mem_ptr);
}
/**
@@ -515,11 +515,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1>
-Callback<R,T1> MakeCallback (R (T::*mem_ptr) (T1), OBJ objPtr) {
+Callback<R,T1> MakeCallback (R (T::*mem_ptr)(T1), OBJ objPtr) {
return Callback<R,T1> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1>
-Callback<R,T1> MakeCallback (R (T::*mem_ptr) (T1) const, OBJ objPtr) {
+Callback<R,T1> MakeCallback (R (T::*mem_ptr)(T1) const, OBJ objPtr) {
return Callback<R,T1> (objPtr, mem_ptr);
}
/**
@@ -531,11 +531,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2>
-Callback<R,T1,T2> MakeCallback (R (T::*mem_ptr) (T1,T2), OBJ objPtr) {
+Callback<R,T1,T2> MakeCallback (R (T::*mem_ptr)(T1,T2), OBJ objPtr) {
return Callback<R,T1,T2> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2>
-Callback<R,T1,T2> MakeCallback (R (T::*mem_ptr) (T1,T2) const, OBJ objPtr) {
+Callback<R,T1,T2> MakeCallback (R (T::*mem_ptr)(T1,T2) const, OBJ objPtr) {
return Callback<R,T1,T2> (objPtr, mem_ptr);
}
/**
@@ -547,11 +547,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1,typename T2, typename T3>
-Callback<R,T1,T2,T3> MakeCallback (R (T::*mem_ptr) (T1,T2,T3), OBJ objPtr) {
+Callback<R,T1,T2,T3> MakeCallback (R (T::*mem_ptr)(T1,T2,T3), OBJ objPtr) {
return Callback<R,T1,T2,T3> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1,typename T2, typename T3>
-Callback<R,T1,T2,T3> MakeCallback (R (T::*mem_ptr) (T1,T2,T3) const, OBJ objPtr) {
+Callback<R,T1,T2,T3> MakeCallback (R (T::*mem_ptr)(T1,T2,T3) const, OBJ objPtr) {
return Callback<R,T1,T2,T3> (objPtr, mem_ptr);
}
/**
@@ -563,11 +563,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4>
-Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4>
-Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4> (objPtr, mem_ptr);
}
/**
@@ -579,11 +579,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5>
-Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5>
-Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5> (objPtr, mem_ptr);
}
/**
@@ -595,11 +595,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6>
-Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6>
-Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6> (objPtr, mem_ptr);
}
@@ -612,11 +612,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7>
-Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7>
-Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7> (objPtr, mem_ptr);
}
@@ -630,11 +630,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7, typename T8>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7,T8), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7,T8), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7, typename T8>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7,T8) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7,T8) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (objPtr, mem_ptr);
}
@@ -647,11 +647,11 @@
* and potentially return a value.
*/
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5,typename T6, typename T7, typename T8, typename T9>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7,T8,T9), OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7,T8,T9), OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (objPtr, mem_ptr);
}
template <typename T, typename OBJ, typename R, typename T1, typename T2, typename T3, typename T4,typename T5, typename T6, typename T7, typename T8, typename T9>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*mem_ptr) (T1,T2,T3,T4,T5,T6,T7,T8,T9) const, OBJ objPtr) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (T::*mem_ptr)(T1,T2,T3,T4,T5,T6,T7,T8,T9) const, OBJ objPtr) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (objPtr, mem_ptr);
}
@@ -663,7 +663,7 @@
* and potentially return a value.
*/
template <typename R>
-Callback<R> MakeCallback (R (*fnPtr) ()) {
+Callback<R> MakeCallback (R (*fnPtr)()) {
return Callback<R> (fnPtr, true, true);
}
/**
@@ -674,7 +674,7 @@
* and potentially return a value.
*/
template <typename R, typename T1>
-Callback<R,T1> MakeCallback (R (*fnPtr) (T1)) {
+Callback<R,T1> MakeCallback (R (*fnPtr)(T1)) {
return Callback<R,T1> (fnPtr, true, true);
}
/**
@@ -685,7 +685,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2>
-Callback<R,T1,T2> MakeCallback (R (*fnPtr) (T1,T2)) {
+Callback<R,T1,T2> MakeCallback (R (*fnPtr)(T1,T2)) {
return Callback<R,T1,T2> (fnPtr, true, true);
}
/**
@@ -696,7 +696,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3>
-Callback<R,T1,T2,T3> MakeCallback (R (*fnPtr) (T1,T2,T3)) {
+Callback<R,T1,T2,T3> MakeCallback (R (*fnPtr)(T1,T2,T3)) {
return Callback<R,T1,T2,T3> (fnPtr, true, true);
}
/**
@@ -707,7 +707,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4>
-Callback<R,T1,T2,T3,T4> MakeCallback (R (*fnPtr) (T1,T2,T3,T4)) {
+Callback<R,T1,T2,T3,T4> MakeCallback (R (*fnPtr)(T1,T2,T3,T4)) {
return Callback<R,T1,T2,T3,T4> (fnPtr, true, true);
}
/**
@@ -718,7 +718,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5>
-Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (*fnPtr) (T1,T2,T3,T4,T5)) {
+Callback<R,T1,T2,T3,T4,T5> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5)) {
return Callback<R,T1,T2,T3,T4,T5> (fnPtr, true, true);
}
/**
@@ -729,7 +729,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6>
-Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (*fnPtr) (T1,T2,T3,T4,T5,T6)) {
+Callback<R,T1,T2,T3,T4,T5,T6> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6)) {
return Callback<R,T1,T2,T3,T4,T5,T6> (fnPtr, true, true);
}
@@ -741,7 +741,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7>
-Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (*fnPtr) (T1,T2,T3,T4,T5,T6,T7)) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7)) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7> (fnPtr, true, true);
}
@@ -753,7 +753,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (*fnPtr) (T1,T2,T3,T4,T5,T6,T7,T8)) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7,T8)) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (fnPtr, true, true);
}
@@ -765,7 +765,7 @@
* and potentially return a value.
*/
template <typename R, typename T1, typename T2,typename T3,typename T4,typename T5,typename T6, typename T7, typename T8, typename T9>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (*fnPtr) (T1,T2,T3,T4,T5,T6,T7,T8,T9)) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeCallback (R (*fnPtr)(T1,T2,T3,T4,T5,T6,T7,T8,T9)) {
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> (fnPtr, true, true);
}
@@ -892,7 +892,7 @@
*/
template <typename R, typename TX, typename ARG>
-Callback<R> MakeBoundCallback (R (*fnPtr) (TX), ARG a) {
+Callback<R> MakeBoundCallback (R (*fnPtr)(TX), ARG a) {
Ptr<CallbackImpl<R,empty,empty,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX),R,TX,empty,empty,empty,empty,empty,empty,empty,empty> >(fnPtr, a);
return Callback<R> (impl);
@@ -900,56 +900,56 @@
template <typename R, typename TX, typename ARG,
typename T1>
-Callback<R,T1> MakeBoundCallback (R (*fnPtr) (TX,T1), ARG a) {
+Callback<R,T1> MakeBoundCallback (R (*fnPtr)(TX,T1), ARG a) {
Ptr<CallbackImpl<R,T1,empty,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1),R,TX,T1,empty,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2>
-Callback<R,T1,T2> MakeBoundCallback (R (*fnPtr) (TX,T1,T2), ARG a) {
+Callback<R,T1,T2> MakeBoundCallback (R (*fnPtr)(TX,T1,T2), ARG a) {
Ptr<CallbackImpl<R,T1,T2,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2),R,TX,T1,T2,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3>
-Callback<R,T1,T2,T3> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3), ARG a) {
+Callback<R,T1,T2,T3> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3),R,TX,T1,T2,T3,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4>
-Callback<R,T1,T2,T3,T4> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3,T4), ARG a) {
+Callback<R,T1,T2,T3,T4> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4),R,TX,T1,T2,T3,T4,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5>
-Callback<R,T1,T2,T3,T4,T5> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3,T4,T5), ARG a) {
+Callback<R,T1,T2,T3,T4,T5> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5),R,TX,T1,T2,T3,T4,T5,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6>
-Callback<R,T1,T2,T3,T4,T5,T6> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3,T4,T5,T6), ARG a) {
+Callback<R,T1,T2,T3,T4,T5,T6> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6),R,TX,T1,T2,T3,T4,T5,T6,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6, typename T7>
-Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3,T4,T5,T6,T7), ARG a) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6,T7), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6,T7),R,TX,T1,T2,T3,T4,T5,T6,T7,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6,T7> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6, typename T7, typename T8>
-Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeBoundCallback (R (*fnPtr) (TX,T1,T2,T3,T4,T5,T6,T7,T8), ARG a) {
+Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6,T7,T8), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6,T7,T8),R,TX,T1,T2,T3,T4,T5,T6,T7,T8> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (impl);
--- a/src/core/model/command-line.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/command-line.cc Fri May 13 14:52:27 2011 -0400
@@ -31,7 +31,8 @@
namespace ns3 {
CommandLine::CommandLine ()
-{}
+{
+}
CommandLine::CommandLine (const CommandLine &cmd)
{
Copy (cmd);
@@ -67,9 +68,10 @@
}
CommandLine::Item::~Item ()
-{}
+{
+}
-void
+void
CommandLine::Parse (int iargc, char *argv[]) const
{
int argc = iargc;
@@ -79,28 +81,28 @@
std::string param = *argv;
std::string::size_type cur = param.find ("--");
if (cur == 0)
- {
- param = param.substr (2, param.size () - 2);
- }
+ {
+ param = param.substr (2, param.size () - 2);
+ }
else
- {
- cur = param.find ("-");
- if (cur == 0)
- {
- param = param.substr (1, param.size () - 1);
- }
- else
- {
- // invalid argument. ignore.
- continue;
- }
- }
+ {
+ cur = param.find ("-");
+ if (cur == 0)
+ {
+ param = param.substr (1, param.size () - 1);
+ }
+ else
+ {
+ // invalid argument. ignore.
+ continue;
+ }
+ }
cur = param.find ("=");
std::string name, value;
if (cur == std::string::npos)
{
- name = param;
- value = "";
+ name = param;
+ value = "";
}
else
{
@@ -116,7 +118,7 @@
{
std::cout << "--PrintHelp: Print this help message." << std::endl;
std::cout << "--PrintGroups: Print the list of groups." << std::endl;
- std::cout << "--PrintTypeIds: Print all TypeIds." << std::endl;
+ std::cout << "--PrintTypeIds: Print all TypeIds." << std::endl;
std::cout << "--PrintGroup=[group]: Print all TypeIds of group." << std::endl;
std::cout << "--PrintAttributes=[typeid]: Print all attributes of typeid." << std::endl;
std::cout << "--PrintGlobals: Print the list of globals." << std::endl;
@@ -124,9 +126,9 @@
{
std::cout << "User Arguments:" << std::endl;
for (Items::const_iterator i = m_items.begin (); i != m_items.end (); ++i)
- {
- std::cout << " --" << (*i)->m_name << ": " << (*i)->m_help << std::endl;
- }
+ {
+ std::cout << " --" << (*i)->m_name << ": " << (*i)->m_help << std::endl;
+ }
}
}
@@ -140,7 +142,7 @@
StringValue v;
(*i)->GetValue (v);
std::cout << v.Get () << "]: "
- << (*i)->GetHelp () << std::endl;
+ << (*i)->GetHelp () << std::endl;
}
}
@@ -158,7 +160,7 @@
Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i);
Ptr<const AttributeValue> initial = tid.GetAttributeInitialValue (i);
std::cout << initial->SerializeToString (checker) << "]: "
- << tid.GetAttributeHelp (i) << std::endl;
+ << tid.GetAttributeHelp (i) << std::endl;
}
}
@@ -170,9 +172,9 @@
{
TypeId tid = TypeId::GetRegistered (i);
if (tid.GetGroupName () == group)
- {
- std::cout << " --PrintAttributes=" <<tid.GetName ()<<std::endl;
- }
+ {
+ std::cout << " --PrintAttributes=" <<tid.GetName ()<<std::endl;
+ }
}
}
@@ -195,22 +197,22 @@
TypeId tid = TypeId::GetRegistered (i);
std::string group = tid.GetGroupName ();
if (group == "")
- {
- continue;
- }
+ {
+ continue;
+ }
bool found = false;
for (std::list<std::string>::const_iterator j = groups.begin (); j != groups.end (); ++j)
- {
- if (*j == group)
- {
- found = true;
- break;
- }
- }
+ {
+ if (*j == group)
+ {
+ found = true;
+ break;
+ }
+ }
if (!found)
- {
- groups.push_back (group);
- }
+ {
+ groups.push_back (group);
+ }
}
for (std::list<std::string>::const_iterator k = groups.begin (); k != groups.end (); ++k)
{
--- a/src/core/model/command-line.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/command-line.h Fri May 13 14:52:27 2011 -0400
@@ -58,8 +58,8 @@
*/
template <typename T>
void AddValue (const std::string &name,
- const std::string &help,
- T &value);
+ const std::string &help,
+ T &value);
/**
@@ -69,7 +69,7 @@
* and collect the value. This normally used by language bindings.
*/
void AddValue (const std::string &name,
- const std::string &help,
+ const std::string &help,
Callback<bool, std::string> callback);
/**
@@ -85,7 +85,7 @@
private:
class Item
{
- public:
+public:
std::string m_name;
std::string m_help;
virtual ~Item ();
@@ -94,13 +94,13 @@
template <typename T>
class UserItem : public Item
{
- public:
+public:
virtual bool Parse (std::string value);
T *m_valuePtr;
};
class CallbackItem : public Item
{
- public:
+public:
virtual bool Parse (std::string value);
Callback<bool, std::string> m_callback;
};
@@ -126,8 +126,8 @@
template <typename T>
void
CommandLine::AddValue (const std::string &name,
- const std::string &help,
- T &value)
+ const std::string &help,
+ T &value)
{
UserItem<T> *item = new UserItem<T> ();
item->m_name = name;
--- a/src/core/model/config.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/config.cc Fri May 13 14:52:27 2011 -0400
@@ -35,46 +35,48 @@
namespace Config {
MatchContainer::MatchContainer ()
-{}
-MatchContainer::MatchContainer (const std::vector<Ptr<Object> > &objects,
+{
+}
+MatchContainer::MatchContainer (const std::vector<Ptr<Object> > &objects,
const std::vector<std::string> &contexts,
std::string path)
: m_objects (objects),
m_contexts (contexts),
m_path (path)
-{}
-MatchContainer::Iterator
+{
+}
+MatchContainer::Iterator
MatchContainer::Begin (void) const
{
return m_objects.begin ();
}
-MatchContainer::Iterator
+MatchContainer::Iterator
MatchContainer::End (void) const
{
return m_objects.end ();
}
-uint32_t
+uint32_t
MatchContainer::GetN (void) const
{
return m_objects.size ();
}
-Ptr<Object>
+Ptr<Object>
MatchContainer::Get (uint32_t i) const
{
return m_objects[i];
}
-std::string
+std::string
MatchContainer::GetMatchedPath (uint32_t i) const
{
return m_contexts[i];
}
-std::string
+std::string
MatchContainer::GetPath (void) const
{
return m_path;
}
-void
+void
MatchContainer::Set (std::string name, const AttributeValue &value)
{
for (Iterator tmp = Begin (); tmp != End (); ++tmp)
@@ -139,8 +141,9 @@
ArrayMatcher::ArrayMatcher (std::string element)
: m_element (element)
-{}
-bool
+{
+}
+bool
ArrayMatcher::Matches (uint32_t i) const
{
if (m_element == "*")
@@ -156,16 +159,16 @@
std::string right = m_element.substr (tmp+1, m_element.size () - (tmp + 1));
ArrayMatcher matcher = ArrayMatcher (left);
if (matcher.Matches (i))
- {
- NS_LOG_DEBUG ("Array "<<i<<" matches "<<left);
- return true;
- }
+ {
+ NS_LOG_DEBUG ("Array "<<i<<" matches "<<left);
+ return true;
+ }
matcher = ArrayMatcher (right);
if (matcher.Matches (i))
- {
- NS_LOG_DEBUG ("Array "<<i<<" matches "<<right);
- return true;
- }
+ {
+ NS_LOG_DEBUG ("Array "<<i<<" matches "<<right);
+ return true;
+ }
NS_LOG_DEBUG ("Array "<<i<<" does not match "<<m_element);
return false;
}
@@ -180,17 +183,17 @@
uint32_t min;
uint32_t max;
if (StringToUint32 (lowerBound, &min) &&
- StringToUint32 (upperBound, &max) &&
- i >= min && i <= max)
+ StringToUint32 (upperBound, &max) &&
+ i >= min && i <= max)
{
- NS_LOG_DEBUG ("Array "<<i<<" matches "<<m_element);
+ NS_LOG_DEBUG ("Array "<<i<<" matches "<<m_element);
return true;
}
else
- {
- NS_LOG_DEBUG ("Array "<<i<<" does not "<<m_element);
- return false;
- }
+ {
+ NS_LOG_DEBUG ("Array "<<i<<" does not "<<m_element);
+ return false;
+ }
}
uint32_t value;
if (StringToUint32 (m_element, &value) &&
@@ -237,7 +240,8 @@
Canonicalize ();
}
Resolver::~Resolver ()
-{}
+{
+}
void
Resolver::Canonicalize (void)
{
@@ -363,10 +367,10 @@
TypeId tid = TypeId::LookupByName (tidString);
Ptr<Object> object = root->GetObject<Object> (tid);
if (object == 0)
- {
- NS_LOG_DEBUG ("GetObject ("<<tidString<<") failed on path="<<GetResolvedPath ());
- return;
- }
+ {
+ NS_LOG_DEBUG ("GetObject ("<<tidString<<") failed on path="<<GetResolvedPath ());
+ return;
+ }
m_workStack.push_back (item);
DoResolve (pathLeft, object);
m_workStack.pop_back ();
@@ -377,40 +381,40 @@
TypeId tid = root->GetInstanceTypeId ();
struct TypeId::AttributeInfo info;
if (!tid.LookupAttributeByName (item, &info))
- {
- NS_LOG_DEBUG ("Requested item="<<item<<" does not exist on path="<<GetResolvedPath ());
- return;
- }
+ {
+ NS_LOG_DEBUG ("Requested item="<<item<<" does not exist on path="<<GetResolvedPath ());
+ return;
+ }
// attempt to cast to a pointer checker.
const PointerChecker *ptr = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
if (ptr != 0)
- {
- NS_LOG_DEBUG ("GetAttribute(ptr)="<<item<<" on path="<<GetResolvedPath ());
+ {
+ NS_LOG_DEBUG ("GetAttribute(ptr)="<<item<<" on path="<<GetResolvedPath ());
PointerValue ptr;
root->GetAttribute (item, ptr);
- Ptr<Object> object = ptr.Get<Object> ();
- if (object == 0)
- {
- NS_LOG_ERROR ("Requested object name=\""<<item<<
- "\" exists on path=\""<<GetResolvedPath ()<<"\""
- " but is null.");
- return;
- }
- m_workStack.push_back (item);
- DoResolve (pathLeft, object);
- m_workStack.pop_back ();
- }
+ Ptr<Object> object = ptr.Get<Object> ();
+ if (object == 0)
+ {
+ NS_LOG_ERROR ("Requested object name=\""<<item<<
+ "\" exists on path=\""<<GetResolvedPath ()<<"\""
+ " but is null.");
+ return;
+ }
+ m_workStack.push_back (item);
+ DoResolve (pathLeft, object);
+ m_workStack.pop_back ();
+ }
// attempt to cast to an object vector.
const ObjectVectorChecker *vectorChecker = dynamic_cast<const ObjectVectorChecker *> (PeekPointer (info.checker));
if (vectorChecker != 0)
- {
- NS_LOG_DEBUG ("GetAttribute(vector)="<<item<<" on path="<<GetResolvedPath ());
- ObjectVectorValue vector;
+ {
+ NS_LOG_DEBUG ("GetAttribute(vector)="<<item<<" on path="<<GetResolvedPath ());
+ ObjectVectorValue vector;
root->GetAttribute (item, vector);
- m_workStack.push_back (item);
- DoArrayResolve (pathLeft, vector);
- m_workStack.pop_back ();
- }
+ m_workStack.push_back (item);
+ DoArrayResolve (pathLeft, vector);
+ m_workStack.pop_back ();
+ }
// this could be anything else and we don't know what to do with it.
// So, we just ignore it.
}
@@ -435,13 +439,13 @@
for (uint32_t i = 0; i < vector.GetN (); i++)
{
if (matcher.Matches (i))
- {
- std::ostringstream oss;
- oss << i;
- m_workStack.push_back (oss.str ());
- DoResolve (pathLeft, vector.Get (i));
- m_workStack.pop_back ();
- }
+ {
+ std::ostringstream oss;
+ oss << i;
+ m_workStack.push_back (oss.str ());
+ DoResolve (pathLeft, vector.Get (i));
+ m_workStack.pop_back ();
+ }
}
}
@@ -461,7 +465,7 @@
uint32_t GetRootNamespaceObjectN (void) const;
Ptr<Object> GetRootNamespaceObject (uint32_t i) const;
-
+
private:
void ParsePath (std::string path, std::string *root, std::string *leaf) const;
typedef std::vector<Ptr<Object> > Roots;
@@ -525,7 +529,7 @@
NS_LOG_FUNCTION (path);
class LookupMatchesResolver : public Resolver
{
- public:
+public:
LookupMatchesResolver (std::string path)
: Resolver (path)
{}
@@ -563,10 +567,10 @@
for (std::vector<Ptr<Object> >::iterator i = m_roots.begin (); i != m_roots.end (); i++)
{
if (*i == obj)
- {
- m_roots.erase (i);
- return;
- }
+ {
+ m_roots.erase (i);
+ return;
+ }
}
}
--- a/src/core/model/config.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/config.h Fri May 13 14:52:27 2011 -0400
@@ -182,7 +182,7 @@
*
* Connect the specified sink to all the objects stored in this
* container.
- * \sa ns3::Config::ConnectWithoutContext
+ * \sa ns3::Config::ConnectWithoutContext
*/
void ConnectWithoutContext (std::string name, const CallbackBase &cb);
/**
--- a/src/core/model/default-simulator-impl.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/default-simulator-impl.cc Fri May 13 14:52:27 2011 -0400
@@ -42,7 +42,7 @@
static TypeId tid = TypeId ("ns3::DefaultSimulatorImpl")
.SetParent<SimulatorImpl> ()
.AddConstructor<DefaultSimulatorImpl> ()
- ;
+ ;
return tid;
}
@@ -62,9 +62,10 @@
}
DefaultSimulatorImpl::~DefaultSimulatorImpl ()
-{}
+{
+}
-void
+void
DefaultSimulatorImpl::DoDispose (void)
{
while (!m_events->IsEmpty ())
@@ -272,7 +273,7 @@
m_destroyEvents.erase (i);
break;
}
- }
+ }
return;
}
if (IsExpired (id))
@@ -318,7 +319,7 @@
{
return false;
}
- }
+ }
return true;
}
if (ev.PeekEventImpl () == 0 ||
--- a/src/core/model/double.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/double.cc Fri May 13 14:52:27 2011 -0400
@@ -38,9 +38,9 @@
virtual bool Check (const AttributeValue &value) const {
const DoubleValue *v = dynamic_cast<const DoubleValue *> (&value);
if (v == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
return v->Get () >= m_minValue && v->Get () <= m_maxValue;
}
virtual std::string GetValueTypeName (void) const {
--- a/src/core/model/enum.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/enum.cc Fri May 13 14:52:27 2011 -0400
@@ -25,16 +25,18 @@
EnumValue::EnumValue ()
: m_v ()
-{}
+{
+}
EnumValue::EnumValue (int v)
: m_v (v)
-{}
-void
+{
+}
+void
EnumValue::Set (int v)
{
m_v = v;
}
-int
+int
EnumValue::Get (void) const
{
return m_v;
@@ -52,11 +54,11 @@
for (EnumChecker::ValueSet::const_iterator i = p->m_valueSet.begin (); i != p->m_valueSet.end (); i++)
{
if (i->first == m_v)
- {
- return i->second;
- }
+ {
+ return i->second;
+ }
}
-
+
NS_FATAL_ERROR ("The user has set an invalid C++ value in this Enum");
// quiet compiler.
return "";
@@ -69,28 +71,29 @@
for (EnumChecker::ValueSet::const_iterator i = p->m_valueSet.begin (); i != p->m_valueSet.end (); i++)
{
if (i->second == value)
- {
- m_v = i->first;
- return true;
- }
+ {
+ m_v = i->first;
+ return true;
+ }
}
return false;
}
EnumChecker::EnumChecker ()
-{}
+{
+}
-void
+void
EnumChecker::AddDefault (int v, std::string name)
{
m_valueSet.push_front (std::make_pair (v, name));
}
-void
+void
EnumChecker::Add (int v, std::string name)
{
m_valueSet.push_back (std::make_pair (v, name));
}
-bool
+bool
EnumChecker::Check (const AttributeValue &value) const
{
const EnumValue *p = dynamic_cast<const EnumValue *> (&value);
@@ -101,9 +104,9 @@
for (ValueSet::const_iterator i = m_valueSet.begin (); i != m_valueSet.end (); i++)
{
if (i->first == p->Get ())
- {
- return true;
- }
+ {
+ return true;
+ }
}
return false;
}
@@ -235,52 +238,52 @@
checker->Add (v12, n12);
if (n13 == "")
{
- return checker;
+ return checker;
}
checker->Add (v13, n13);
if (n14 == "")
- {
- return checker;
- }
+ {
+ return checker;
+ }
checker->Add (v14, n14);
if (n15 == "")
{
- return checker;
+ return checker;
}
checker->Add (v15, n15);
if (n16 == "")
{
- return checker;
+ return checker;
}
checker->Add (v16, n16);
if (n17 == "")
{
- return checker;
+ return checker;
}
checker->Add (v17, n17);
if (n18 == "")
{
- return checker;
+ return checker;
}
checker->Add (v18, n18);
if (n19 == "")
{
- return checker;
+ return checker;
}
checker->Add (v19, n19);
if (n20 == "")
{
- return checker;
+ return checker;
}
checker->Add (v20, n20);
if (n21 == "")
{
- return checker;
+ return checker;
}
checker->Add (v21, n21);
if (n22 == "")
{
- return checker;
+ return checker;
}
checker->Add (v22, n22);
return checker;
--- a/src/core/model/enum.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/enum.h Fri May 13 14:52:27 2011 -0400
@@ -87,17 +87,17 @@
Ptr<const AttributeAccessor> MakeEnumAccessor (T1 a1, T2 a2);
Ptr<const AttributeChecker> MakeEnumChecker (int v1, std::string n1,
- int v2 = 0, std::string n2 = "",
- int v3 = 0, std::string n3 = "",
- int v4 = 0, std::string n4 = "",
- int v5 = 0, std::string n5 = "",
- int v6 = 0, std::string n6 = "",
- int v7 = 0, std::string n7 = "",
- int v8 = 0, std::string n8 = "",
- int v9 = 0, std::string n9 = "",
- int v10 = 0, std::string n10 = "",
- int v11 = 0, std::string n11 = "",
- int v12 = 0, std::string n12 = "",
+ int v2 = 0, std::string n2 = "",
+ int v3 = 0, std::string n3 = "",
+ int v4 = 0, std::string n4 = "",
+ int v5 = 0, std::string n5 = "",
+ int v6 = 0, std::string n6 = "",
+ int v7 = 0, std::string n7 = "",
+ int v8 = 0, std::string n8 = "",
+ int v9 = 0, std::string n9 = "",
+ int v10 = 0, std::string n10 = "",
+ int v11 = 0, std::string n11 = "",
+ int v12 = 0, std::string n12 = "",
int v13 = 0, std::string n13 = "",
int v14 = 0, std::string n14 = "",
int v15 = 0, std::string n15 = "",
--- a/src/core/model/event-id.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/event-id.cc Fri May 13 14:52:27 2011 -0400
@@ -28,25 +28,27 @@
m_ts (0),
m_context (0),
m_uid (0)
-{}
-
+{
+}
+
EventId::EventId (const Ptr<EventImpl> &impl, uint64_t ts, uint32_t context, uint32_t uid)
: m_eventImpl (impl),
m_ts (ts),
m_context (context),
m_uid (uid)
-{}
-void
+{
+}
+void
EventId::Cancel (void)
{
Simulator::Cancel (*this);
}
-bool
+bool
EventId::IsExpired (void) const
{
return Simulator::IsExpired (*this);
}
-bool
+bool
EventId::IsRunning (void) const
{
return !IsExpired ();
--- a/src/core/model/event-impl.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/event-impl.cc Fri May 13 14:52:27 2011 -0400
@@ -23,28 +23,30 @@
namespace ns3 {
EventImpl::~EventImpl ()
-{}
+{
+}
EventImpl::EventImpl ()
: m_cancel (false)
-{}
+{
+}
-void
+void
EventImpl::Invoke (void)
{
- if (!m_cancel)
+ if (!m_cancel)
{
Notify ();
}
}
-void
+void
EventImpl::Cancel (void)
{
m_cancel = true;
}
-bool
+bool
EventImpl::IsCancelled (void)
{
return m_cancel;
--- a/src/core/model/fatal-error.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/fatal-error.h Fri May 13 14:52:27 2011 -0400
@@ -45,7 +45,7 @@
do \
{ \
std::cerr << "file=" << __FILE__ << ", line=" << \
- __LINE__ << std::endl; \
+ __LINE__ << std::endl; \
::ns3::FatalImpl::FlushStreams (); \
std::terminate (); \
} \
--- a/src/core/model/fatal-impl.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/fatal-impl.cc Fri May 13 14:52:27 2011 -0400
@@ -45,29 +45,29 @@
/* File-scope */
namespace {
- std::list<std::ostream*> **PeekStreamList (void)
- {
- static std::list<std::ostream*> *streams = 0;
- return &streams;
- }
- std::list<std::ostream*> *GetStreamList (void)
+std::list<std::ostream*> **PeekStreamList (void)
+{
+ static std::list<std::ostream*> *streams = 0;
+ return &streams;
+}
+std::list<std::ostream*> *GetStreamList (void)
+{
+ std::list<std::ostream*> **pstreams = PeekStreamList ();
+ if (*pstreams == 0)
+ {
+ *pstreams = new std::list<std::ostream*> ();
+ }
+ return *pstreams;
+}
+struct destructor
+{
+ ~destructor ()
{
std::list<std::ostream*> **pstreams = PeekStreamList ();
- if (*pstreams == 0)
- {
- *pstreams = new std::list<std::ostream*> ();
- }
- return *pstreams;
+ delete *pstreams;
+ *pstreams = 0;
}
- struct destructor
- {
- ~destructor ()
- {
- std::list<std::ostream*> **pstreams = PeekStreamList ();
- delete *pstreams;
- *pstreams = 0;
- }
- };
+};
}
void
@@ -94,13 +94,13 @@
namespace {
- /* Overrides normal SIGSEGV handler once the
- * HandleTerminate function is run. */
- void sigHandler(int sig)
- {
- FlushStreams ();
- std::abort ();
- }
+/* Overrides normal SIGSEGV handler once the
+ * HandleTerminate function is run. */
+void sigHandler(int sig)
+{
+ FlushStreams ();
+ std::abort ();
+}
}
void
--- a/src/core/model/global-value.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/global-value.cc Fri May 13 14:52:27 2011 -0400
@@ -31,8 +31,8 @@
namespace ns3 {
GlobalValue::GlobalValue (std::string name, std::string help,
- const AttributeValue &initialValue,
- Ptr<const AttributeChecker> checker)
+ const AttributeValue &initialValue,
+ Ptr<const AttributeChecker> checker)
: m_name (name),
m_help (help),
m_initialValue (initialValue.Copy ()),
@@ -107,7 +107,7 @@
{
return m_checker;
}
-
+
bool
GlobalValue::SetValue (const AttributeValue &value)
{
@@ -144,13 +144,13 @@
for (Iterator i = Begin (); i != End (); i++)
{
if ((*i)->GetName () == name)
- {
- if (!(*i)->SetValue (value))
- {
- NS_FATAL_ERROR ("Invalid new value for global value: "<<name);
- }
- return;
- }
+ {
+ if (!(*i)->SetValue (value))
+ {
+ NS_FATAL_ERROR ("Invalid new value for global value: "<<name);
+ }
+ return;
+ }
}
NS_FATAL_ERROR ("Non-existant global value: "<<name);
}
@@ -160,9 +160,9 @@
for (Iterator i = Begin (); i != End (); i++)
{
if ((*i)->GetName () == name)
- {
- return (*i)->SetValue (value);
- }
+ {
+ return (*i)->SetValue (value);
+ }
}
return false;
}
@@ -183,10 +183,10 @@
for (GlobalValue::Iterator gvit = GlobalValue::Begin (); gvit != GlobalValue::End (); ++gvit)
{
if ((*gvit)->GetName () == name)
- {
- (*gvit)->GetValue (value);
- return true;
- }
+ {
+ (*gvit)->GetValue (value);
+ return true;
+ }
}
return false; // not found
}
@@ -194,7 +194,7 @@
void
GlobalValue::GetValueByName (std::string name, AttributeValue &value)
{
- if (! GetValueByNameFailSafe (name, value))
+ if (!GetValueByNameFailSafe (name, value))
{
NS_FATAL_ERROR ("Could not find GlobalValue named \"" << name << "\"");
}
--- a/src/core/model/global-value.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/global-value.h Fri May 13 14:52:27 2011 -0400
@@ -95,7 +95,7 @@
* This method cannot fail. It will crash if the input is not valid.
*/
static void Bind (std::string name, const AttributeValue &value);
-
+
/**
* \param name the name of the global value
* \param value the value to set in the requested global value.
@@ -136,7 +136,7 @@
*
*/
static void GetValueByName (std::string name, AttributeValue &value);
-
+
private:
friend class GlobalValueTestCase;
--- a/src/core/model/heap-scheduler.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/heap-scheduler.cc Fri May 13 14:52:27 2011 -0400
@@ -46,7 +46,7 @@
// we purposedly waste an item at the start of
// the array to make sure the indexes in the
// array start at one.
- Scheduler::Event empty = {0,{0,0}};
+ Scheduler::Event empty = { 0,{ 0,0}};
m_heap.push_back (empty);
}
--- a/src/core/model/int-to-type.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int-to-type.h Fri May 13 14:52:27 2011 -0400
@@ -11,7 +11,7 @@
template <int v>
struct IntToType
{
- enum v_e {value = v};
+ enum v_e { value = v};
};
} // namespace ns3
--- a/src/core/model/int64x64-128.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64-128.cc Fri May 13 14:52:27 2011 -0400
@@ -4,13 +4,13 @@
namespace ns3 {
-#define OUTPUT_SIGN(sa,sb,ua,ub) \
- ({bool negA, negB; \
- negA = sa < 0; \
- negB = sb < 0; \
- ua = negA?-sa:sa; \
- ub = negB?-sb:sb; \
- (negA && !negB) || (!negA && negB);})
+#define OUTPUT_SIGN(sa,sb,ua,ub) \
+ ({ bool negA, negB; \
+ negA = sa < 0; \
+ negB = sb < 0; \
+ ua = negA ? -sa : sa; \
+ ub = negB ? -sb : sb; \
+ (negA && !negB) || (!negA && negB);})
#define MASK_LO ((((int128_t)1)<<64)-1)
@@ -54,7 +54,7 @@
result |= ((hiPart & MASK_LO) << 64) + (midPart & MASK_HI);
// if the high part is not zero, put a warning
NS_ABORT_MSG_IF ((hiPart & MASK_HI) != 0,
- "High precision 128 bits multiplication error: multiplication overflow.");
+ "High precision 128 bits multiplication error: multiplication overflow.");
return result;
}
void
@@ -62,9 +62,9 @@
{
bool negResult;
uint128_t a, b;
- negResult = OUTPUT_SIGN (_v, o._v, a, b);
+ negResult = OUTPUT_SIGN (_v, o._v, a, b);
int128_t result = Divu (a, b);
- result = negResult ? -result:result;
+ result = negResult ? -result : result;
_v = result;
}
@@ -96,10 +96,10 @@
int64x64_t::MulByInvert (const int64x64_t &o)
{
bool negResult = _v < 0;
- uint128_t a = negResult?-_v:_v;
+ uint128_t a = negResult ? -_v : _v;
uint128_t result = UmulByInvert (a, o._v);
- _v = negResult?-result:result;
+ _v = negResult ? -result : result;
}
uint128_t
int64x64_t::UmulByInvert (uint128_t a, uint128_t b)
--- a/src/core/model/int64x64-128.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64-128.h Fri May 13 14:52:27 2011 -0400
@@ -6,7 +6,7 @@
#include <stdint.h>
#include <math.h>
-#if defined(HAVE___UINT128_T) and !defined(HAVE_UINT128_T)
+#if defined(HAVE___UINT128_T)and !defined(HAVE_UINT128_T)
typedef __uint128_t uint128_t;
typedef __int128_t int128_t;
#endif
@@ -25,13 +25,13 @@
inline int64x64_t (double value)
{
bool is_negative = value < 0;
- value = is_negative?-value:value;
+ value = is_negative ? -value : value;
double hi = floor (value);
double lo = (value - hi) * HP128_MAX_64;
_v = (int128_t)hi;
_v <<= 64;
_v += (int128_t)lo;
- _v = is_negative?-_v:_v;
+ _v = is_negative ? -_v : _v;
}
inline int64x64_t (int v)
: _v (v)
@@ -66,24 +66,24 @@
explicit inline int64x64_t (int64_t hi, uint64_t lo)
{
bool is_negative = hi<0;
- _v = is_negative?-hi:hi;
+ _v = is_negative ? -hi : hi;
_v <<= 64;
_v += lo;
- _v = is_negative?-_v:_v;
+ _v = is_negative ? -_v : _v;
}
inline int64x64_t (const int64x64_t &o)
: _v (o._v) {}
inline int64x64_t &operator = (const int64x64_t &o)
- {
- _v = o._v;
- return *this;
- }
+ {
+ _v = o._v;
+ return *this;
+ }
inline double GetDouble (void) const
{
bool is_negative = _v < 0;
- uint128_t value = is_negative ? -_v:_v;
+ uint128_t value = is_negative ? -_v : _v;
uint64_t hi = value >> 64;
uint64_t lo = value;
double flo = lo;
@@ -96,15 +96,15 @@
inline int64_t GetHigh (void) const
{
bool negative = _v < 0;
- int128_t v = negative?-_v:_v;
+ int128_t v = negative ? -_v : _v;
v >>= 64;
int64_t retval = v;
- return negative?-retval:retval;
+ return negative ? -retval : retval;
}
inline uint64_t GetLow (void) const
{
bool negative = _v < 0;
- int128_t v = negative?-_v:_v;
+ int128_t v = negative ? -_v : _v;
int128_t low = v & HP128_MASK_LO;
uint64_t retval = low;
return retval;
--- a/src/core/model/int64x64-cairo.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64-cairo.cc Fri May 13 14:52:27 2011 -0400
@@ -27,14 +27,14 @@
namespace ns3 {
#define OUTPUT_SIGN(sa,sb,ua,ub) \
- ({bool negA, negB; \
- negA = _cairo_int128_negative (sa); \
- negB = _cairo_int128_negative (sb); \
- ua = _cairo_int128_to_uint128 (sa); \
- ub = _cairo_int128_to_uint128 (sb); \
- ua = negA ? _cairo_uint128_negate (ua) : ua; \
- ub = negB ? _cairo_uint128_negate (ub) : ub; \
- (negA && !negB) || (!negA && negB);})
+ ({ bool negA, negB; \
+ negA = _cairo_int128_negative (sa); \
+ negB = _cairo_int128_negative (sb); \
+ ua = _cairo_int128_to_uint128 (sa); \
+ ub = _cairo_int128_to_uint128 (sb); \
+ ua = negA ? _cairo_uint128_negate (ua) : ua; \
+ ub = negB ? _cairo_uint128_negate (ub) : ub; \
+ (negA && !negB) || (!negA && negB);})
void
int64x64_t::Mul (int64x64_t const &o)
@@ -114,10 +114,10 @@
int64x64_t::MulByInvert (const int64x64_t &o)
{
bool negResult = _cairo_int128_negative (_v);
- cairo_uint128_t a = negResult?_cairo_int128_negate(_v):_v;
+ cairo_uint128_t a = negResult ? _cairo_int128_negate(_v) : _v;
cairo_uint128_t result = UmulByInvert (a, o._v);
- _v = negResult?_cairo_int128_negate(result):result;
+ _v = negResult ? _cairo_int128_negate(result) : result;
}
cairo_uint128_t
int64x64_t::UmulByInvert (cairo_uint128_t a, cairo_uint128_t b)
@@ -126,7 +126,7 @@
cairo_uint128_t hi, mid;
hi = _cairo_uint64x64_128_mul (a.hi, b.hi);
mid = _cairo_uint128_add (_cairo_uint64x64_128_mul (a.hi, b.lo),
- _cairo_uint64x64_128_mul (a.lo, b.hi));
+ _cairo_uint64x64_128_mul (a.lo, b.hi));
mid.lo = mid.hi;
mid.hi = 0;
result = _cairo_uint128_add (hi,mid);
@@ -147,7 +147,7 @@
tmp.MulByInvert (result);
if (tmp.GetHigh () != 1)
{
- cairo_uint128_t one = {1, 0};
+ cairo_uint128_t one = { 1, 0};
result._v = _cairo_uint128_add (result._v, one);
}
return result;
--- a/src/core/model/int64x64-cairo.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64-cairo.h Fri May 13 14:52:27 2011 -0400
@@ -26,7 +26,7 @@
#define HPCAIRO_MAX_64 18446744073709551615.0
double fhi = floor (value);
int64_t hi = lround(fhi);
- uint64_t lo = (uint64_t) ((value - fhi) * HPCAIRO_MAX_64);
+ uint64_t lo = (uint64_t)((value - fhi) * HPCAIRO_MAX_64);
_v.hi = hi;
_v.lo = lo;
#undef HPCAIRO_MAX_64
@@ -70,10 +70,10 @@
inline int64x64_t (const int64x64_t &o)
: _v (o._v) {}
inline int64x64_t &operator = (const int64x64_t &o)
- {
- _v = o._v;
- return *this;
- }
+ {
+ _v = o._v;
+ return *this;
+ }
inline double GetDouble (void) const
{
@@ -84,7 +84,7 @@
flo /= HPCAIRO_MAX_64;
double retval = value.hi;
retval += flo;
- retval = is_negative ? -retval: retval;
+ retval = is_negative ? -retval : retval;
return retval;
#undef HPCAIRO_MAX_64
}
@@ -131,7 +131,7 @@
_v.hi = ~_v.hi;
if (++_v.lo == 0)
{
- ++_v.hi;
+ ++_v.hi;
}
}
inline int Compare (const int64x64_t &o) const
@@ -139,8 +139,8 @@
int status;
int64x64_t tmp = *this;
tmp -= o;
- status = (((int64_t)(tmp)._v.hi) < 0)?-1:
- (((tmp)._v.hi == 0 && (tmp)._v.lo == 0))?0:1;
+ status = (((int64_t)(tmp)._v.hi) < 0) ? -1 :
+ (((tmp)._v.hi == 0 && (tmp)._v.lo == 0)) ? 0 : 1;
return status;
}
cairo_int128_t _v;
@@ -153,7 +153,7 @@
inline bool operator != (const int64x64_t &lhs, const int64x64_t &rhs)
{
- return ! (lhs == rhs);
+ return !(lhs == rhs);
}
inline bool operator < (const int64x64_t &lhs, const int64x64_t &rhs)
@@ -246,7 +246,7 @@
inline int64x64_t operator ! (const int64x64_t &lhs)
{
- return (lhs._v.hi == 0 && lhs._v.lo == 0)?int64x64_t (1, 0):int64x64_t ();
+ return (lhs._v.hi == 0 && lhs._v.lo == 0) ? int64x64_t (1, 0) : int64x64_t ();
}
} // namespace ns3
--- a/src/core/model/int64x64-double.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64-double.h Fri May 13 14:52:27 2011 -0400
@@ -27,15 +27,15 @@
inline int64x64_t (unsigned long long int v)
: _v (v) {}
inline int64x64_t (int64_t hi, uint64_t lo)
- : _v (hi) {/* XXX */}
+ : _v (hi) { /* XXX */}
inline int64x64_t (const int64x64_t &o)
: _v (o._v) {}
inline int64x64_t &operator = (const int64x64_t &o)
- {
- _v = o._v;
- return *this;
- }
+ {
+ _v = o._v;
+ return *this;
+ }
inline double GetDouble (void) const
{
--- a/src/core/model/int64x64.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64.cc Fri May 13 14:52:27 2011 -0400
@@ -31,7 +31,7 @@
std::ostream &operator << (std::ostream &os, const int64x64_t &value)
{
int64_t hi = value.GetHigh ();
- os << ((hi<0)?"-":"+") << ((hi<0)?-hi:hi) << ".";
+ os << ((hi<0) ? "-" : "+") << ((hi<0) ? -hi : hi) << ".";
uint64_t low = value.GetLow ();
uint8_t msd = MostSignificantDigit (~((uint64_t)0));
do
@@ -80,13 +80,13 @@
{
next = str.find ("+", cur);
if (next != std::string::npos)
- {
- next++;
- }
+ {
+ next++;
+ }
else
- {
- next = cur;
- }
+ {
+ next = cur;
+ }
negative = false;
}
cur = next;
@@ -103,7 +103,7 @@
hi = ReadDigits (str.substr (cur, str.size ()-cur));
lo = 0;
}
- hi = negative?-hi:hi;
+ hi = negative ? -hi : hi;
value = int64x64_t (hi, lo);
return is;
}
--- a/src/core/model/int64x64.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/int64x64.h Fri May 13 14:52:27 2011 -0400
@@ -15,57 +15,57 @@
namespace ns3 {
-#define INT64X64_OP_ARITH_TYPE(op,type) \
+#define INT64X64_OP_ARITH_TYPE(op,type) \
inline int64x64_t operator op (const int64x64_t &lhs, const type rhs) \
- { \
- int64x64_t tmp = lhs; \
- tmp op##= int64x64_t (rhs); \
- return tmp; \
- } \
+ { \
+ int64x64_t tmp = lhs; \
+ tmp op ##= int64x64_t (rhs); \
+ return tmp; \
+ } \
inline int64x64_t operator op (const type lhs, const int64x64_t &rhs) \
- { \
- int64x64_t tmp = int64x64_t (lhs); \
- tmp op##= rhs; \
- return tmp; \
+ { \
+ int64x64_t tmp = int64x64_t (lhs); \
+ tmp op ##= rhs; \
+ return tmp; \
}
-#define INT64X64_OP_ARITH(op) \
+#define INT64X64_OP_ARITH(op) \
inline int64x64_t operator op (const int64x64_t &lhs, const int64x64_t &rhs) \
- { \
- int64x64_t tmp = lhs; \
- tmp op##= rhs; \
- return tmp; \
- } \
- INT64X64_OP_ARITH_TYPE(op,double) \
- INT64X64_OP_ARITH_TYPE(op,signed char) \
- INT64X64_OP_ARITH_TYPE(op,signed short) \
- INT64X64_OP_ARITH_TYPE(op,signed int) \
- INT64X64_OP_ARITH_TYPE(op,signed long int) \
- INT64X64_OP_ARITH_TYPE(op,signed long long int) \
- INT64X64_OP_ARITH_TYPE(op,unsigned char) \
- INT64X64_OP_ARITH_TYPE(op,unsigned short) \
- INT64X64_OP_ARITH_TYPE(op,unsigned int) \
- INT64X64_OP_ARITH_TYPE(op,unsigned long int) \
- INT64X64_OP_ARITH_TYPE(op,unsigned long long int)
+ { \
+ int64x64_t tmp = lhs; \
+ tmp op ##= rhs; \
+ return tmp; \
+ } \
+ INT64X64_OP_ARITH_TYPE(op,double) \
+ INT64X64_OP_ARITH_TYPE(op,signed char) \
+ INT64X64_OP_ARITH_TYPE(op,signed short) \
+ INT64X64_OP_ARITH_TYPE(op,signed int) \
+ INT64X64_OP_ARITH_TYPE(op,signed long int) \
+ INT64X64_OP_ARITH_TYPE(op,signed long long int) \
+ INT64X64_OP_ARITH_TYPE(op,unsigned char) \
+ INT64X64_OP_ARITH_TYPE(op,unsigned short) \
+ INT64X64_OP_ARITH_TYPE(op,unsigned int) \
+ INT64X64_OP_ARITH_TYPE(op,unsigned long int) \
+ INT64X64_OP_ARITH_TYPE(op,unsigned long long int)
-#define INT64X64_OP_CMP_TYPE(op,type) \
- inline bool operator op (const int64x64_t &lhs, const type &rhs) \
- { \
- return lhs op int64x64_t (rhs); \
- } \
- inline bool operator op (const type &lhs, const int64x64_t &rhs) \
- { \
- return int64x64_t (lhs) op rhs; \
+#define INT64X64_OP_CMP_TYPE(op,type) \
+ inline bool operator op (const int64x64_t &lhs, const type &rhs) \
+ { \
+ return lhs op int64x64_t (rhs); \
+ } \
+ inline bool operator op (const type &lhs, const int64x64_t &rhs) \
+ { \
+ return int64x64_t (lhs) op rhs; \
}
-#define INT64X64_OP_CMP(op) \
- INT64X64_OP_CMP_TYPE(op,double) \
- INT64X64_OP_CMP_TYPE(op,signed int) \
- INT64X64_OP_CMP_TYPE(op,signed long int) \
- INT64X64_OP_CMP_TYPE(op,signed long long int) \
- INT64X64_OP_CMP_TYPE(op,unsigned int) \
- INT64X64_OP_CMP_TYPE(op,unsigned long int) \
- INT64X64_OP_CMP_TYPE(op,unsigned long long int)
+#define INT64X64_OP_CMP(op) \
+ INT64X64_OP_CMP_TYPE(op,double) \
+ INT64X64_OP_CMP_TYPE(op,signed int) \
+ INT64X64_OP_CMP_TYPE(op,signed long int) \
+ INT64X64_OP_CMP_TYPE(op,signed long long int) \
+ INT64X64_OP_CMP_TYPE(op,unsigned int) \
+ INT64X64_OP_CMP_TYPE(op,unsigned long int) \
+ INT64X64_OP_CMP_TYPE(op,unsigned long long int)
INT64X64_OP_ARITH(+)
@@ -84,17 +84,17 @@
inline int64x64_t Abs (const int64x64_t &value)
{
- return (value < 0)?-value:value;
+ return (value < 0) ? -value : value;
}
inline int64x64_t Min (const int64x64_t &a, const int64x64_t &b)
{
- return (a < b)?a:b;
+ return (a < b) ? a : b;
}
inline int64x64_t Max (const int64x64_t &a, const int64x64_t &b)
{
- return (a > b)?a:b;
+ return (a > b) ? a : b;
}
} // namespace ns3
--- a/src/core/model/integer.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/integer.cc Fri May 13 14:52:27 2011 -0400
@@ -39,9 +39,9 @@
virtual bool Check (const AttributeValue &value) const {
const IntegerValue *v = dynamic_cast<const IntegerValue *> (&value);
if (v == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
return v->Get () >= m_minValue && v->Get () <= m_maxValue;
}
virtual std::string GetValueTypeName (void) const {
--- a/src/core/model/log.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/log.cc Fri May 13 14:52:27 2011 -0400
@@ -76,7 +76,7 @@
}
cur = next + 1;
}
-#endif
+#endif
}
@@ -261,11 +261,11 @@
i++)
{
if (i->first.compare (name) == 0)
- {
- i->second->Enable (level);
- break;
- }
- }
+ {
+ i->second->Enable (level);
+ break;
+ }
+ }
}
void
@@ -277,7 +277,7 @@
i++)
{
i->second->Enable (level);
- }
+ }
}
void
@@ -289,11 +289,11 @@
i++)
{
if (i->first.compare (name) == 0)
- {
- i->second->Disable (level);
- break;
- }
- }
+ {
+ i->second->Disable (level);
+ break;
+ }
+ }
}
void
@@ -305,7 +305,7 @@
i++)
{
i->second->Disable (level);
- }
+ }
}
void
@@ -376,6 +376,7 @@
ParameterLogger::ParameterLogger (std::ostream &os)
: m_itemNumber (0),
m_os (os)
-{}
+{
+}
} // namespace ns3
--- a/src/core/model/log.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/log.h Fri May 13 14:52:27 2011 -0400
@@ -123,7 +123,7 @@
* logging components to enable. For example (using bash syntax),
* NS_LOG="OlsrAgent" would enable one component at all log levels.
* NS_LOG="OlsrAgent:Ipv4L3Protocol" would enable two components,
- * at all log levels, etc.
+ * at all log levels, etc.
* NS_LOG="*" will enable all available log components at all levels.
*
* To control more selectively the log levels for each component, use
@@ -156,7 +156,7 @@
ns3::LogTimePrinter printer = ns3::LogGetTimePrinter (); \
if (printer != 0) \
{ \
- (*printer) (std::clog); \
+ (*printer)(std::clog); \
std::clog << " "; \
} \
}
@@ -167,7 +167,7 @@
ns3::LogNodePrinter printer = ns3::LogGetNodePrinter (); \
if (printer != 0) \
{ \
- (*printer) (std::clog); \
+ (*printer)(std::clog); \
std::clog << " "; \
} \
}
@@ -176,7 +176,7 @@
if (g_log.IsEnabled (ns3::LOG_PREFIX_FUNC)) \
{ \
std::clog << g_log.Name () << ":" << \
- __FUNCTION__ << "(): "; \
+ __FUNCTION__ << "(): "; \
} \
#ifndef NS_LOG_APPEND_CONTEXT
@@ -349,8 +349,8 @@
*/
void LogComponentPrintList (void);
-typedef void (*LogTimePrinter) (std::ostream &os);
-typedef void (*LogNodePrinter) (std::ostream &os);
+typedef void (*LogTimePrinter)(std::ostream &os);
+typedef void (*LogNodePrinter)(std::ostream &os);
void LogSetTimePrinter (LogTimePrinter);
LogTimePrinter LogGetTimePrinter(void);
--- a/src/core/model/names.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/names.cc Fri May 13 14:52:27 2011 -0400
@@ -35,7 +35,7 @@
NameNode (NameNode *parent, std::string name, Ptr<Object> object);
NameNode &operator = (const NameNode &rhs);
- ~NameNode ();
+ ~NameNode ();
NameNode *m_parent;
std::string m_name;
@@ -178,7 +178,7 @@
if (offset != 0)
{
//
- // This must be a name that has the "/Names" namespace prefix omitted.
+ // This must be a name that has the "/Names" namespace prefix omitted.
// Do some reasonableness checking on the rest of the name.
//
offset = name.find ("/");
@@ -190,7 +190,7 @@
name = "/Names/" + name;
}
-
+
//
// There must now be a fully qualified path in the string. All fully
// qualified names begin with "/Names". We have to split off the final
@@ -287,7 +287,7 @@
if (offset != 0)
{
//
- // This must be a name that has the "/Names" namespace prefix omitted.
+ // This must be a name that has the "/Names" namespace prefix omitted.
// Do some reasonableness checking on the rest of the name.
//
offset = oldpath.find ("/");
@@ -299,7 +299,7 @@
oldpath = "/Names/" + oldpath;
}
-
+
//
// There must now be a fully qualified path in the oldpath string. All
// fully qualified names begin with "/Names". We have to split off the final
--- a/src/core/model/names.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/names.h Fri May 13 14:52:27 2011 -0400
@@ -456,6 +456,6 @@
}
}
-}//namespace ns3
+} //namespace ns3
#endif /* OBJECT_NAMES_H */
--- a/src/core/model/nstime.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/nstime.h Fri May 13 14:52:27 2011 -0400
@@ -153,15 +153,15 @@
* The unit to use to interpret a number representing time
*/
enum Unit
- {
- S = 0,
- MS = 1,
- US = 2,
- NS = 3,
- PS = 4,
- FS = 5,
- LAST = 6
- };
+ {
+ S = 0,
+ MS = 1,
+ US = 2,
+ NS = 3,
+ PS = 4,
+ FS = 5,
+ LAST = 6
+ };
inline Time &operator = (const Time &o)
{
@@ -252,7 +252,7 @@
inline int Compare (const Time &o) const
{
- return (m_data < o.m_data)?-1:(m_data == o.m_data)?0:1;
+ return (m_data < o.m_data) ? -1 : (m_data == o.m_data) ? 0 : 1;
}
/**
@@ -544,7 +544,7 @@
*/
inline Time Abs (const Time &time)
{
- return Time ((time.m_data < 0)?-time.m_data:time.m_data);
+ return Time ((time.m_data < 0) ? -time.m_data : time.m_data);
}
/**
* \anchor ns3-Time-Max
@@ -555,7 +555,7 @@
*/
inline Time Max (const Time &ta, const Time &tb)
{
- return Time ((ta.m_data < tb.m_data)?tb:ta);
+ return Time ((ta.m_data < tb.m_data) ? tb : ta);
}
/**
* \anchor ns3-Time-Min
@@ -566,7 +566,7 @@
*/
inline Time Min (const Time &ta, const Time &tb)
{
- return Time ((ta.m_data > tb.m_data)?tb:ta);
+ return Time ((ta.m_data > tb.m_data) ? tb : ta);
}
--- a/src/core/model/object-base.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-base.cc Fri May 13 14:52:27 2011 -0400
@@ -49,7 +49,8 @@
}
ObjectBase::~ObjectBase ()
-{}
+{
+}
void
ObjectBase::NotifyConstructionCompleted (void)
@@ -61,106 +62,106 @@
// loop over the inheritance tree back to the Object base class.
TypeId tid = GetInstanceTypeId ();
do {
- // loop over all attributes in object type
- NS_LOG_DEBUG ("construct tid="<<tid.GetName ()<<", params="<<tid.GetAttributeN ());
- for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
- {
- Ptr<const AttributeAccessor> accessor = tid.GetAttributeAccessor (i);
- Ptr<const AttributeValue> initial = tid.GetAttributeInitialValue (i);
- Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i);
- NS_LOG_DEBUG ("try to construct \""<< tid.GetName ()<<"::"<<
- tid.GetAttributeName (i)<<"\"");
- if (!(tid.GetAttributeFlags (i) & TypeId::ATTR_CONSTRUCT))
- {
- continue;
- }
- bool found = false;
- // is this attribute stored in this AttributeList instance ?
- for (AttributeList::Attrs::const_iterator j = attributes.m_attributes.begin ();
- j != attributes.m_attributes.end (); j++)
- {
- if (j->checker == checker)
- {
- // We have a matching attribute value.
- if (DoSet (accessor, checker, *j->value))
- {
- NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
- tid.GetAttributeName (i)<<"\"");
- found = true;
- break;
- }
- }
- }
- if (!found)
- {
- // is this attribute stored in the global instance ?
- for (AttributeList::Attrs::const_iterator j = AttributeList::GetGlobal ()->m_attributes.begin ();
- j != AttributeList::GetGlobal ()->m_attributes.end (); j++)
- {
- if (j->checker == checker)
- {
- // We have a matching attribute value.
- if (DoSet (accessor, checker, *j->value))
- {
- NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
- tid.GetAttributeName (i)<<"\" from global");
- found = true;
- break;
- }
- }
- }
- }
- if (!found)
- {
- // No matching attribute value so we try to look at the env var.
+ // loop over all attributes in object type
+ NS_LOG_DEBUG ("construct tid="<<tid.GetName ()<<", params="<<tid.GetAttributeN ());
+ for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
+ {
+ Ptr<const AttributeAccessor> accessor = tid.GetAttributeAccessor (i);
+ Ptr<const AttributeValue> initial = tid.GetAttributeInitialValue (i);
+ Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i);
+ NS_LOG_DEBUG ("try to construct \""<< tid.GetName ()<<"::"<<
+ tid.GetAttributeName (i)<<"\"");
+ if (!(tid.GetAttributeFlags (i) & TypeId::ATTR_CONSTRUCT))
+ {
+ continue;
+ }
+ bool found = false;
+ // is this attribute stored in this AttributeList instance ?
+ for (AttributeList::Attrs::const_iterator j = attributes.m_attributes.begin ();
+ j != attributes.m_attributes.end (); j++)
+ {
+ if (j->checker == checker)
+ {
+ // We have a matching attribute value.
+ if (DoSet (accessor, checker, *j->value))
+ {
+ NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
+ tid.GetAttributeName (i)<<"\"");
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found)
+ {
+ // is this attribute stored in the global instance ?
+ for (AttributeList::Attrs::const_iterator j = AttributeList::GetGlobal ()->m_attributes.begin ();
+ j != AttributeList::GetGlobal ()->m_attributes.end (); j++)
+ {
+ if (j->checker == checker)
+ {
+ // We have a matching attribute value.
+ if (DoSet (accessor, checker, *j->value))
+ {
+ NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
+ tid.GetAttributeName (i)<<"\" from global");
+ found = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!found)
+ {
+ // No matching attribute value so we try to look at the env var.
#ifdef HAVE_GETENV
- char *envVar = getenv ("NS_ATTRIBUTE_DEFAULT");
- if (envVar != 0)
- {
- std::string env = std::string (envVar);
- std::string::size_type cur = 0;
- std::string::size_type next = 0;
- while (next != std::string::npos)
- {
- next = env.find (";", cur);
- std::string tmp = std::string (env, cur, next-cur);
- std::string::size_type equal = tmp.find ("=");
- if (equal != std::string::npos)
- {
- std::string name = tmp.substr (0, equal);
- std::string value = tmp.substr (equal+1, tmp.size () - equal - 1);
- if (name == tid.GetAttributeFullName (i))
- {
- if (DoSet (accessor, checker, StringValue (value)))
- {
- NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
- tid.GetAttributeName (i)<<"\" from env var");
- found = true;
- break;
- }
- }
- }
- cur = next + 1;
- }
- }
+ char *envVar = getenv ("NS_ATTRIBUTE_DEFAULT");
+ if (envVar != 0)
+ {
+ std::string env = std::string (envVar);
+ std::string::size_type cur = 0;
+ std::string::size_type next = 0;
+ while (next != std::string::npos)
+ {
+ next = env.find (";", cur);
+ std::string tmp = std::string (env, cur, next-cur);
+ std::string::size_type equal = tmp.find ("=");
+ if (equal != std::string::npos)
+ {
+ std::string name = tmp.substr (0, equal);
+ std::string value = tmp.substr (equal+1, tmp.size () - equal - 1);
+ if (name == tid.GetAttributeFullName (i))
+ {
+ if (DoSet (accessor, checker, StringValue (value)))
+ {
+ NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
+ tid.GetAttributeName (i)<<"\" from env var");
+ found = true;
+ break;
+ }
+ }
+ }
+ cur = next + 1;
+ }
+ }
#endif /* HAVE_GETENV */
- }
- if (!found)
- {
- // No matching attribute value so we try to set the default value.
- DoSet (accessor, checker, *initial);
- NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
- tid.GetAttributeName (i)<<"\" from initial value.");
- }
- }
- tid = tid.GetParent ();
- } while (tid != ObjectBase::GetTypeId ());
+ }
+ if (!found)
+ {
+ // No matching attribute value so we try to set the default value.
+ DoSet (accessor, checker, *initial);
+ NS_LOG_DEBUG ("construct \""<< tid.GetName ()<<"::"<<
+ tid.GetAttributeName (i)<<"\" from initial value.");
+ }
+ }
+ tid = tid.GetParent ();
+ } while (tid != ObjectBase::GetTypeId ());
NotifyConstructionCompleted ();
}
bool
ObjectBase::DoSet (Ptr<const AttributeAccessor> spec,
- Ptr<const AttributeChecker> checker,
+ Ptr<const AttributeChecker> checker,
const AttributeValue &value)
{
bool ok = checker->Check (value);
--- a/src/core/model/object-base.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-base.h Fri May 13 14:52:27 2011 -0400
@@ -29,13 +29,13 @@
* defines a new GetTypeId method.
*/
#define NS_OBJECT_ENSURE_REGISTERED(type) \
- static struct X##type##RegistrationClass \
+ static struct X## type ## RegistrationClass \
{ \
- X##type##RegistrationClass () { \
+ X ## type ## RegistrationClass () { \
ns3::TypeId tid = type::GetTypeId (); \
tid.GetParent (); \
} \
-} x_##type##RegistrationVariable
+ } x_ ## type ## RegistrationVariable
namespace ns3 {
--- a/src/core/model/object-factory.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-factory.cc Fri May 13 14:52:27 2011 -0400
@@ -23,24 +23,25 @@
namespace ns3 {
ObjectFactory::ObjectFactory ()
-{}
+{
+}
-void
+void
ObjectFactory::SetTypeId (TypeId tid)
{
m_tid = tid;
}
-void
+void
ObjectFactory::SetTypeId (std::string tid)
{
m_tid = TypeId::LookupByName (tid);
}
-void
+void
ObjectFactory::SetTypeId (const char *tid)
{
m_tid = TypeId::LookupByName (tid);
}
-void
+void
ObjectFactory::Set (std::string name, const AttributeValue &value)
{
if (name == "")
--- a/src/core/model/object-factory.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-factory.h Fri May 13 14:52:27 2011 -0400
@@ -47,11 +47,11 @@
void SetTypeId (TypeId tid);
/**
* \param tid the TypeId of the object to instantiate.
- */
+ */
void SetTypeId (const char *tid);
/**
* \param tid the TypeId of the object to instantiate.
- */
+ */
void SetTypeId (std::string tid);
/**
* \param name the name of the attribute to set during object construction
--- a/src/core/model/object-vector.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-vector.cc Fri May 13 14:52:27 2011 -0400
@@ -3,24 +3,25 @@
namespace ns3 {
ObjectVectorValue::ObjectVectorValue ()
-{}
+{
+}
-ObjectVectorValue::Iterator
+ObjectVectorValue::Iterator
ObjectVectorValue::Begin (void) const
{
return m_objects.begin ();
}
-ObjectVectorValue::Iterator
+ObjectVectorValue::Iterator
ObjectVectorValue::End (void) const
{
return m_objects.end ();
}
-uint32_t
+uint32_t
ObjectVectorValue::GetN (void) const
{
return m_objects.size ();
}
-Ptr<Object>
+Ptr<Object>
ObjectVectorValue::Get (uint32_t i) const
{
return m_objects[i];
@@ -39,9 +40,9 @@
{
oss << m_objects[i];
if (i != m_objects.size () - 1)
- {
- oss << " ";
- }
+ {
+ oss << " ";
+ }
}
return oss.str ();
}
--- a/src/core/model/object-vector.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object-vector.h Fri May 13 14:52:27 2011 -0400
@@ -56,13 +56,13 @@
template <typename T, typename U, typename INDEX>
Ptr<const AttributeAccessor>
-MakeObjectVectorAccessor (Ptr<U> (T::*get) (INDEX) const,
- INDEX (T::*getN) (void) const);
+MakeObjectVectorAccessor (Ptr<U> (T::*get)(INDEX) const,
+ INDEX (T::*getN)(void) const);
template <typename T, typename U, typename INDEX>
Ptr<const AttributeAccessor>
-MakeObjectVectorAccessor (INDEX (T::*getN) (void) const,
- Ptr<U> (T::*get) (INDEX) const);
+MakeObjectVectorAccessor (INDEX (T::*getN)(void) const,
+ Ptr<U> (T::*get)(INDEX) const);
class ObjectVectorChecker : public AttributeChecker
{
@@ -106,10 +106,10 @@
ObjectVectorValue *dst = dynamic_cast<ObjectVectorValue *> (&destination);
if (src == 0 || dst == 0)
{
- return false;
+ return false;
}
*dst = *src;
- return true;
+ return true;
}
};
@@ -137,9 +137,9 @@
virtual bool DoGetN (const ObjectBase *object, uint32_t *n) const {
const T *obj = dynamic_cast<const T *> (object);
if (obj == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
*n = (obj->*m_memberVector).size ();
return true;
}
@@ -149,13 +149,13 @@
typename U::const_iterator end = (obj->*m_memberVector).end ();
uint32_t k = 0;
for (typename U::const_iterator j = begin; j != end; j++, k++)
- {
- if (k == i)
- {
- return *j;
- break;
- }
- }
+ {
+ if (k == i)
+ {
+ return *j;
+ break;
+ }
+ }
NS_ASSERT (false);
// quiet compiler.
return 0;
@@ -168,26 +168,26 @@
template <typename T, typename U, typename INDEX>
Ptr<const AttributeAccessor>
-MakeObjectVectorAccessor (Ptr<U> (T::*get) (INDEX) const,
- INDEX (T::*getN) (void) const)
+MakeObjectVectorAccessor (Ptr<U> (T::*get)(INDEX) const,
+ INDEX (T::*getN)(void) const)
{
struct MemberGetters : public ObjectVectorAccessor
{
virtual bool DoGetN (const ObjectBase *object, uint32_t *n) const {
const T *obj = dynamic_cast<const T *> (object);
if (obj == 0)
- {
- return false;
- }
- *n = (obj->*m_getN) ();
+ {
+ return false;
+ }
+ *n = (obj->*m_getN)();
return true;
}
virtual Ptr<Object> DoGet (const ObjectBase *object, uint32_t i) const {
const T *obj = static_cast<const T *> (object);
- return (obj->*m_get) (i);
+ return (obj->*m_get)(i);
}
- Ptr<U> (T::*m_get) (INDEX) const;
- INDEX (T::*m_getN) (void) const;
+ Ptr<U> (T::*m_get)(INDEX) const;
+ INDEX (T::*m_getN)(void) const;
} *spec = new MemberGetters ();
spec->m_get = get;
spec->m_getN = getN;
@@ -196,8 +196,8 @@
template <typename T, typename U, typename INDEX>
Ptr<const AttributeAccessor>
-MakeObjectVectorAccessor (INDEX (T::*getN) (void) const,
- Ptr<U> (T::*get) (INDEX) const)
+MakeObjectVectorAccessor (INDEX (T::*getN)(void) const,
+ Ptr<U> (T::*get)(INDEX) const)
{
return MakeObjectVectorAccessor (get, getN);
}
--- a/src/core/model/object.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object.cc Fri May 13 14:52:27 2011 -0400
@@ -43,14 +43,15 @@
Object::AggregateIterator::AggregateIterator ()
: m_object (0),
m_current (0)
-{}
+{
+}
-bool
+bool
Object::AggregateIterator::HasNext (void) const
{
return m_current < m_object->m_aggregates->n;
}
-Ptr<const Object>
+Ptr<const Object>
Object::AggregateIterator::Next (void)
{
Object *object = m_object->m_aggregates->buffer[m_current];
@@ -60,21 +61,22 @@
Object::AggregateIterator::AggregateIterator (Ptr<const Object> object)
: m_object (object),
m_current (0)
-{}
+{
+}
-TypeId
+TypeId
Object::GetInstanceTypeId (void) const
{
return m_tid;
}
-TypeId
+TypeId
Object::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Object")
.SetParent<ObjectBase> ()
- ;
+ ;
return tid;
}
@@ -83,7 +85,7 @@
: m_tid (Object::GetTypeId ()),
m_disposed (false),
m_started (false),
- m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
+ m_aggregates ((struct Aggregates *) malloc (sizeof (struct Aggregates))),
m_getObjectCount (0)
{
m_aggregates->n = 1;
@@ -116,7 +118,7 @@
: m_tid (o.m_tid),
m_disposed (false),
m_started (false),
- m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
+ m_aggregates ((struct Aggregates *) malloc (sizeof (struct Aggregates))),
m_getObjectCount (0)
{
m_aggregates->n = 1;
@@ -172,7 +174,7 @@
* object at the end of the array. To be safe, we restart iteration over the
* array whenever we call some user code, just in case.
*/
- restart:
+restart:
uint32_t n = m_aggregates->n;
for (uint32_t i = 0; i < n; i++)
{
@@ -196,7 +198,7 @@
* So, to be safe, we restart the iteration over the array whenever we call some
* user code.
*/
- restart:
+restart:
uint32_t n = m_aggregates->n;
for (uint32_t i = 0; i < n; i++)
{
--- a/src/core/model/object.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/object.h Fri May 13 14:52:27 2011 -0400
@@ -76,7 +76,7 @@
*/
class AggregateIterator
{
- public:
+public:
AggregateIterator ();
/**
@@ -89,7 +89,7 @@
* \returns the next aggregated object.
*/
Ptr<const Object> Next (void);
- private:
+private:
friend class Object;
AggregateIterator (Ptr<const Object> object);
Ptr<const Object> m_object;
@@ -123,7 +123,7 @@
*
* Note that you can call Dispose many times on the same object or
* different objects aggregated together, and DoDispose will be
- * called only once for each aggregated object.
+ * called only once for each aggregated object.
*
* This method is typically used to break reference cycles.
*/
@@ -164,13 +164,13 @@
void Start (void);
protected:
- /**
- * This method is invoked whenever two sets of objects are aggregated together.
- * It is invoked exactly once for each object in both sets.
- * This method can be overriden by subclasses who wish to be notified of aggregation
- * events. These subclasses must chain up to their base class NotifyNewAggregate method.
- * It is safe to call GetObject and AggregateObject from within this method.
- */
+ /**
+ * This method is invoked whenever two sets of objects are aggregated together.
+ * It is invoked exactly once for each object in both sets.
+ * This method can be overriden by subclasses who wish to be notified of aggregation
+ * events. These subclasses must chain up to their base class NotifyNewAggregate method.
+ * It is safe to call GetObject and AggregateObject from within this method.
+ */
virtual void NotifyNewAggregate (void);
/**
* This method is called only once by Object::Start. If the user
@@ -259,14 +259,14 @@
* keep track of the type of this object instance.
*/
void SetTypeId (TypeId tid);
- /**
- * \param attributes the attribute values used to initialize
- * the member variables of this object's instance.
- *
- * Invoked from ns3::ObjectFactory::Create and ns3::CreateObject only.
- * Initialize all the member variables which were
- * registered with the associated TypeId.
- */
+ /**
+ * \param attributes the attribute values used to initialize
+ * the member variables of this object's instance.
+ *
+ * Invoked from ns3::ObjectFactory::Create and ns3::CreateObject only.
+ * Initialize all the member variables which were
+ * registered with the associated TypeId.
+ */
void Construct (const AttributeList &attributes);
void UpdateSortedArray (struct Aggregates *aggregates, uint32_t i) const;
@@ -359,15 +359,15 @@
template <typename T>
Ptr<T>
CreateObjectWithAttributes (std::string n1 = "", const AttributeValue & v1 = EmptyAttributeValue (),
- std::string n2 = "", const AttributeValue & v2 = EmptyAttributeValue (),
- std::string n3 = "", const AttributeValue & v3 = EmptyAttributeValue (),
- std::string n4 = "", const AttributeValue & v4 = EmptyAttributeValue (),
- std::string n5 = "", const AttributeValue & v5 = EmptyAttributeValue (),
- std::string n6 = "", const AttributeValue & v6 = EmptyAttributeValue (),
- std::string n7 = "", const AttributeValue & v7 = EmptyAttributeValue (),
- std::string n8 = "", const AttributeValue & v8 = EmptyAttributeValue (),
- std::string n9 = "", const AttributeValue & v9 = EmptyAttributeValue ());
-
+ std::string n2 = "", const AttributeValue & v2 = EmptyAttributeValue (),
+ std::string n3 = "", const AttributeValue & v3 = EmptyAttributeValue (),
+ std::string n4 = "", const AttributeValue & v4 = EmptyAttributeValue (),
+ std::string n5 = "", const AttributeValue & v5 = EmptyAttributeValue (),
+ std::string n6 = "", const AttributeValue & v6 = EmptyAttributeValue (),
+ std::string n7 = "", const AttributeValue & v7 = EmptyAttributeValue (),
+ std::string n8 = "", const AttributeValue & v8 = EmptyAttributeValue (),
+ std::string n9 = "", const AttributeValue & v9 = EmptyAttributeValue ());
+
} // namespace ns3
@@ -449,20 +449,20 @@
Ptr<T> p = Ptr<T> (new T (), false);
p->SetTypeId (T::GetTypeId ());
p->Object::Construct (attributes);
- return p;
+ return p;
}
template <typename T>
Ptr<T>
-CreateObjectWithAttributes (std::string n1 , const AttributeValue & v1,
- std::string n2 , const AttributeValue & v2,
- std::string n3 , const AttributeValue & v3,
- std::string n4 , const AttributeValue & v4,
- std::string n5 , const AttributeValue & v5,
- std::string n6 , const AttributeValue & v6,
- std::string n7 , const AttributeValue & v7,
- std::string n8 , const AttributeValue & v8,
- std::string n9 , const AttributeValue & v9)
+CreateObjectWithAttributes (std::string n1, const AttributeValue & v1,
+ std::string n2, const AttributeValue & v2,
+ std::string n3, const AttributeValue & v3,
+ std::string n4, const AttributeValue & v4,
+ std::string n5, const AttributeValue & v5,
+ std::string n6, const AttributeValue & v6,
+ std::string n7, const AttributeValue & v7,
+ std::string n8, const AttributeValue & v8,
+ std::string n9, const AttributeValue & v9)
{
AttributeList attributes;
if (n1 == "")
@@ -510,7 +510,7 @@
goto end;
}
attributes.SetWithTid (T::GetTypeId (), n9, v9);
- end:
+end:
return CreateObjectWithAttributes<T> (attributes);
}
--- a/src/core/model/pointer.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/pointer.cc Fri May 13 14:52:27 2011 -0400
@@ -23,30 +23,32 @@
PointerValue::PointerValue ()
: m_value ()
-{}
+{
+}
PointerValue::PointerValue (Ptr<Object> object)
: m_value (object)
-{}
+{
+}
-void
+void
PointerValue::SetObject (Ptr<Object> object)
{
m_value = object;
}
-Ptr<Object>
+Ptr<Object>
PointerValue::GetObject (void) const
{
return m_value;
}
-Ptr<AttributeValue>
+Ptr<AttributeValue>
PointerValue::Copy (void) const
{
return Create<PointerValue> (*this);
}
-std::string
+std::string
PointerValue::SerializeToString (Ptr<const AttributeChecker> checker) const
{
std::ostringstream oss;
--- a/src/core/model/pointer.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/pointer.h Fri May 13 14:52:27 2011 -0400
@@ -87,16 +87,16 @@
const PointerValue *value = dynamic_cast<const PointerValue *> (&val);
if (value == 0)
{
- return false;
+ return false;
}
if (value->GetObject () == 0)
{
- return true;
+ return true;
}
T *ptr = dynamic_cast<T*> (PeekPointer (value->GetObject ()));
if (ptr == 0)
{
- return false;
+ return false;
}
return true;
}
--- a/src/core/model/ptr.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/ptr.h Fri May 13 14:52:27 2011 -0400
@@ -61,7 +61,7 @@
private:
T *m_ptr;
class Tester {
- private:
+private:
void operator delete (void *);
};
friend class Ptr<const T>;
@@ -86,12 +86,12 @@
* same, so that object is deleted if no more references to it
* remain.
*/
- Ptr (T *ptr);
+ Ptr (T *ptr);
/**
* \param ptr raw pointer to manage
* \param ref if set to true, this method calls Ref, otherwise,
* it does not call Ref.
- *
+ *
* Create a smart pointer which points to the object pointed to by
* the input raw pointer ptr.
*/
@@ -223,9 +223,9 @@
namespace ns3 {
- /*************************************************
- * friend non-member function implementations
- ************************************************/
+/*************************************************
+ * friend non-member function implementations
+ ************************************************/
template <typename T>
Ptr<T> Create (void)
@@ -408,23 +408,24 @@
if (m_ptr != 0)
{
m_ptr->Ref ();
- }
+ }
}
template <typename T>
Ptr<T>::Ptr ()
: m_ptr (0)
-{}
+{
+}
template <typename T>
-Ptr<T>::Ptr (T *ptr)
+Ptr<T>::Ptr (T *ptr)
: m_ptr (ptr)
{
Acquire ();
}
template <typename T>
-Ptr<T>::Ptr (T *ptr, bool ref)
+Ptr<T>::Ptr (T *ptr, bool ref)
: m_ptr (ptr)
{
if (ref)
--- a/src/core/model/realtime-simulator-impl.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/realtime-simulator-impl.cc Fri May 13 14:52:27 2011 -0400
@@ -58,7 +58,7 @@
TimeValue (Seconds (0.1)),
MakeTimeAccessor (&RealtimeSimulatorImpl::m_hardLimit),
MakeTimeChecker ())
- ;
+ ;
return tid;
}
@@ -86,7 +86,8 @@
}
RealtimeSimulatorImpl::~RealtimeSimulatorImpl ()
-{}
+{
+}
void
RealtimeSimulatorImpl::DoDispose (void)
@@ -155,7 +156,7 @@
NS_LOG_FUNCTION_NOARGS ();
//
// The idea here is to wait until the next event comes due. In the case of
- // a realtime simulation, we want real time to be consumed between events.
+ // a realtime simulation, we want real time to be consumed between events.
// It is the realtime synchronizer that causes real time to be consumed by
// doing some kind of a wait.
//
@@ -205,7 +206,7 @@
// time so we need to be careful about that and not delay in that case.
//
NS_ASSERT_MSG (m_synchronizer->Realtime (),
- "RealtimeSimulatorImpl::ProcessOneEvent (): Synchronizer reports not Realtime ()");
+ "RealtimeSimulatorImpl::ProcessOneEvent (): Synchronizer reports not Realtime ()");
//
// tsNow is set to the normalized current real time. When the simulation was
@@ -234,7 +235,7 @@
{
tsDelay = tsNext - tsNow;
}
-
+
//
// We've figured out how long we need to delay in order to pace the
// simulation time with the real time. We're going to sleep, but need
@@ -274,7 +275,7 @@
// attempting to sleep until its due. If we've slept until the timestamp is due,
// Synchronize returns true and we break out of the sync loop. If an external
// event happens that requires a re-schedule, Synchronize returns false and
- // we re-evaluate our timing by continuing in the loop.
+ // we re-evaluate our timing by continuing in the loop.
//
// It is expected that tsDelay become shorter as external events interrupt our
// waits.
@@ -313,7 +314,7 @@
// mess with us.
//
NS_ASSERT_MSG (m_events->IsEmpty () == false,
- "RealtimeSimulatorImpl::ProcessOneEvent(): event queue is empty");
+ "RealtimeSimulatorImpl::ProcessOneEvent(): event queue is empty");
next = m_events->RemoveNext ();
m_unscheduledEvents--;
@@ -400,7 +401,7 @@
{
NS_LOG_FUNCTION_NOARGS ();
NS_ASSERT_MSG (m_events->IsEmpty () == false,
- "RealtimeSimulatorImpl::NextTs(): event queue is empty");
+ "RealtimeSimulatorImpl::NextTs(): event queue is empty");
Scheduler::Event ev = m_events->PeekNext ();
return ev.key.m_ts;
}
@@ -461,7 +462,7 @@
CriticalSection cs (m_mutex);
NS_ASSERT_MSG (m_events->IsEmpty () == false || m_unscheduledEvents == 0,
- "RealtimeSimulatorImpl::Run(): Empty queue and unprocessed events");
+ "RealtimeSimulatorImpl::Run(): Empty queue and unprocessed events");
}
m_running = false;
@@ -628,7 +629,7 @@
RealtimeSimulatorImpl::ScheduleRealtimeWithContext (uint32_t context, Time const &time, EventImpl *impl)
{
NS_LOG_FUNCTION (context << time << impl);
-
+
{
CriticalSection cs (m_mutex);
@@ -743,7 +744,7 @@
m_destroyEvents.erase (i);
break;
}
- }
+ }
return;
}
if (IsExpired (id))
@@ -759,7 +760,7 @@
event.key.m_ts = id.GetTs ();
event.key.m_context = id.GetContext ();
event.key.m_uid = id.GetUid ();
-
+
m_events->Remove (event);
m_unscheduledEvents--;
event.impl->Cancel ();
@@ -794,7 +795,7 @@
{
return false;
}
- }
+ }
return true;
}
@@ -853,7 +854,7 @@
NS_LOG_FUNCTION_NOARGS ();
return m_synchronizationMode;
}
-
+
void
RealtimeSimulatorImpl::SetHardLimit (Time limit)
{
@@ -867,5 +868,5 @@
NS_LOG_FUNCTION_NOARGS ();
return m_hardLimit;
}
-
+
}; // namespace ns3
--- a/src/core/model/ref-count-base.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/ref-count-base.cc Fri May 13 14:52:27 2011 -0400
@@ -3,6 +3,7 @@
namespace ns3 {
RefCountBase::~RefCountBase ()
-{}
+{
+}
} // namespace ns3
--- a/src/core/model/rng-stream.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/rng-stream.cc Fri May 13 14:52:27 2011 -0400
@@ -42,52 +42,52 @@
// (in matrix form), raised to the powers -1, 1, 2^76, and 2^127, resp.
const double InvA1[3][3] = { // Inverse of A1p0
- { 184888585.0, 0.0, 1945170933.0 },
- { 1.0, 0.0, 0.0 },
- { 0.0, 1.0, 0.0 }
- };
+ { 184888585.0, 0.0, 1945170933.0 },
+ { 1.0, 0.0, 0.0 },
+ { 0.0, 1.0, 0.0 }
+};
const double InvA2[3][3] = { // Inverse of A2p0
- { 0.0, 360363334.0, 4225571728.0 },
- { 1.0, 0.0, 0.0 },
- { 0.0, 1.0, 0.0 }
- };
+ { 0.0, 360363334.0, 4225571728.0 },
+ { 1.0, 0.0, 0.0 },
+ { 0.0, 1.0, 0.0 }
+};
const double A1p0[3][3] = {
- { 0.0, 1.0, 0.0 },
- { 0.0, 0.0, 1.0 },
- { -810728.0, 1403580.0, 0.0 }
- };
+ { 0.0, 1.0, 0.0 },
+ { 0.0, 0.0, 1.0 },
+ { -810728.0, 1403580.0, 0.0 }
+};
const double A2p0[3][3] = {
- { 0.0, 1.0, 0.0 },
- { 0.0, 0.0, 1.0 },
- { -1370589.0, 0.0, 527612.0 }
- };
+ { 0.0, 1.0, 0.0 },
+ { 0.0, 0.0, 1.0 },
+ { -1370589.0, 0.0, 527612.0 }
+};
const double A1p76[3][3] = {
- { 82758667.0, 1871391091.0, 4127413238.0 },
- { 3672831523.0, 69195019.0, 1871391091.0 },
- { 3672091415.0, 3528743235.0, 69195019.0 }
- };
+ { 82758667.0, 1871391091.0, 4127413238.0 },
+ { 3672831523.0, 69195019.0, 1871391091.0 },
+ { 3672091415.0, 3528743235.0, 69195019.0 }
+};
const double A2p76[3][3] = {
- { 1511326704.0, 3759209742.0, 1610795712.0 },
- { 4292754251.0, 1511326704.0, 3889917532.0 },
- { 3859662829.0, 4292754251.0, 3708466080.0 }
- };
+ { 1511326704.0, 3759209742.0, 1610795712.0 },
+ { 4292754251.0, 1511326704.0, 3889917532.0 },
+ { 3859662829.0, 4292754251.0, 3708466080.0 }
+};
const double A1p127[3][3] = {
- { 2427906178.0, 3580155704.0, 949770784.0 },
- { 226153695.0, 1230515664.0, 3580155704.0 },
- { 1988835001.0, 986791581.0, 1230515664.0 }
- };
+ { 2427906178.0, 3580155704.0, 949770784.0 },
+ { 226153695.0, 1230515664.0, 3580155704.0 },
+ { 1988835001.0, 986791581.0, 1230515664.0 }
+};
const double A2p127[3][3] = {
- { 1464411153.0, 277697599.0, 1610723613.0 },
- { 32183930.0, 1464411153.0, 1022607788.0 },
- { 2824425944.0, 32183930.0, 2093834863.0 }
- };
+ { 1464411153.0, 277697599.0, 1610723613.0 },
+ { 32183930.0, 1464411153.0, 1022607788.0 },
+ { 2824425944.0, 32183930.0, 2093834863.0 }
+};
@@ -96,21 +96,21 @@
//
double MultModM (double a, double s, double c, double m)
{
- double v;
- int32_t a1;
+ double v;
+ int32_t a1;
- v = a * s + c;
+ v = a * s + c;
- if (v >= two53 || v <= -two53) {
- a1 = static_cast<int32_t> (a / two17); a -= a1 * two17;
- v = a1 * s;
- a1 = static_cast<int32_t> (v / m); v -= a1 * m;
- v = v * two17 + a * s + c;
+ if (v >= two53 || v <= -two53) {
+ a1 = static_cast<int32_t> (a / two17); a -= a1 * two17;
+ v = a1 * s;
+ a1 = static_cast<int32_t> (v / m); v -= a1 * m;
+ v = v * two17 + a * s + c;
}
- a1 = static_cast<int32_t> (v / m);
- /* in case v < 0)*/
- if ((v -= a1 * m) < 0.0) return v += m; else return v;
+ a1 = static_cast<int32_t> (v / m);
+ /* in case v < 0)*/
+ if ((v -= a1 * m) < 0.0) return v += m;else return v;
}
@@ -121,16 +121,16 @@
void MatVecModM (const double A[3][3], const double s[3], double v[3],
double m)
{
- int i;
- double x[3]; // Necessary if v = s
+ int i;
+ double x[3]; // Necessary if v = s
- for (i = 0; i < 3; ++i) {
- x[i] = MultModM (A[i][0], s[0], 0.0, m);
- x[i] = MultModM (A[i][1], s[1], x[i], m);
- x[i] = MultModM (A[i][2], s[2], x[i], m);
+ for (i = 0; i < 3; ++i) {
+ x[i] = MultModM (A[i][0], s[0], 0.0, m);
+ x[i] = MultModM (A[i][1], s[1], x[i], m);
+ x[i] = MultModM (A[i][2], s[2], x[i], m);
}
- for (i = 0; i < 3; ++i)
- v[i] = x[i];
+ for (i = 0; i < 3; ++i)
+ v[i] = x[i];
}
@@ -141,19 +141,19 @@
void MatMatModM (const double A[3][3], const double B[3][3],
double C[3][3], double m)
{
- int i, j;
- double V[3], W[3][3];
+ int i, j;
+ double V[3], W[3][3];
- for (i = 0; i < 3; ++i) {
- for (j = 0; j < 3; ++j)
- V[j] = B[j][i];
- MatVecModM (A, V, V, m);
- for (j = 0; j < 3; ++j)
- W[j][i] = V[j];
+ for (i = 0; i < 3; ++i) {
+ for (j = 0; j < 3; ++j)
+ V[j] = B[j][i];
+ MatVecModM (A, V, V, m);
+ for (j = 0; j < 3; ++j)
+ W[j][i] = V[j];
}
- for (i = 0; i < 3; ++i)
- for (j = 0; j < 3; ++j)
- C[i][j] = W[i][j];
+ for (i = 0; i < 3; ++i)
+ for (j = 0; j < 3; ++j)
+ C[i][j] = W[i][j];
}
@@ -162,17 +162,17 @@
//
void MatTwoPowModM (const double A[3][3], double B[3][3], double m, int32_t e)
{
- int i, j;
+ int i, j;
- /* initialize: B = A */
- if (A != B) {
+ /* initialize: B = A */
+ if (A != B) {
for (i = 0; i < 3; ++i)
- for (j = 0; j < 3; ++j)
- B[i][j] = A[i][j];
- }
- /* Compute B = A^(2^e) mod m */
- for (i = 0; i < e; i++)
- MatMatModM (B, B, B, m);
+ for (j = 0; j < 3; ++j)
+ B[i][j] = A[i][j];
+ }
+ /* Compute B = A^(2^e) mod m */
+ for (i = 0; i < e; i++)
+ MatMatModM (B, B, B, m);
}
@@ -181,23 +181,23 @@
//
void MatPowModM (const double A[3][3], double B[3][3], double m, int32_t n)
{
- int i, j;
- double W[3][3];
+ int i, j;
+ double W[3][3];
- /* initialize: W = A; B = I */
- for (i = 0; i < 3; ++i)
- for (j = 0; j < 3; ++j) {
- W[i][j] = A[i][j];
- B[i][j] = 0.0;
- }
- for (j = 0; j < 3; ++j)
- B[j][j] = 1.0;
+ /* initialize: W = A; B = I */
+ for (i = 0; i < 3; ++i)
+ for (j = 0; j < 3; ++j) {
+ W[i][j] = A[i][j];
+ B[i][j] = 0.0;
+ }
+ for (j = 0; j < 3; ++j)
+ B[j][j] = 1.0;
- /* Compute B = A^n mod m using the binary decomposition of n */
- while (n > 0) {
- if (n % 2) MatMatModM (W, B, B, m);
- MatMatModM (W, W, W, m);
- n /= 2;
+ /* Compute B = A^n mod m using the binary decomposition of n */
+ while (n > 0) {
+ if (n % 2) MatMatModM (W, B, B, m);
+ MatMatModM (W, W, W, m);
+ n /= 2;
}
}
@@ -214,33 +214,33 @@
} // end of anonymous namespace
-namespace ns3{
+namespace ns3 {
//-------------------------------------------------------------------------
// Generate the next random number.
//
double RngStream::U01 ()
{
- int32_t k;
- double p1, p2, u;
+ int32_t k;
+ double p1, p2, u;
- /* Component 1 */
- p1 = a12 * Cg[1] - a13n * Cg[0];
- k = static_cast<int32_t> (p1 / m1);
- p1 -= k * m1;
- if (p1 < 0.0) p1 += m1;
- Cg[0] = Cg[1]; Cg[1] = Cg[2]; Cg[2] = p1;
+ /* Component 1 */
+ p1 = a12 * Cg[1] - a13n * Cg[0];
+ k = static_cast<int32_t> (p1 / m1);
+ p1 -= k * m1;
+ if (p1 < 0.0) p1 += m1;
+ Cg[0] = Cg[1]; Cg[1] = Cg[2]; Cg[2] = p1;
- /* Component 2 */
- p2 = a21 * Cg[5] - a23n * Cg[3];
- k = static_cast<int32_t> (p2 / m2);
- p2 -= k * m2;
- if (p2 < 0.0) p2 += m2;
- Cg[3] = Cg[4]; Cg[4] = Cg[5]; Cg[5] = p2;
+ /* Component 2 */
+ p2 = a21 * Cg[5] - a23n * Cg[3];
+ k = static_cast<int32_t> (p2 / m2);
+ p2 -= k * m2;
+ if (p2 < 0.0) p2 += m2;
+ Cg[3] = Cg[4]; Cg[4] = Cg[5]; Cg[5] = p2;
- /* Combination */
- u = ((p1 > p2) ? (p1 - p2) * norm : (p1 - p2 + m1) * norm);
+ /* Combination */
+ u = ((p1 > p2) ? (p1 - p2) * norm : (p1 - p2 + m1) * norm);
- return (anti == false) ? u : (1 - u);
+ return (anti == false) ? u : (1 - u);
}
@@ -249,15 +249,15 @@
//
double RngStream::U01d ()
{
- double u;
- u = U01();
- if (anti) {
- // Don't forget that U01() returns 1 - u in the antithetic case
- u += (U01() - 1.0) * fact;
- return (u < 0.0) ? u + 1.0 : u;
+ double u;
+ u = U01();
+ if (anti) {
+ // Don't forget that U01() returns 1 - u in the antithetic case
+ u += (U01() - 1.0) * fact;
+ return (u < 0.0) ? u + 1.0 : u;
} else {
- u += U01() * fact;
- return (u < 1.0) ? u : (u - 1.0);
+ u += U01() * fact;
+ return (u < 1.0) ? u : (u - 1.0);
}
}
@@ -267,38 +267,38 @@
//
bool RngStream::CheckSeed (const uint32_t seed[6])
{
- int i;
+ int i;
- for (i = 0; i < 3; ++i) {
- if (seed[i] >= m1) {
- cerr << "****************************************\n\n"
- << "ERROR: Seed[" << i << "] >= 4294967087, Seed is not set."
- << "\n\n****************************************\n\n";
- return (false);
+ for (i = 0; i < 3; ++i) {
+ if (seed[i] >= m1) {
+ cerr << "****************************************\n\n"
+ << "ERROR: Seed[" << i << "] >= 4294967087, Seed is not set."
+ << "\n\n****************************************\n\n";
+ return (false);
}
}
- for (i = 3; i < 6; ++i) {
- if (seed[i] >= m2) {
- cerr << "Seed[" << i << "] = " << seed[i] << endl;
+ for (i = 3; i < 6; ++i) {
+ if (seed[i] >= m2) {
+ cerr << "Seed[" << i << "] = " << seed[i] << endl;
cerr << "*****************************************\n\n"
<< "ERROR: Seed[" << i << "] >= 4294944443, Seed is not set."
<< "\n\n*****************************************\n\n";
return (false);
}
}
- if (seed[0] == 0 && seed[1] == 0 && seed[2] == 0) {
- cerr << "****************************\n\n"
- << "ERROR: First 3 seeds = 0.\n\n"
- << "****************************\n\n";
- return (false);
+ if (seed[0] == 0 && seed[1] == 0 && seed[2] == 0) {
+ cerr << "****************************\n\n"
+ << "ERROR: First 3 seeds = 0.\n\n"
+ << "****************************\n\n";
+ return (false);
}
- if (seed[3] == 0 && seed[4] == 0 && seed[5] == 0) {
- cerr << "****************************\n\n"
- << "ERROR: Last 3 seeds = 0.\n\n"
- << "****************************\n\n";
- return (false);
+ if (seed[3] == 0 && seed[4] == 0 && seed[5] == 0) {
+ cerr << "****************************\n\n"
+ << "ERROR: Last 3 seeds = 0.\n\n"
+ << "****************************\n\n";
+ return (false);
}
- return true;
+ return true;
}
uint32_t
@@ -340,7 +340,7 @@
RngStream::RngStream ()
{
uint32_t run = EnsureGlobalInitialized ();
-
+
anti = false;
incPrec = false;
// Stream initialization moved to separate method.
@@ -354,12 +354,12 @@
anti = r.anti;
incPrec = r.incPrec;
for (int i = 0; i < 6; ++i) {
- Cg[i] = r.Cg[i];
- Bg[i] = r.Bg[i];
- Ig[i] = r.Ig[i];
- }
+ Cg[i] = r.Cg[i];
+ Bg[i] = r.Bg[i];
+ Ig[i] = r.Ig[i];
+ }
}
-
+
void RngStream::InitializeStream()
{ // Moved from the RngStream constructor above to allow seeding
@@ -373,8 +373,8 @@
will be the seed of the next declared RngStream. */
for (int i = 0; i < 6; ++i) {
- Bg[i] = Cg[i] = Ig[i] = nextSeed[i];
- }
+ Bg[i] = Cg[i] = Ig[i] = nextSeed[i];
+ }
MatVecModM (A1p127, nextSeed, nextSeed, m1);
MatVecModM (A2p127, &nextSeed[3], &nextSeed[3], m2);
@@ -417,10 +417,10 @@
void RngStream::ResetNthSubstream (uint32_t N)
{
if(N==0) return;
- for(uint32_t i=0;i<N;++i) {
- MatVecModM(A1p76, Bg, Bg, m1);
- MatVecModM(A2p76, &Bg[3], &Bg[3], m2);
- }
+ for(uint32_t i=0; i<N; ++i) {
+ MatVecModM(A1p76, Bg, Bg, m1);
+ MatVecModM(A2p76, &Bg[3], &Bg[3], m2);
+ }
for (int i = 0; i < 6; ++i)
Cg[i] = Bg[i];
}
@@ -439,7 +439,7 @@
bool
RngStream::SetPackageSeed (uint32_t seed)
{
- uint32_t seeds[6] = {seed, seed, seed, seed, seed, seed};
+ uint32_t seeds[6] = { seed, seed, seed, seed, seed, seed};
return SetPackageSeed (seeds);
}
void
@@ -468,7 +468,7 @@
bool
RngStream::CheckSeed(uint32_t seed)
{
- uint32_t seeds[6] = {seed, seed, seed, seed, seed, seed};
+ uint32_t seeds[6] = { seed, seed, seed, seed, seed, seed};
return CheckSeed (seeds);
}
@@ -492,53 +492,53 @@
//
void RngStream::AdvanceState (int32_t e, int32_t c)
{
- double B1[3][3], C1[3][3], B2[3][3], C2[3][3];
+ double B1[3][3], C1[3][3], B2[3][3], C2[3][3];
- if (e > 0) {
- MatTwoPowModM (A1p0, B1, m1, e);
- MatTwoPowModM (A2p0, B2, m2, e);
+ if (e > 0) {
+ MatTwoPowModM (A1p0, B1, m1, e);
+ MatTwoPowModM (A2p0, B2, m2, e);
} else if (e < 0) {
- MatTwoPowModM (InvA1, B1, m1, -e);
- MatTwoPowModM (InvA2, B2, m2, -e);
+ MatTwoPowModM (InvA1, B1, m1, -e);
+ MatTwoPowModM (InvA2, B2, m2, -e);
}
- if (c >= 0) {
- MatPowModM (A1p0, C1, m1, c);
- MatPowModM (A2p0, C2, m2, c);
+ if (c >= 0) {
+ MatPowModM (A1p0, C1, m1, c);
+ MatPowModM (A2p0, C2, m2, c);
} else {
- MatPowModM (InvA1, C1, m1, -c);
- MatPowModM (InvA2, C2, m2, -c);
+ MatPowModM (InvA1, C1, m1, -c);
+ MatPowModM (InvA2, C2, m2, -c);
}
- if (e) {
- MatMatModM (B1, C1, C1, m1);
- MatMatModM (B2, C2, C2, m2);
+ if (e) {
+ MatMatModM (B1, C1, C1, m1);
+ MatMatModM (B2, C2, C2, m2);
}
- MatVecModM (C1, Cg, Cg, m1);
- MatVecModM (C2, &Cg[3], &Cg[3], m2);
+ MatVecModM (C1, Cg, Cg, m1);
+ MatVecModM (C2, &Cg[3], &Cg[3], m2);
}
//-------------------------------------------------------------------------
void RngStream::GetState (uint32_t seed[6]) const
{
- for (int i = 0; i < 6; ++i)
- seed[i] = static_cast<uint32_t> (Cg[i]);
+ for (int i = 0; i < 6; ++i)
+ seed[i] = static_cast<uint32_t> (Cg[i]);
}
//-------------------------------------------------------------------------
void RngStream::IncreasedPrecis (bool incp)
{
- incPrec = incp;
+ incPrec = incp;
}
//-------------------------------------------------------------------------
void RngStream::SetAntithetic (bool a)
{
- anti = a;
+ anti = a;
}
@@ -547,10 +547,10 @@
//
double RngStream::RandU01 ()
{
- if (incPrec)
- return U01d();
- else
- return U01();
+ if (incPrec)
+ return U01d();
+ else
+ return U01();
}
@@ -559,7 +559,7 @@
//
int32_t RngStream::RandInt (int32_t low, int32_t high)
{
- return low + static_cast<int32_t> ((high - low + 1) * RandU01 ());
+ return low + static_cast<int32_t> ((high - low + 1) * RandU01 ());
};
} //namespace ns3
--- a/src/core/model/rng-stream.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/rng-stream.h Fri May 13 14:52:27 2011 -0400
@@ -33,7 +33,7 @@
* This class is the combined multiple-recursive random number
* generator called MRG32k3a. The ns3::RandomVariableBase class
* holds a static instance of this class. The details of this
- * class are explained in:
+ * class are explained in:
* http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf
*/
class RngStream {
--- a/src/core/model/simple-ref-count.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/simple-ref-count.h Fri May 13 14:52:27 2011 -0400
@@ -97,7 +97,7 @@
}
/**
- * Get the reference count of the object.
+ * Get the reference count of the object.
* Normally not needed; for language bindings.
*/
inline uint32_t GetReferenceCount (void) const
--- a/src/core/model/simulation-singleton.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/simulation-singleton.h Fri May 13 14:52:27 2011 -0400
@@ -45,7 +45,7 @@
static void DeleteObject (void);
};
-}//namespace ns3
+} //namespace ns3
#include "simulator.h"
--- a/src/core/model/simulator-impl.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/simulator-impl.cc Fri May 13 14:52:27 2011 -0400
@@ -7,7 +7,7 @@
{
static TypeId tid = TypeId ("ns3::SimulatorImpl")
.SetParent<Object> ()
- ;
+ ;
return tid;
}
--- a/src/core/model/simulator.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/simulator.cc Fri May 13 14:52:27 2011 -0400
@@ -42,14 +42,14 @@
namespace ns3 {
GlobalValue g_simTypeImpl = GlobalValue ("SimulatorImplementationType",
- "The object class to use as the simulator implementation",
- StringValue ("ns3::DefaultSimulatorImpl"),
- MakeStringChecker ());
+ "The object class to use as the simulator implementation",
+ StringValue ("ns3::DefaultSimulatorImpl"),
+ MakeStringChecker ());
GlobalValue g_schedTypeImpl = GlobalValue ("SchedulerType",
- "The object class to use as the scheduler implementation",
- TypeIdValue (MapScheduler::GetTypeId ()),
- MakeTypeIdChecker ());
+ "The object class to use as the scheduler implementation",
+ TypeIdValue (MapScheduler::GetTypeId ()),
+ MakeTypeIdChecker ());
static void
TimePrinter (std::ostream &os)
@@ -87,7 +87,7 @@
{
ObjectFactory factory;
StringValue s;
-
+
g_simTypeImpl.GetValue (s);
factory.SetTypeId (s.Get ());
*pimpl = GetPointer (factory.Create<SimulatorImpl> ());
@@ -242,28 +242,28 @@
EventId
-Simulator::Schedule (Time const &time, void (*f) (void))
+Simulator::Schedule (Time const &time, void (*f)(void))
{
NS_LOG_FUNCTION (time << f);
return DoSchedule (time, MakeEvent (f));
}
void
-Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (void))
+Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(void))
{
NS_LOG_FUNCTION (time << context << f);
return ScheduleWithContext (context, time, MakeEvent (f));
}
EventId
-Simulator::ScheduleNow (void (*f) (void))
+Simulator::ScheduleNow (void (*f)(void))
{
NS_LOG_FUNCTION (f);
return DoScheduleNow (MakeEvent (f));
}
EventId
-Simulator::ScheduleDestroy (void (*f) (void))
+Simulator::ScheduleDestroy (void (*f)(void))
{
NS_LOG_FUNCTION (f);
return DoScheduleDestroy (MakeEvent (f));
--- a/src/core/model/simulator.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/simulator.h Fri May 13 14:52:27 2011 -0400
@@ -146,7 +146,7 @@
* parameter
*
* When the event expires (when it becomes due to be run), the
- * input method will be invoked on the input object.
+ * input method will be invoked on the input object.
*
* @param time the relative expiration time of the event.
* @param mem_ptr member method pointer to invoke
@@ -224,7 +224,7 @@
* @param f the function to invoke
* @returns an id for the scheduled event.
*/
- static EventId Schedule (Time const &time, void (*f) (void));
+ static EventId Schedule (Time const &time, void (*f)(void));
/**
* @param time the relative expiration time of the event.
@@ -233,7 +233,7 @@
* @returns an id for the scheduled event.
*/
template <typename U1, typename T1>
- static EventId Schedule (Time const &time, void (*f) (U1), T1 a1);
+ static EventId Schedule (Time const &time, void (*f)(U1), T1 a1);
/**
* @param time the relative expiration time of the event.
@@ -243,7 +243,7 @@
* @returns an id for the scheduled event.
*/
template <typename U1, typename U2, typename T1, typename T2>
- static EventId Schedule (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2);
+ static EventId Schedule (Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
/**
* @param time the relative expiration time of the event.
@@ -254,7 +254,7 @@
* @returns an id for the scheduled event.
*/
template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
- static EventId Schedule (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+ static EventId Schedule (Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
/**
* @param time the relative expiration time of the event.
@@ -267,7 +267,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
- static EventId Schedule (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+ static EventId Schedule (Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
/**
* @param time the relative expiration time of the event.
@@ -281,7 +281,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
- static EventId Schedule (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+ static EventId Schedule (Time const &time, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
/**
* Schedule an event with the given context.
@@ -357,13 +357,13 @@
template <typename MEM, typename OBJ,
typename T1, typename T2, typename T3, typename T4, typename T5>
static void ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj,
- T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+ T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
/**
* @param time the relative expiration time of the event.
* @param context user-specified context parameter
* @param f the function to invoke
*/
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (void));
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(void));
/**
* @param time the relative expiration time of the event.
@@ -372,7 +372,7 @@
* @param a1 the first argument to pass to the function to invoke
*/
template <typename U1, typename T1>
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1), T1 a1);
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1), T1 a1);
/**
* @param time the relative expiration time of the event.
@@ -382,7 +382,7 @@
* @param a2 the second argument to pass to the function to invoke
*/
template <typename U1, typename U2, typename T1, typename T2>
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2), T1 a1, T2 a2);
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2), T1 a1, T2 a2);
/**
* @param time the relative expiration time of the event.
@@ -393,7 +393,7 @@
* @param a3 the third argument to pass to the function to invoke
*/
template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
/**
* @param time the relative expiration time of the event.
@@ -406,7 +406,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
/**
* @param time the relative expiration time of the event.
@@ -420,7 +420,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
- static void ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+ static void ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
/**
* Schedule an event to expire Now. All events scheduled to
@@ -491,7 +491,7 @@
/**
* @param f the function to invoke
*/
- static EventId ScheduleNow (void (*f) (void));
+ static EventId ScheduleNow (void (*f)(void));
/**
* @param f the function to invoke
@@ -499,7 +499,7 @@
*/
template <typename U1,
typename T1>
- static EventId ScheduleNow (void (*f) (U1), T1 a1);
+ static EventId ScheduleNow (void (*f)(U1), T1 a1);
/**
* @param f the function to invoke
@@ -508,7 +508,7 @@
*/
template <typename U1, typename U2,
typename T1, typename T2>
- static EventId ScheduleNow (void (*f) (U1,U2), T1 a1, T2 a2);
+ static EventId ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2);
/**
* @param f the function to invoke
@@ -518,7 +518,7 @@
*/
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
- static EventId ScheduleNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+ static EventId ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
/**
* @param f the function to invoke
@@ -529,7 +529,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
- static EventId ScheduleNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+ static EventId ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
/**
* @param f the function to invoke
@@ -541,7 +541,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
- static EventId ScheduleNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+ static EventId ScheduleNow (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
/**
* Schedule an event to expire at Destroy time. All events
@@ -613,7 +613,7 @@
/**
* @param f the function to invoke
*/
- static EventId ScheduleDestroy (void (*f) (void));
+ static EventId ScheduleDestroy (void (*f)(void));
/**
* @param f the function to invoke
@@ -621,7 +621,7 @@
*/
template <typename U1,
typename T1>
- static EventId ScheduleDestroy (void (*f) (U1), T1 a1);
+ static EventId ScheduleDestroy (void (*f)(U1), T1 a1);
/**
* @param f the function to invoke
@@ -630,7 +630,7 @@
*/
template <typename U1, typename U2,
typename T1, typename T2>
- static EventId ScheduleDestroy (void (*f) (U1,U2), T1 a1, T2 a2);
+ static EventId ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2);
/**
* @param f the function to invoke
@@ -640,7 +640,7 @@
*/
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
- static EventId ScheduleDestroy (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+ static EventId ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3);
/**
* @param f the function to invoke
@@ -651,7 +651,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
- static EventId ScheduleDestroy (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+ static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
/**
* @param f the function to invoke
@@ -663,7 +663,7 @@
*/
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
- static EventId ScheduleDestroy (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+ static EventId ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
/**
* Remove an event from the event list.
@@ -740,7 +740,7 @@
* This method will be typically used by language bindings
* to delegate events to their own subclass of the EventImpl base class.
*/
- static EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
+ static EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
/**
* \param time delay until the event expires
@@ -780,7 +780,7 @@
Simulator ();
~Simulator ();
- static EventId DoSchedule (Time const &time, EventImpl *event);
+ static EventId DoSchedule (Time const &time, EventImpl *event);
static EventId DoScheduleNow (EventImpl *event);
static EventId DoScheduleDestroy (EventImpl *event);
};
@@ -846,35 +846,35 @@
}
template <typename U1, typename T1>
-EventId Simulator::Schedule (Time const &time, void (*f) (U1), T1 a1)
+EventId Simulator::Schedule (Time const &time, void (*f)(U1), T1 a1)
{
return DoSchedule (time, MakeEvent (f, a1));
}
template <typename U1, typename U2,
typename T1, typename T2>
-EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2)
+EventId Simulator::Schedule (Time const &time, void (*f)(U1,U2), T1 a1, T2 a2)
{
return DoSchedule (time, MakeEvent (f, a1, a2));
}
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
-EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+EventId Simulator::Schedule (Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
{
return DoSchedule (time, MakeEvent (f, a1, a2, a3));
}
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
-EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
+EventId Simulator::Schedule (Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
{
return DoSchedule (time, MakeEvent (f, a1, a2, a3, a4));
}
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
-EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+EventId Simulator::Schedule (Time const &time, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
return DoSchedule (time, MakeEvent (f, a1, a2, a3, a4, a5));
}
@@ -920,41 +920,41 @@
template <typename MEM, typename OBJ,
typename T1, typename T2, typename T3, typename T4, typename T5>
void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj,
- T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+ T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
return ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
}
template <typename U1, typename T1>
-void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1), T1 a1)
+void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1), T1 a1)
{
return ScheduleWithContext (context, time, MakeEvent (f, a1));
}
template <typename U1, typename U2,
typename T1, typename T2>
-void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2), T1 a1, T2 a2)
+void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2), T1 a1, T2 a2)
{
return ScheduleWithContext (context, time, MakeEvent (f, a1, a2));
}
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
-void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
{
return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3));
}
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
-void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
+void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
{
return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4));
}
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
-void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4, a5));
}
@@ -1014,7 +1014,7 @@
template <typename U1,
typename T1>
EventId
-Simulator::ScheduleNow (void (*f) (U1), T1 a1)
+Simulator::ScheduleNow (void (*f)(U1), T1 a1)
{
return DoScheduleNow (MakeEvent (f, a1));
}
@@ -1022,7 +1022,7 @@
template <typename U1, typename U2,
typename T1, typename T2>
EventId
-Simulator::ScheduleNow (void (*f) (U1,U2), T1 a1, T2 a2)
+Simulator::ScheduleNow (void (*f)(U1,U2), T1 a1, T2 a2)
{
return DoScheduleNow (MakeEvent (f, a1, a2));
}
@@ -1030,7 +1030,7 @@
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
EventId
-Simulator::ScheduleNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+Simulator::ScheduleNow (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
{
return DoScheduleNow (MakeEvent (f, a1, a2, a3));
}
@@ -1038,7 +1038,7 @@
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
EventId
-Simulator::ScheduleNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
+Simulator::ScheduleNow (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
{
return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4));
}
@@ -1046,7 +1046,7 @@
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
EventId
-Simulator::ScheduleNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+Simulator::ScheduleNow (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
return DoScheduleNow (MakeEvent (f, a1, a2, a3, a4, a5));
}
@@ -1105,7 +1105,7 @@
template <typename U1,
typename T1>
EventId
-Simulator::ScheduleDestroy (void (*f) (U1), T1 a1)
+Simulator::ScheduleDestroy (void (*f)(U1), T1 a1)
{
return DoScheduleDestroy (MakeEvent (f, a1));
}
@@ -1113,7 +1113,7 @@
template <typename U1, typename U2,
typename T1, typename T2>
EventId
-Simulator::ScheduleDestroy (void (*f) (U1,U2), T1 a1, T2 a2)
+Simulator::ScheduleDestroy (void (*f)(U1,U2), T1 a1, T2 a2)
{
return DoScheduleDestroy (MakeEvent (f, a1, a2));
}
@@ -1121,7 +1121,7 @@
template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
EventId
-Simulator::ScheduleDestroy (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+Simulator::ScheduleDestroy (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
{
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3));
}
@@ -1129,7 +1129,7 @@
template <typename U1, typename U2, typename U3, typename U4,
typename T1, typename T2, typename T3, typename T4>
EventId
-Simulator::ScheduleDestroy (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
+Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4)
{
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4));
}
@@ -1137,7 +1137,7 @@
template <typename U1, typename U2, typename U3, typename U4, typename U5,
typename T1, typename T2, typename T3, typename T4, typename T5>
EventId
-Simulator::ScheduleDestroy (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+Simulator::ScheduleDestroy (void (*f)(U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
return DoScheduleDestroy (MakeEvent (f, a1, a2, a3, a4, a5));
}
--- a/src/core/model/synchronizer.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/synchronizer.cc Fri May 13 14:52:27 2011 -0400
@@ -27,7 +27,7 @@
{
static TypeId tid = TypeId ("ns3::Synchronizer")
.SetParent<Object> ()
- ;
+ ;
return tid;
}
@@ -40,32 +40,32 @@
{
}
- bool
+bool
Synchronizer::Realtime (void)
{
return DoRealtime ();
}
- uint64_t
+uint64_t
Synchronizer::GetCurrentRealtime (void)
{
return NanosecondToTimeStep (DoGetCurrentRealtime ());
}
- void
+void
Synchronizer::SetOrigin (uint64_t ts)
{
m_simOriginNano = TimeStepToNanosecond (ts);
DoSetOrigin (m_simOriginNano);
}
- uint64_t
+uint64_t
Synchronizer::GetOrigin (void)
{
return NanosecondToTimeStep (m_simOriginNano);
}
- int64_t
+int64_t
Synchronizer::GetDrift (uint64_t ts)
{
int64_t tDrift = DoGetDrift (TimeStepToNanosecond (ts));
@@ -75,47 +75,47 @@
return -NanosecondToTimeStep (-tDrift);
} else {
return NanosecondToTimeStep (tDrift);
- }
+ }
}
- bool
+bool
Synchronizer::Synchronize (uint64_t tsCurrent, uint64_t tsDelay)
{
return DoSynchronize (TimeStepToNanosecond (tsCurrent),
- TimeStepToNanosecond (tsDelay));
+ TimeStepToNanosecond (tsDelay));
}
- void
+void
Synchronizer::Signal (void)
{
DoSignal ();
}
- void
+void
Synchronizer::SetCondition (bool cond)
{
DoSetCondition (cond);
}
- void
+void
Synchronizer::EventStart (void)
{
DoEventStart ();
}
- uint64_t
+uint64_t
Synchronizer::EventEnd (void)
{
return NanosecondToTimeStep (DoEventEnd ());
}
- uint64_t
+uint64_t
Synchronizer::TimeStepToNanosecond (uint64_t ts)
{
return TimeStep (ts).GetNanoSeconds ();
}
- uint64_t
+uint64_t
Synchronizer::NanosecondToTimeStep (uint64_t ns)
{
return NanoSeconds (ns).GetTimeStep ();
--- a/src/core/model/system-condition.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/system-condition.h Fri May 13 14:52:27 2011 -0400
@@ -85,7 +85,7 @@
void Broadcast (void);
/**
- * Wait, possibly forever, for the condition to be true.
+ * Wait, possibly forever, for the condition to be true.
*/
void Wait (void);
@@ -98,7 +98,7 @@
private:
- SystemConditionPrivate * m_priv;
+ SystemConditionPrivate * m_priv;
};
} //namespace ns3
--- a/src/core/model/system-mutex.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/system-mutex.h Fri May 13 14:52:27 2011 -0400
@@ -64,7 +64,7 @@
void Unlock ();
private:
- SystemMutexPrivate * m_priv;
+ SystemMutexPrivate * m_priv;
};
/**
--- a/src/core/model/system-thread.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/system-thread.h Fri May 13 14:52:27 2011 -0400
@@ -154,7 +154,7 @@
*
* It is often the case that we want a thread to be off doing work until such
* time as its job is done. We then want the thread to exit itself. This
- * method allows a thread to query whether or not it should be running.
+ * method allows a thread to query whether or not it should be running.
* Typically, the worker thread is running in a forever-loop, and will need to
* "break" out of that loop to exit -- thus the name.
*
--- a/src/core/model/test.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/test.cc Fri May 13 14:52:27 2011 -0400
@@ -36,7 +36,7 @@
ReplaceXmlSpecialCharacters (std::string xml)
{
std::string specials = "<>&\"'";
- std::string replacements[] = {"<", ">", "&", "'", """};
+ std::string replacements[] = { "<", ">", "&", "'", """};
std::string result;
std::size_t index, length = xml.length ();
@@ -385,8 +385,8 @@
const double MS_PER_SEC = 1000.;
*m_ofs << " <CaseTime>" << "real " << m_msClock.GetElapsedReal () / MS_PER_SEC
- << " user " << m_msClock.GetElapsedUser () / MS_PER_SEC
- << " system " << m_msClock.GetElapsedSystem () / MS_PER_SEC
+ << " user " << m_msClock.GetElapsedUser () / MS_PER_SEC
+ << " system " << m_msClock.GetElapsedSystem () / MS_PER_SEC
<< "</CaseTime>" << std::endl;
*m_ofs << " </TestCase>" << std::endl;
@@ -604,7 +604,7 @@
TestSuite::DoReportStart (void)
{
m_msClock.Start ();
-
+
if (m_ofs == 0)
{
return;
@@ -637,7 +637,7 @@
TestSuite::DoReportEnd (void)
{
m_msClock.End ();
-
+
if (m_ofs == 0)
{
return;
@@ -649,8 +649,8 @@
const double MS_PER_SEC = 1000.;
*m_ofs << " <SuiteTime>" << "real " << m_msClock.GetElapsedReal () / MS_PER_SEC
- << " user " << m_msClock.GetElapsedUser () / MS_PER_SEC
- << " system " << m_msClock.GetElapsedSystem () / MS_PER_SEC
+ << " user " << m_msClock.GetElapsedUser () / MS_PER_SEC
+ << " system " << m_msClock.GetElapsedSystem () / MS_PER_SEC
<< "</SuiteTime>" << std::endl;
*m_ofs << "</TestSuite>" << std::endl;
--- a/src/core/model/test.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/test.h Fri May 13 14:52:27 2011 -0400
@@ -60,23 +60,23 @@
*/
#define NS_TEST_ASSERT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) == (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) == " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return; \
- } \
- } \
- } while (false)
+ if (!((actual) == (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) == " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -112,23 +112,23 @@
*/
#define NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) == (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) == " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return true; \
- } \
- } \
- } while (false)
+ if (!((actual) == (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) == " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return true; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -170,19 +170,19 @@
*/
#define NS_TEST_EXPECT_MSG_EQ_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) == (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) == " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- } \
- } while (false)
+ if (!((actual) == (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) == " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -223,25 +223,25 @@
*/
#define NS_TEST_ASSERT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \
do { \
- if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit << " +- " << tol; \
- std::ostringstream condStream; \
- condStream << #actual << " (actual) < " << #limit << " (limit) + " << #tol << " (tol) && " << \
- #actual << " (actual) > " << #limit << " (limit) - " << #tol << " (tol)"; \
- ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return; \
- } \
- } \
- } while (false)
+ if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit << " +- " << tol; \
+ std::ostringstream condStream; \
+ condStream << # actual << " (actual) < " << # limit << " (limit) + " << # tol << " (tol) && " << \
+ # actual << " (actual) > " << # limit << " (limit) - " << # tol << " (tol)"; \
+ ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that actual and expected (limit) values are equal to plus or minus
@@ -299,25 +299,25 @@
*/
#define NS_TEST_ASSERT_MSG_EQ_TOL_RETURNS_BOOL_INTERNAL(actual, limit, tol, msg, file, line) \
do { \
- if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit << " +- " << tol; \
- std::ostringstream condStream; \
- condStream << #actual << " (actual) < " << #limit << " (limit) + " << #tol << " (tol) && " << \
- #actual << " (actual) > " << #limit << " (limit) - " << #tol << " (tol)"; \
- ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return true; \
- } \
- } \
- } while (false)
+ if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit << " +- " << tol; \
+ std::ostringstream condStream; \
+ condStream << # actual << " (actual) < " << # limit << " (limit) + " << # tol << " (tol) && " << \
+ # actual << " (actual) > " << # limit << " (limit) - " << # tol << " (tol)"; \
+ ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return true; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that actual and expected (limit) values are equal to plus or minus
@@ -381,21 +381,21 @@
*/
#define NS_TEST_EXPECT_MSG_EQ_TOL_INTERNAL(actual, limit, tol, msg, file, line) \
do { \
- if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit << " +- " << tol; \
- std::ostringstream condStream; \
- condStream << #actual << " (actual) < " << #limit << " (limit) + " << #tol << " (tol) && " << \
- #actual << " (actual) > " << #limit << " (limit) - " << #tol << " (tol)"; \
- ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- } \
- } while (false)
+ if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit << " +- " << tol; \
+ std::ostringstream condStream; \
+ condStream << # actual << " (actual) < " << # limit << " (limit) + " << # tol << " (tol) && " << \
+ # actual << " (actual) > " << # limit << " (limit) - " << # tol << " (tol)"; \
+ ReportTestFailure (condStream.str (), actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ } \
+ } while (false)
/**
* \brief Test that actual and expected (limit) values are equal to plus or minus
@@ -457,23 +457,23 @@
*/
#define NS_TEST_ASSERT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) != (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) != " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return; \
- } \
- } \
- } while (false)
+ if (!((actual) != (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) != " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -508,23 +508,23 @@
*/
#define NS_TEST_ASSERT_MSG_NE_RETURNS_BOOL_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) != (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) != " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return true; \
- } \
- } \
- } while (false)
+ if (!((actual) != (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) != " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return true; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -565,19 +565,19 @@
*/
#define NS_TEST_EXPECT_MSG_NE_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) != (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) != " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- } \
- } while (false)
+ if (!((actual) != (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) != " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ } \
+ } while (false)
/**
* \brief Test that an actual and expected (limit) value are equal and report
@@ -616,23 +616,23 @@
*/
#define NS_TEST_ASSERT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) < (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) < " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return; \
- } \
- } \
- } while (false)
+ if (!((actual) < (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) < " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual value is less than a limit and report and abort
@@ -660,19 +660,19 @@
*/
#define NS_TEST_EXPECT_MSG_LT_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) < (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) < " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- } \
- } while (false)
+ if (!((actual) < (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) < " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ } \
+ } while (false)
/**
* \brief Test that an actual value is less than a limit and report if not.
@@ -700,23 +700,23 @@
*/
#define NS_TEST_ASSERT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) > (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReportTestFailure (std::string (#actual) + " (actual) > " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- if (!ContinueOnFailure ()) \
- { \
- return; \
- } \
- } \
- } while (false)
+ if (!((actual) > (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReportTestFailure (std::string (# actual) + " (actual) > " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ if (!ContinueOnFailure ()) \
+ { \
+ return; \
+ } \
+ } \
+ } while (false)
/**
* \brief Test that an actual value is greater than a limit and report and abort
@@ -744,19 +744,19 @@
*/
#define NS_TEST_EXPECT_MSG_GT_INTERNAL(actual, limit, msg, file, line) \
do { \
- if (!((actual) > (limit))) \
- { \
- if (gBreakOnFailure) {*(int *)0 = 0;} \
- std::ostringstream msgStream; \
- msgStream << msg; \
- std::ostringstream actualStream; \
- actualStream << actual; \
- std::ostringstream limitStream; \
- limitStream << limit; \
- ReporTesttFailure (std::string (#actual) + " (actual) > " + std::string (#limit) + " (limit)", \
- actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
- } \
- } while (false)
+ if (!((actual) > (limit))) \
+ { \
+ if (gBreakOnFailure) { *(int *)0 = 0;} \
+ std::ostringstream msgStream; \
+ msgStream << msg; \
+ std::ostringstream actualStream; \
+ actualStream << actual; \
+ std::ostringstream limitStream; \
+ limitStream << limit; \
+ ReporTesttFailure (std::string (# actual) + " (actual) > " + std::string (# limit) + " (limit)", \
+ actualStream.str (), limitStream.str (), msgStream.str (), file, line); \
+ } \
+ } while (false)
/**
* \brief Test that an actual value is greater than a limit and report if not.
@@ -795,7 +795,7 @@
* \param epsilon The second of double precision floating point numberss to compare
* \returns Returns true if the doubles are equal to a precision defined by epsilon
*/
- bool TestDoubleIsEqual (const double a, const double b, const double epsilon = std::numeric_limits<double>::epsilon ());
+bool TestDoubleIsEqual (const double a, const double b, const double epsilon = std::numeric_limits<double>::epsilon ());
/**
* \brief A single test case.
@@ -843,7 +843,7 @@
/**
* \brief Get the name of this test case.
*/
- std::string GetName (void);
+ std::string GetName (void);
/**
* \brief Set the base directory of the ns-3 distribution.
@@ -962,7 +962,7 @@
* report the details.
*/
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message,
- std::string file, int32_t line);
+ std::string file, int32_t line);
/**
* \brief Issue a test report than the test case has completed its run.
@@ -993,7 +993,7 @@
* \brief Implementation of reporting method for failure of the test case.
*/
virtual void DoReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message,
- std::string file, int32_t line);
+ std::string file, int32_t line);
/**
* \internal
@@ -1133,7 +1133,7 @@
/**
* \brief Get the name of this test suite.
*/
- std::string GetName (void);
+ std::string GetName (void);
/**
* \brief Set the base directory of the ns-3 distribution.
@@ -1275,7 +1275,7 @@
std::ofstream *m_ofs;
bool m_error;
TestType m_type;
-
+
typedef std::vector<TestCase *> TestCaseVector_t;
TestCaseVector_t m_tests;
};
--- a/src/core/model/time.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/time.cc Fri May 13 14:52:27 2011 -0400
@@ -84,7 +84,7 @@
struct Time::Resolution
Time::GetNsResolution (void)
-{
+{
struct Resolution resolution;
SetResolution (Time::NS, &resolution);
return resolution;
@@ -97,7 +97,7 @@
void
Time::SetResolution (enum Unit unit, struct Resolution *resolution)
{
- int8_t power [LAST] = {15, 12, 9, 6, 3, 0};
+ int8_t power [LAST] = { 15, 12, 9, 6, 3, 0};
for (int i = 0; i < Time::LAST; i++)
{
int shift = power[i] - power[(int)unit];
@@ -105,27 +105,27 @@
struct Information *info = &resolution->info[i];
info->factor = factor;
if (shift == 0)
- {
- info->timeFrom = int64x64_t (1);
- info->timeTo = int64x64_t (1);
- info->toMul = true;
- info->fromMul = true;
- }
+ {
+ info->timeFrom = int64x64_t (1);
+ info->timeTo = int64x64_t (1);
+ info->toMul = true;
+ info->fromMul = true;
+ }
else if (shift > 0)
- {
- info->timeFrom = int64x64_t (factor);
- info->timeTo = int64x64_t::Invert (factor);
- info->toMul = false;
- info->fromMul = true;
- }
+ {
+ info->timeFrom = int64x64_t (factor);
+ info->timeTo = int64x64_t::Invert (factor);
+ info->toMul = false;
+ info->fromMul = true;
+ }
else
- {
- NS_ASSERT (shift < 0);
- info->timeFrom = int64x64_t::Invert (factor);
- info->timeTo = int64x64_t (factor);
- info->toMul = true;
- info->fromMul = false;
- }
+ {
+ NS_ASSERT (shift < 0);
+ info->timeFrom = int64x64_t::Invert (factor);
+ info->timeTo = int64x64_t (factor);
+ info->toMul = true;
+ info->fromMul = false;
+ }
}
resolution->unit = unit;
}
--- a/src/core/model/trace-source-accessor.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/trace-source-accessor.cc Fri May 13 14:52:27 2011 -0400
@@ -22,8 +22,10 @@
namespace ns3 {
TraceSourceAccessor::TraceSourceAccessor ()
-{}
+{
+}
TraceSourceAccessor::~TraceSourceAccessor ()
-{}
+{
+}
} // namespace ns3
--- a/src/core/model/trace-source-accessor.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/trace-source-accessor.h Fri May 13 14:52:27 2011 -0400
@@ -92,38 +92,38 @@
virtual bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const {
T *p = dynamic_cast<T*> (obj);
if (p == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
(p->*m_source).ConnectWithoutContext (cb);
return true;
}
virtual bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
T *p = dynamic_cast<T*> (obj);
if (p == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
(p->*m_source).Connect (cb, context);
return true;
}
virtual bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const {
T *p = dynamic_cast<T*> (obj);
if (p == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
(p->*m_source).DisconnectWithoutContext (cb);
- return true;
+ return true;
}
virtual bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
T *p = dynamic_cast<T*> (obj);
if (p == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
(p->*m_source).Disconnect (cb, context);
- return true;
+ return true;
}
SOURCE T::*m_source;
} *accessor = new Accessor ();
--- a/src/core/model/traced-callback.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/traced-callback.h Fri May 13 14:52:27 2011 -0400
@@ -88,7 +88,7 @@
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) const;
void operator() (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8) const;
-private:
+private:
typedef std::list<Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> > CallbackList;
CallbackList m_callbackList;
};
@@ -105,23 +105,24 @@
typename T7, typename T8>
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::TracedCallback ()
: m_callbackList ()
-{}
-template<typename T1, typename T2,
+{
+}
+template<typename T1, typename T2,
typename T3, typename T4,
typename T5, typename T6,
typename T7, typename T8>
-void
+void
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext (const CallbackBase & callback)
{
Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> cb;
cb.Assign (callback);
m_callbackList.push_back (cb);
}
-template<typename T1, typename T2,
+template<typename T1, typename T2,
typename T3, typename T4,
typename T5, typename T6,
typename T7, typename T8>
-void
+void
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackBase & callback, std::string path)
{
Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
@@ -140,13 +141,13 @@
i != m_callbackList.end (); /* empty */)
{
if ((*i).IsEqual (callback))
- {
- i = m_callbackList.erase (i);
- }
+ {
+ i = m_callbackList.erase (i);
+ }
else
- {
- i++;
- }
+ {
+ i++;
+ }
}
}
template<typename T1, typename T2,
@@ -171,7 +172,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) ();
+ (*i)();
}
}
template<typename T1, typename T2,
@@ -184,7 +185,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1);
+ (*i)(a1);
}
}
template<typename T1, typename T2,
@@ -197,7 +198,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2);
+ (*i)(a1, a2);
}
}
template<typename T1, typename T2,
@@ -210,7 +211,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3);
+ (*i)(a1, a2, a3);
}
}
template<typename T1, typename T2,
@@ -223,7 +224,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3, a4);
+ (*i)(a1, a2, a3, a4);
}
}
template<typename T1, typename T2,
@@ -236,7 +237,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3, a4, a5);
+ (*i)(a1, a2, a3, a4, a5);
}
}
template<typename T1, typename T2,
@@ -249,7 +250,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3, a4, a5, a6);
+ (*i)(a1, a2, a3, a4, a5, a6);
}
}
template<typename T1, typename T2,
@@ -262,7 +263,7 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3, a4, a5, a6, a7);
+ (*i)(a1, a2, a3, a4, a5, a6, a7);
}
}
template<typename T1, typename T2,
@@ -275,10 +276,10 @@
for (typename CallbackList::const_iterator i = m_callbackList.begin ();
i != m_callbackList.end (); i++)
{
- (*i) (a1, a2, a3, a4, a5, a6, a7, a8);
+ (*i)(a1, a2, a3, a4, a5, a6, a7, a8);
}
}
-}//namespace ns3
+} //namespace ns3
#endif /* TRACED_CALLBACK_H */
--- a/src/core/model/traced-value.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/traced-value.h Fri May 13 14:52:27 2011 -0400
@@ -90,8 +90,8 @@
void Set (const T &v) {
if (m_v != v)
{
- m_cb (m_v, v);
- m_v = v;
+ m_cb (m_v, v);
+ m_v = v;
}
}
T Get (void) const {
--- a/src/core/model/type-id.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/type-id.cc Fri May 13 14:52:27 2011 -0400
@@ -105,9 +105,10 @@
};
IidManager::IidManager ()
-{}
+{
+}
-uint16_t
+uint16_t
IidManager::AllocateUid (std::string name)
{
uint16_t j = 1;
@@ -433,8 +434,9 @@
TypeId::TypeId (uint16_t tid)
: m_tid (tid)
-{}
-TypeId
+{
+}
+TypeId
TypeId::LookupByName (std::string name)
{
uint16_t uid = Singleton<IidManager>::Get ()->GetUid (name);
@@ -488,21 +490,21 @@
TypeId tid;
TypeId nextTid = *this;
do {
- tid = nextTid;
- for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
- {
- std::string paramName = tid.GetAttributeName (i);
- if (paramName == name)
- {
- info->accessor = tid.GetAttributeAccessor (i);
- info->flags = tid.GetAttributeFlags (i);
- info->initialValue = tid.GetAttributeInitialValue (i);
- info->checker = tid.GetAttributeChecker (i);
- return true;
- }
- }
- nextTid = tid.GetParent ();
- } while (nextTid != tid);
+ tid = nextTid;
+ for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
+ {
+ std::string paramName = tid.GetAttributeName (i);
+ if (paramName == name)
+ {
+ info->accessor = tid.GetAttributeAccessor (i);
+ info->flags = tid.GetAttributeFlags (i);
+ info->initialValue = tid.GetAttributeInitialValue (i);
+ info->checker = tid.GetAttributeChecker (i);
+ return true;
+ }
+ }
+ nextTid = tid.GetParent ();
+ } while (nextTid != tid);
return false;
}
@@ -699,17 +701,17 @@
TypeId tid;
TypeId nextTid = *this;
do {
- tid = nextTid;
- for (uint32_t i = 0; i < tid.GetTraceSourceN (); i++)
- {
- std::string srcName = tid.GetTraceSourceName (i);
- if (srcName == name)
- {
- return tid.GetTraceSourceAccessor (i);
- }
- }
- nextTid = tid.GetParent ();
- } while (nextTid != tid);
+ tid = nextTid;
+ for (uint32_t i = 0; i < tid.GetTraceSourceN (); i++)
+ {
+ std::string srcName = tid.GetTraceSourceName (i);
+ if (srcName == name)
+ {
+ return tid.GetTraceSourceAccessor (i);
+ }
+ }
+ nextTid = tid.GetParent ();
+ } while (nextTid != tid);
return 0;
}
--- a/src/core/model/type-id.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/type-id.h Fri May 13 14:52:27 2011 -0400
@@ -365,7 +365,7 @@
explicit TypeId (uint16_t tid);
void DoAddConstructor (Callback<ObjectBase *> callback);
-
+
uint16_t m_tid;
};
@@ -388,16 +388,19 @@
namespace ns3 {
TypeId::TypeId ()
- : m_tid (0) {}
+ : m_tid (0) {
+}
TypeId::TypeId (const TypeId &o)
- : m_tid (o.m_tid) {}
+ : m_tid (o.m_tid) {
+}
TypeId &TypeId::operator = (const TypeId &o)
{
m_tid = o.m_tid;
return *this;
}
TypeId::~TypeId ()
-{}
+{
+}
inline bool operator == (TypeId a, TypeId b)
{
return a.m_tid == b.m_tid;
--- a/src/core/model/type-name.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/type-name.cc Fri May 13 14:52:27 2011 -0400
@@ -4,13 +4,13 @@
namespace ns3 {
-#define DEF_TYPE(x) \
- template <> \
- std::string TypeNameGet<x> (void) \
- { \
- return #x; \
+#define DEF_TYPE(x) \
+ template <> \
+ std::string TypeNameGet<x> (void) \
+ { \
+ return # x; \
}
-
+
DEF_TYPE (uint8_t);
DEF_TYPE (uint16_t);
DEF_TYPE (uint32_t);
@@ -23,4 +23,4 @@
DEF_TYPE (double);
-}//namespace ns3
+} //namespace ns3
--- a/src/core/model/type-name.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/type-name.h Fri May 13 14:52:27 2011 -0400
@@ -14,10 +14,10 @@
return "unknown";
}
-#define DEF_TYPE(x) \
- template <> \
- std::string TypeNameGet<x> (void)
-
+#define DEF_TYPE(x) \
+ template <> \
+ std::string TypeNameGet<x> (void)
+
DEF_TYPE (uint8_t);
DEF_TYPE (uint16_t);
DEF_TYPE (uint32_t);
@@ -31,6 +31,6 @@
#undef DEF_TYPE
-}//namespace ns3
+} //namespace ns3
#endif /* TYPE_NAME_H */
--- a/src/core/model/type-traits.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/type-traits.h Fri May 13 14:52:27 2011 -0400
@@ -16,48 +16,48 @@
};
template <typename U> struct ReferenceTraits
{
- enum {IsReference = 0};
+ enum { IsReference = 0};
typedef U ReferencedType;
};
template <typename U> struct ReferenceTraits<U&>
{
- enum {IsReference = 1};
+ enum { IsReference = 1};
typedef U ReferencedType;
};
template <typename U> struct PointerTraits
{
- enum {IsPointer = 0};
+ enum { IsPointer = 0};
typedef U PointeeType;
};
template <typename U> struct PointerTraits<U *>
{
- enum {IsPointer = 1};
+ enum { IsPointer = 1};
typedef U PointeeType;
};
template <typename U> struct FunctionPtrTraits
{
- enum {IsFunctionPointer = 0};
+ enum { IsFunctionPointer = 0};
};
template <typename U>
struct FunctionPtrTraits <U (*) (void)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 0};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V1>
struct FunctionPtrTraits <U (*) (V1)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 1};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 1};
typedef U ReturnType;
typedef V1 Arg1Type;
};
template <typename U, typename V1, typename V2>
struct FunctionPtrTraits <U (*) (V1,V2)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 2};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 2};
typedef U ReturnType;
typedef V1 Arg1Type;
typedef V2 Arg2Type;
@@ -66,8 +66,8 @@
typename V3>
struct FunctionPtrTraits <U (*) (V1,V2,V3)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 3};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 3};
typedef U ReturnType;
typedef V1 Arg1Type;
typedef V2 Arg2Type;
@@ -77,8 +77,8 @@
typename V3, typename V4>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 4};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 4};
typedef U ReturnType;
typedef V1 Arg1Type;
typedef V2 Arg2Type;
@@ -90,8 +90,8 @@
typename V5>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4,V5)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 5};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 5};
typedef U ReturnType;
typedef V1 Arg1Type;
typedef V2 Arg2Type;
@@ -104,8 +104,8 @@
typename V5, typename V6>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4,V5,V6)>
{
- enum {IsFunctionPointer = 1};
- enum {nArgs = 6};
+ enum { IsFunctionPointer = 1};
+ enum { nArgs = 6};
typedef U ReturnType;
typedef V1 Arg1Type;
typedef V2 Arg2Type;
@@ -116,52 +116,52 @@
};
template <typename U> struct PtrToMemberTraits
{
- enum {IsPointerToMember = 0};
+ enum { IsPointerToMember = 0};
};
template <typename U, typename V>
- struct PtrToMemberTraits <U (V::*) (void)>
+ struct PtrToMemberTraits <U (V::*)(void)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 0};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V>
- struct PtrToMemberTraits <U (V::*) (void) const>
+ struct PtrToMemberTraits <U (V::*)(void) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 0};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V,typename W1>
- struct PtrToMemberTraits <U (V::*) (W1)>
+ struct PtrToMemberTraits <U (V::*)(W1)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 1};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 1};
typedef U ReturnType;
typedef W1 Arg1Type;
};
template <typename U, typename V,typename W1>
- struct PtrToMemberTraits <U (V::*) (W1) const>
+ struct PtrToMemberTraits <U (V::*)(W1) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 1};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 1};
typedef U ReturnType;
typedef W1 Arg1Type;
};
template <typename U, typename V,typename W1, typename W2>
- struct PtrToMemberTraits <U (V::*) (W1,W2)>
+ struct PtrToMemberTraits <U (V::*)(W1,W2)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 2};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 2};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
};
template <typename U, typename V,typename W1, typename W2>
- struct PtrToMemberTraits <U (V::*) (W1,W2) const>
+ struct PtrToMemberTraits <U (V::*)(W1,W2) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 2};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 2};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -169,10 +169,10 @@
template <typename U, typename V,
typename W1, typename W2,
typename W3>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3)>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 3};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 3};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -181,10 +181,10 @@
template <typename U, typename V,
typename W1, typename W2,
typename W3>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3) const>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 3};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 3};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -193,10 +193,10 @@
template <typename U, typename V,
typename W1, typename W2,
typename W3, typename W4>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4)>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 4};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 4};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -206,10 +206,10 @@
template <typename U, typename V,
typename W1, typename W2,
typename W3, typename W4>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4) const>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 4};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 4};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -220,10 +220,10 @@
typename W1, typename W2,
typename W3, typename W4,
typename W5>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5)>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 5};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 5};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -235,10 +235,10 @@
typename W1, typename W2,
typename W3, typename W4,
typename W5>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5) const>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 5};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 5};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -250,10 +250,10 @@
typename W1, typename W2,
typename W3, typename W4,
typename W5, typename W6>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6)>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5,W6)>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 6};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 6};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -266,10 +266,10 @@
typename W1, typename W2,
typename W3, typename W4,
typename W5, typename W6>
- struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6) const>
+ struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5,W6) const>
{
- enum {IsPointerToMember = 1};
- enum {nArgs = 6};
+ enum { IsPointerToMember = 1};
+ enum { nArgs = 6};
typedef U ReturnType;
typedef W1 Arg1Type;
typedef W2 Arg2Type;
@@ -283,10 +283,10 @@
typedef typename UnConst<T>::Result NonConstType;
typedef typename ReferenceTraits<T>::ReferencedType ReferencedType;
typedef typename PointerTraits<T>::PointeeType PointeeType;
- enum {IsPointerToMember = PtrToMemberTraits<T>::IsPointerToMember};
- enum {IsPointer = PointerTraits<T>::IsPointer};
- enum {IsReference = ReferenceTraits<T>::IsReference};
- enum {IsFunctionPointer = FunctionPtrTraits<T>::IsFunctionPointer};
+ enum { IsPointerToMember = PtrToMemberTraits<T>::IsPointerToMember};
+ enum { IsPointer = PointerTraits<T>::IsPointer};
+ enum { IsReference = ReferenceTraits<T>::IsReference};
+ enum { IsFunctionPointer = FunctionPtrTraits<T>::IsFunctionPointer};
typedef PtrToMemberTraits<T> PointerToMemberTraits;
typedef FunctionPtrTraits<T> FunctionPointerTraits;
};
--- a/src/core/model/uinteger.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/uinteger.cc Fri May 13 14:52:27 2011 -0400
@@ -38,9 +38,9 @@
virtual bool Check (const AttributeValue &value) const {
const UintegerValue *v = dynamic_cast<const UintegerValue *> (&value);
if (v == 0)
- {
- return false;
- }
+ {
+ return false;
+ }
return v->Get () >= m_minValue && v->Get () <= m_maxValue;
}
virtual std::string GetValueTypeName (void) const {
--- a/src/core/model/unix-fd-reader.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-fd-reader.cc Fri May 13 14:52:27 2011 -0400
@@ -82,7 +82,7 @@
// scheduling a "destroy time" method to make sure the thread exits before
// proceeding.
//
- if (! m_destroyEvent.IsRunning ())
+ if (!m_destroyEvent.IsRunning ())
{
// hold a reference to ensure that this object is not
// deallocated before the destroy-time event fires
@@ -162,7 +162,7 @@
if (r == -1 && errno != EINTR)
{
NS_FATAL_ERROR ("select() failed: " << strerror (errno));
- }
+ }
if (FD_ISSET (m_evpipe[0], &readfds))
{
@@ -187,7 +187,7 @@
NS_LOG_WARN ("read() failed: " << strerror (errno));
break;
}
- }
+ }
if (m_stop)
{
--- a/src/core/model/unix-fd-reader.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-fd-reader.h Fri May 13 14:52:27 2011 -0400
@@ -110,4 +110,4 @@
} // namespace ns3
-#endif // UNIX_FD_READER_H
+#endif // UNIX_FD_READER_H
--- a/src/core/model/unix-system-condition.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-system-condition.cc Fri May 13 14:52:27 2011 -0400
@@ -27,7 +27,7 @@
namespace ns3 {
-class SystemConditionPrivate {
+class SystemConditionPrivate {
public:
static const uint64_t NS_PER_SEC = (uint64_t)1000000000;
@@ -71,7 +71,7 @@
pthread_condattr_setpshared (&cAttr, PTHREAD_PROCESS_PRIVATE);
pthread_cond_init (&m_cond, &cAttr);
}
-
+
SystemConditionPrivate::~SystemConditionPrivate()
{
NS_LOG_FUNCTION_NOARGS ();
@@ -79,21 +79,21 @@
pthread_cond_destroy (&m_cond);
}
- void
+void
SystemConditionPrivate::SetCondition (bool condition)
{
NS_LOG_FUNCTION_NOARGS ();
m_condition = condition;
}
- bool
+bool
SystemConditionPrivate::GetCondition (void)
{
NS_LOG_FUNCTION_NOARGS ();
return m_condition;
}
- void
+void
SystemConditionPrivate::Signal (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -103,7 +103,7 @@
pthread_mutex_unlock (&m_mutex);
}
- void
+void
SystemConditionPrivate::Broadcast (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -113,7 +113,7 @@
pthread_mutex_unlock (&m_mutex);
}
- void
+void
SystemConditionPrivate::Wait (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -127,7 +127,7 @@
pthread_mutex_unlock (&m_mutex);
}
- bool
+bool
SystemConditionPrivate::TimedWait (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -156,7 +156,7 @@
if (rc == ETIMEDOUT)
{
pthread_mutex_unlock (&m_mutex);
- return true;
+ return true;
}
}
pthread_mutex_unlock (&m_mutex);
@@ -175,46 +175,46 @@
delete m_priv;
}
- void
+void
SystemCondition::SetCondition (bool condition)
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->SetCondition (condition);
}
- bool
+bool
SystemCondition::GetCondition (void)
{
NS_LOG_FUNCTION_NOARGS ();
return m_priv->GetCondition ();
}
- void
+void
SystemCondition::Signal (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->Signal ();
}
- void
+void
SystemCondition::Broadcast (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->Broadcast ();
-}
+}
- void
+void
SystemCondition::Wait (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->Wait ();
-}
+}
- bool
+bool
SystemCondition::TimedWait (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
return m_priv->TimedWait (ns);
-}
+}
} // namespace ns3
--- a/src/core/model/unix-system-mutex.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-system-mutex.cc Fri May 13 14:52:27 2011 -0400
@@ -29,7 +29,7 @@
namespace ns3 {
-class SystemMutexPrivate {
+class SystemMutexPrivate {
public:
SystemMutexPrivate ();
~SystemMutexPrivate ();
@@ -62,14 +62,14 @@
#endif
pthread_mutex_init (&m_mutex, &attr);
}
-
+
SystemMutexPrivate::~SystemMutexPrivate()
{
NS_LOG_FUNCTION_NOARGS ();
pthread_mutex_destroy (&m_mutex);
}
- void
+void
SystemMutexPrivate::Lock (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -78,12 +78,12 @@
if (rc != 0)
{
NS_FATAL_ERROR ("SystemMutexPrivate::Lock()"
- "pthread_mutex_lock failed: " << rc << " = \"" <<
- strerror(rc) << "\"");
+ "pthread_mutex_lock failed: " << rc << " = \"" <<
+ strerror(rc) << "\"");
}
}
- void
+void
SystemMutexPrivate::Unlock (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -92,8 +92,8 @@
if (rc != 0)
{
NS_FATAL_ERROR ("SystemMutexPrivate::Unlock()"
- "pthread_mutex_unlock failed: " << rc << " = \"" <<
- strerror(rc) << "\"");
+ "pthread_mutex_unlock failed: " << rc << " = \"" <<
+ strerror(rc) << "\"");
}
}
@@ -109,19 +109,19 @@
delete m_priv;
}
- void
+void
SystemMutex::Lock()
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->Lock ();
}
- void
+void
SystemMutex::Unlock()
{
NS_LOG_FUNCTION_NOARGS ();
m_priv->Unlock ();
-}
+}
CriticalSection::CriticalSection (SystemMutex &mutex)
: m_mutex(mutex)
--- a/src/core/model/unix-system-thread.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-system-thread.cc Fri May 13 14:52:27 2011 -0400
@@ -74,22 +74,22 @@
sigaction (SIGALRM, &act, 0);
}
- void
+void
SystemThreadImpl::Start (void)
{
NS_LOG_FUNCTION_NOARGS ();
int rc = pthread_create (&m_thread, NULL, &SystemThreadImpl::DoRun,
- (void *)this);
+ (void *)this);
if (rc)
{
NS_FATAL_ERROR ("pthread_create failed: " << rc << "=\"" <<
- strerror(rc) << "\".");
+ strerror(rc) << "\".");
}
}
- void
+void
SystemThreadImpl::Join (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -99,11 +99,11 @@
if (rc)
{
NS_FATAL_ERROR ("pthread_join failed: " << rc << "=\"" <<
- strerror(rc) << "\".");
+ strerror(rc) << "\".");
}
}
- void
+void
SystemThreadImpl::Shutdown (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -115,7 +115,7 @@
pthread_kill (m_thread, SIGALRM);
}
- bool
+bool
SystemThreadImpl::Break (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -123,7 +123,7 @@
return m_break;
}
- void *
+void *
SystemThreadImpl::DoRun (void *arg)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -145,39 +145,39 @@
{
NS_LOG_FUNCTION_NOARGS ();
}
-
+
SystemThread::~SystemThread()
{
NS_LOG_FUNCTION_NOARGS ();
delete m_impl;
}
-
- void
+
+void
SystemThread::Start (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_impl->Start ();
}
-
- void
+
+void
SystemThread::Join (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_impl->Join ();
-}
+}
- void
+void
SystemThread::Shutdown (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_impl->Shutdown ();
-}
+}
- bool
+bool
SystemThread::Break (void)
{
NS_LOG_FUNCTION_NOARGS ();
return m_impl->Break ();
-}
+}
} // namespace ns3
--- a/src/core/model/unix-system-wall-clock-ms.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/unix-system-wall-clock-ms.cc Fri May 13 14:52:27 2011 -0400
@@ -117,10 +117,11 @@
{
return m_elapsedSystem;
}
-
+
SystemWallClockMs::SystemWallClockMs ()
: m_priv (new SystemWallClockMsPrivate ())
-{}
+{
+}
SystemWallClockMs::~SystemWallClockMs ()
{
--- a/src/core/model/vector.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/vector.cc Fri May 13 14:52:27 2011 -0400
@@ -26,7 +26,7 @@
ATTRIBUTE_HELPER_CPP (Vector3D);
ATTRIBUTE_HELPER_CPP (Vector2D);
- // compatibility for mobility code
+// compatibility for mobility code
Ptr<const AttributeChecker> MakeVectorChecker (void)
{
return MakeVector3DChecker ();
@@ -37,25 +37,29 @@
: x (_x),
y (_y),
z (_z)
-{}
+{
+}
Vector3D::Vector3D ()
: x (0.0),
y (0.0),
z (0.0)
-{}
+{
+}
Vector2D::Vector2D (double _x, double _y)
: x (_x),
y (_y)
-{}
+{
+}
Vector2D::Vector2D ()
: x (0.0),
y (0.0)
-{}
+{
+}
-double
+double
CalculateDistance (const Vector3D &a, const Vector3D &b)
{
double dx = b.x - a.x;
--- a/src/core/model/wall-clock-synchronizer.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/wall-clock-synchronizer.cc Fri May 13 14:52:27 2011 -0400
@@ -73,21 +73,21 @@
NS_LOG_FUNCTION_NOARGS ();
}
- bool
+bool
WallClockSynchronizer::DoRealtime (void)
{
NS_LOG_FUNCTION_NOARGS ();
return true;
}
- uint64_t
+uint64_t
WallClockSynchronizer::DoGetCurrentRealtime (void)
{
NS_LOG_FUNCTION_NOARGS ();
return GetNormalizedRealtime ();
}
- void
+void
WallClockSynchronizer::DoSetOrigin (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -103,7 +103,7 @@
NS_LOG_INFO ("origin = " << m_realtimeOriginNano);
}
- int64_t
+int64_t
WallClockSynchronizer::DoGetDrift (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -143,7 +143,7 @@
}
}
- bool
+bool
WallClockSynchronizer::DoSynchronize (uint64_t nsCurrent, uint64_t nsDelay)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -209,7 +209,7 @@
{
NS_LOG_INFO ("SleepWait for " << numberJiffies * m_jiffy << " ns");
NS_LOG_INFO ("SleepWait until " << nsCurrent + numberJiffies * m_jiffy
- << " ns");
+ << " ns");
//
// SleepWait is interruptible. If it returns true it meant that the sleep
// went until the end. If it returns false, it means that the sleep was
@@ -261,7 +261,7 @@
return SpinWait (nsCurrent + nsDelay);
}
- void
+void
WallClockSynchronizer::DoSignal (void)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -270,28 +270,28 @@
m_condition.Signal ();
}
- void
+void
WallClockSynchronizer::DoSetCondition (bool cond)
{
NS_LOG_FUNCTION_NOARGS ();
m_condition.SetCondition (cond);
}
- void
+void
WallClockSynchronizer::DoEventStart (void)
{
NS_LOG_FUNCTION_NOARGS ();
m_nsEventStart = GetNormalizedRealtime ();
}
- uint64_t
+uint64_t
WallClockSynchronizer::DoEventEnd (void)
{
NS_LOG_FUNCTION_NOARGS ();
return GetNormalizedRealtime () - m_nsEventStart;
}
- bool
+bool
WallClockSynchronizer::SpinWait (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -319,7 +319,7 @@
return true;
}
- bool
+bool
WallClockSynchronizer::SleepWait (uint64_t ns)
{
NS_LOG_FUNCTION_NOARGS ();
@@ -345,7 +345,7 @@
return m_condition.TimedWait (ns);
}
- uint64_t
+uint64_t
WallClockSynchronizer::DriftCorrect (uint64_t nsNow, uint64_t nsDelay)
{
int64_t drift = DoGetDrift (nsNow);
@@ -375,7 +375,7 @@
}
}
- uint64_t
+uint64_t
WallClockSynchronizer::GetRealtime (void)
{
struct timeval tvNow;
@@ -383,13 +383,13 @@
return TimevalToNs (&tvNow);
}
- uint64_t
+uint64_t
WallClockSynchronizer::GetNormalizedRealtime (void)
{
return GetRealtime () - m_realtimeOriginNano;
}
- void
+void
WallClockSynchronizer::NsToTimeval (int64_t ns, struct timeval *tv)
{
NS_ASSERT ((ns % US_PER_NS) == 0);
@@ -397,7 +397,7 @@
tv->tv_usec = (ns % NS_PER_SEC) / US_PER_NS;
}
- uint64_t
+uint64_t
WallClockSynchronizer::TimevalToNs (struct timeval *tv)
{
uint64_t nsResult = tv->tv_sec * NS_PER_SEC + tv->tv_usec * US_PER_NS;
@@ -405,7 +405,7 @@
return nsResult;
}
- void
+void
WallClockSynchronizer::TimevalAdd (
struct timeval *tv1,
struct timeval *tv2,
--- a/src/core/model/wall-clock-synchronizer.h Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/wall-clock-synchronizer.h Fri May 13 14:52:27 2011 -0400
@@ -37,7 +37,7 @@
* The simulation clock is maintained as a 64-bit integer in a unit specified
* by the user through the TimeStepPrecision::Set function. This means that
* it is not possible to specify event expiration times with anything better
- * than this user-specified accuracy.
+ * than this user-specified accuracy.
*
* There are a couple of more issues at this level. Posix clocks provide
* access to several clocks we could use as a wall clock. We don't care about
--- a/src/core/model/watchdog.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/watchdog.cc Fri May 13 14:52:27 2011 -0400
@@ -25,14 +25,15 @@
: m_impl (0),
m_event (),
m_end (MicroSeconds (0))
-{}
+{
+}
Watchdog::~Watchdog ()
{
delete m_impl;
}
-void
+void
Watchdog::Ping (Time delay)
{
Time end = Simulator::Now () + delay;
--- a/src/core/model/win32-system-wall-clock-ms.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/model/win32-system-wall-clock-ms.cc Fri May 13 14:52:27 2011 -0400
@@ -110,10 +110,11 @@
{
return m_elapsedSystem;
}
-
+
SystemWallClockMs::SystemWallClockMs ()
: m_priv (new SystemWallClockMsPrivate ())
-{}
+{
+}
SystemWallClockMs::~SystemWallClockMs ()
{
--- a/src/core/test/attribute-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/attribute-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -61,7 +61,7 @@
static TypeId GetTypeId (void) {
static TypeId tid = TypeId ("ns3::Derived")
.SetParent<Object> ()
- ;
+ ;
return tid;
}
};
@@ -79,89 +79,89 @@
.SetParent<Object> ()
.HideFromDocumentation ()
.AddAttribute ("TestBoolName", "help text",
- BooleanValue (false),
- MakeBooleanAccessor (&AttributeObjectTest::m_boolTest),
- MakeBooleanChecker ())
+ BooleanValue (false),
+ MakeBooleanAccessor (&AttributeObjectTest::m_boolTest),
+ MakeBooleanChecker ())
.AddAttribute ("TestBoolA", "help text",
- BooleanValue (false),
- MakeBooleanAccessor (&AttributeObjectTest::DoSetTestB,
- &AttributeObjectTest::DoGetTestB),
- MakeBooleanChecker ())
+ BooleanValue (false),
+ MakeBooleanAccessor (&AttributeObjectTest::DoSetTestB,
+ &AttributeObjectTest::DoGetTestB),
+ MakeBooleanChecker ())
.AddAttribute ("TestInt16", "help text",
- IntegerValue (-2),
- MakeIntegerAccessor (&AttributeObjectTest::m_int16),
- MakeIntegerChecker<int16_t> ())
+ IntegerValue (-2),
+ MakeIntegerAccessor (&AttributeObjectTest::m_int16),
+ MakeIntegerChecker<int16_t> ())
.AddAttribute ("TestInt16WithBounds", "help text",
- IntegerValue (-2),
- MakeIntegerAccessor (&AttributeObjectTest::m_int16WithBounds),
- MakeIntegerChecker<int16_t> (-5, 10))
+ IntegerValue (-2),
+ MakeIntegerAccessor (&AttributeObjectTest::m_int16WithBounds),
+ MakeIntegerChecker<int16_t> (-5, 10))
.AddAttribute ("TestInt16SetGet", "help text",
- IntegerValue (6),
- MakeIntegerAccessor (&AttributeObjectTest::DoSetInt16,
- &AttributeObjectTest::DoGetInt16),
- MakeIntegerChecker<int16_t> ())
+ IntegerValue (6),
+ MakeIntegerAccessor (&AttributeObjectTest::DoSetInt16,
+ &AttributeObjectTest::DoGetInt16),
+ MakeIntegerChecker<int16_t> ())
.AddAttribute ("TestUint8", "help text",
- UintegerValue (1),
- MakeUintegerAccessor (&AttributeObjectTest::m_uint8),
- MakeUintegerChecker<uint8_t> ())
+ UintegerValue (1),
+ MakeUintegerAccessor (&AttributeObjectTest::m_uint8),
+ MakeUintegerChecker<uint8_t> ())
.AddAttribute ("TestEnum", "help text",
- EnumValue (TEST_A),
- MakeEnumAccessor (&AttributeObjectTest::m_enum),
- MakeEnumChecker (TEST_A, "TestA",
- TEST_B, "TestB",
- TEST_C, "TestC"))
+ EnumValue (TEST_A),
+ MakeEnumAccessor (&AttributeObjectTest::m_enum),
+ MakeEnumChecker (TEST_A, "TestA",
+ TEST_B, "TestB",
+ TEST_C, "TestC"))
.AddAttribute ("TestRandom", "help text",
- RandomVariableValue (ConstantVariable (1.0)),
- MakeRandomVariableAccessor (&AttributeObjectTest::m_random),
- MakeRandomVariableChecker ())
+ RandomVariableValue (ConstantVariable (1.0)),
+ MakeRandomVariableAccessor (&AttributeObjectTest::m_random),
+ MakeRandomVariableChecker ())
.AddAttribute ("TestFloat", "help text",
- DoubleValue (-1.1),
- MakeDoubleAccessor (&AttributeObjectTest::m_float),
- MakeDoubleChecker<float> ())
+ DoubleValue (-1.1),
+ MakeDoubleAccessor (&AttributeObjectTest::m_float),
+ MakeDoubleChecker<float> ())
.AddAttribute ("TestVector1", "help text",
- ObjectVectorValue (),
- MakeObjectVectorAccessor (&AttributeObjectTest::m_vector1),
- MakeObjectVectorChecker<Derived> ())
+ ObjectVectorValue (),
+ MakeObjectVectorAccessor (&AttributeObjectTest::m_vector1),
+ MakeObjectVectorChecker<Derived> ())
.AddAttribute ("TestVector2", "help text",
- ObjectVectorValue (),
- MakeObjectVectorAccessor (&AttributeObjectTest::DoGetVectorN,
- &AttributeObjectTest::DoGetVector),
- MakeObjectVectorChecker<Derived> ())
+ ObjectVectorValue (),
+ MakeObjectVectorAccessor (&AttributeObjectTest::DoGetVectorN,
+ &AttributeObjectTest::DoGetVector),
+ MakeObjectVectorChecker<Derived> ())
.AddAttribute ("IntegerTraceSource1", "help text",
- IntegerValue (-2),
- MakeIntegerAccessor (&AttributeObjectTest::m_intSrc1),
- MakeIntegerChecker<int8_t> ())
+ IntegerValue (-2),
+ MakeIntegerAccessor (&AttributeObjectTest::m_intSrc1),
+ MakeIntegerChecker<int8_t> ())
.AddAttribute ("IntegerTraceSource2", "help text",
- IntegerValue (-2),
- MakeIntegerAccessor (&AttributeObjectTest::DoSetIntSrc,
- &AttributeObjectTest::DoGetIntSrc),
- MakeIntegerChecker<int8_t> ())
+ IntegerValue (-2),
+ MakeIntegerAccessor (&AttributeObjectTest::DoSetIntSrc,
+ &AttributeObjectTest::DoGetIntSrc),
+ MakeIntegerChecker<int8_t> ())
.AddAttribute ("UIntegerTraceSource", "help text",
- UintegerValue (2),
- MakeUintegerAccessor (&AttributeObjectTest::m_uintSrc),
- MakeIntegerChecker<uint8_t> ())
+ UintegerValue (2),
+ MakeUintegerAccessor (&AttributeObjectTest::m_uintSrc),
+ MakeIntegerChecker<uint8_t> ())
.AddAttribute ("DoubleTraceSource", "help text",
- DoubleValue (2),
- MakeDoubleAccessor (&AttributeObjectTest::m_doubleSrc),
- MakeDoubleChecker<double> ())
+ DoubleValue (2),
+ MakeDoubleAccessor (&AttributeObjectTest::m_doubleSrc),
+ MakeDoubleChecker<double> ())
.AddAttribute ("BoolTraceSource", "help text",
BooleanValue (false),
- MakeBooleanAccessor (&AttributeObjectTest::m_boolSrc),
- MakeBooleanChecker ())
+ MakeBooleanAccessor (&AttributeObjectTest::m_boolSrc),
+ MakeBooleanChecker ())
.AddAttribute ("EnumTraceSource", "help text",
EnumValue (false),
- MakeEnumAccessor (&AttributeObjectTest::m_enumSrc),
- MakeEnumChecker (TEST_A, "TestA"))
+ MakeEnumAccessor (&AttributeObjectTest::m_enumSrc),
+ MakeEnumChecker (TEST_A, "TestA"))
.AddAttribute ("ValueClassSource", "help text",
- ValueClassTestValue (ValueClassTest ()),
- MakeValueClassTestAccessor (&AttributeObjectTest::m_valueSrc),
- MakeValueClassTestChecker ())
+ ValueClassTestValue (ValueClassTest ()),
+ MakeValueClassTestAccessor (&AttributeObjectTest::m_valueSrc),
+ MakeValueClassTestChecker ())
.AddTraceSource ("Source1", "help test",
- MakeTraceSourceAccessor (&AttributeObjectTest::m_intSrc1))
+ MakeTraceSourceAccessor (&AttributeObjectTest::m_intSrc1))
.AddTraceSource ("Source2", "help text",
- MakeTraceSourceAccessor (&AttributeObjectTest::m_cb))
+ MakeTraceSourceAccessor (&AttributeObjectTest::m_cb))
.AddTraceSource ("ValueSource", "help text",
- MakeTraceSourceAccessor (&AttributeObjectTest::m_valueSrc))
+ MakeTraceSourceAccessor (&AttributeObjectTest::m_valueSrc))
.AddAttribute ("Pointer", "help text",
PointerValue (),
MakePointerAccessor (&AttributeObjectTest::m_ptr),
@@ -170,14 +170,14 @@
CallbackValue (),
MakeCallbackAccessor (&AttributeObjectTest::m_cbValue),
MakeCallbackChecker ())
- ;
-
+ ;
+
return tid;
}
- void AddToVector1 (void) {m_vector1.push_back (CreateObject<Derived> ());}
- void AddToVector2 (void) {m_vector2.push_back (CreateObject<Derived> ());}
- void InvokeCb (double a, int b, float c) {m_cb (a,b,c);}
+ void AddToVector1 (void) { m_vector1.push_back (CreateObject<Derived> ());}
+ void AddToVector2 (void) { m_vector2.push_back (CreateObject<Derived> ());}
+ void InvokeCb (double a, int b, float c) { m_cb (a,b,c);}
void InvokeCbValue (int8_t a)
{
@@ -187,14 +187,14 @@
}
private:
- void DoSetTestB (bool v) {m_boolTestA = v;}
- bool DoGetTestB (void) const {return m_boolTestA;}
- int16_t DoGetInt16 (void) const {return m_int16SetGet;}
- void DoSetInt16 (int16_t v) {m_int16SetGet = v;}
- uint32_t DoGetVectorN (void) const {return m_vector2.size ();}
- Ptr<Derived> DoGetVector (uint32_t i) const {return m_vector2[i];}
- bool DoSetIntSrc (int8_t v) {m_intSrc2 = v; return true;}
- int8_t DoGetIntSrc (void) const {return m_intSrc2;}
+ void DoSetTestB (bool v) { m_boolTestA = v;}
+ bool DoGetTestB (void) const { return m_boolTestA;}
+ int16_t DoGetInt16 (void) const { return m_int16SetGet;}
+ void DoSetInt16 (int16_t v) { m_int16SetGet = v;}
+ uint32_t DoGetVectorN (void) const { return m_vector2.size ();}
+ Ptr<Derived> DoGetVector (uint32_t i) const { return m_vector2[i];}
+ bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true;}
+ int8_t DoGetIntSrc (void) const { return m_intSrc2;}
bool m_boolTestA;
bool m_boolTest;
@@ -836,7 +836,7 @@
private:
virtual void DoRun (void);
- void NotifySource1 (int8_t old, int8_t n) {m_got1 = n;}
+ void NotifySource1 (int8_t old, int8_t n) { m_got1 = n;}
int64_t m_got1;
};
@@ -908,7 +908,7 @@
private:
virtual void DoRun (void);
- void NotifySource2 (double a, int b, float c) {m_got2 = a;}
+ void NotifySource2 (double a, int b, float c) { m_got2 = a;}
double m_got2;
};
@@ -982,7 +982,7 @@
private:
virtual void DoRun (void);
- void NotifySource2 (double a, int b, float c) {m_got2 = a;}
+ void NotifySource2 (double a, int b, float c) { m_got2 = a;}
double m_got2;
};
@@ -1078,7 +1078,7 @@
Callback<void,int8_t> m_cbValue;
- void NotifyCallbackValue (int8_t a) {m_gotCbValue = a;}
+ void NotifyCallbackValue (int8_t a) { m_gotCbValue = a;}
int16_t m_gotCbValue;
};
@@ -1136,7 +1136,7 @@
//
p->InvokeCbValue (3);
NS_TEST_ASSERT_MSG_EQ (m_gotCbValue, 2, "Callback Attribute set to null callback unexpectedly fired");
- }
+}
// ===========================================================================
// The Test Suite that glues all of the Test Cases together.
--- a/src/core/test/callback-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/callback-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -31,10 +31,10 @@
BasicCallbackTestCase ();
virtual ~BasicCallbackTestCase () {}
- void Target1 (void) {m_test1 = true;}
- int Target2 (void) {m_test2 = true; return 2;}
- void Target3 (double a) {m_test3 = true;}
- int Target4 (double a, int b) {m_test4 = true; return 4;}
+ void Target1 (void) { m_test1 = true;}
+ int Target2 (void) { m_test2 = true; return 2;}
+ void Target3 (double a) { m_test3 = true;}
+ int Target4 (double a, int b) { m_test4 = true; return 4;}
private:
virtual void DoRun (void);
@@ -135,7 +135,7 @@
//
// Make sure we can declare and compile a Callback pointing to a non-member
- // function that returns void, takes one integer argument and execute it.
+ // function that returns void, takes one integer argument and execute it.
// We also need to provide two dummy arguments to the constructor here.
//
Callback<void, int> target6 = Callback<void, int> (&BasicCallbackTarget6, true, true);
@@ -144,7 +144,7 @@
//
// Make sure we can declare and compile a Callback pointing to a non-member
- // function that returns int, takes one integer argument and execute it.
+ // function that returns int, takes one integer argument and execute it.
// We also need to provide two dummy arguments to the constructor here.
//
Callback<int, int> target7 = Callback<int, int> (&BasicCallbackTarget7, true, true);
@@ -161,10 +161,10 @@
MakeCallbackTestCase ();
virtual ~MakeCallbackTestCase () {}
- void Target1 (void) {m_test1 = true;}
- int Target2 (void) {m_test2 = true; return 2;}
- void Target3 (double a) {m_test3 = true;}
- int Target4 (double a, int b) {m_test4 = true; return 4;}
+ void Target1 (void) { m_test1 = true;}
+ int Target2 (void) { m_test2 = true; return 2;}
+ void Target3 (double a) { m_test3 = true;}
+ int Target4 (double a, int b) { m_test4 = true; return 4;}
private:
virtual void DoRun (void);
@@ -263,7 +263,7 @@
//
// Make sure we can declare and compile a Callback pointing to a non-member
- // function that returns void, takes one integer argument and execute it.
+ // function that returns void, takes one integer argument and execute it.
// This uses a higher level call than in the basic tests so we do not need to
// include any dummy arguments here.
//
@@ -273,7 +273,7 @@
//
// Make sure we can declare and compile a Callback pointing to a non-member
- // function that returns int, takes one integer argument and execute it.
+ // function that returns int, takes one integer argument and execute it.
// This uses a higher level call than in the basic tests so we do not need to
// include any dummy arguments here.
//
@@ -387,7 +387,7 @@
NullifyCallbackTestCase ();
virtual ~NullifyCallbackTestCase () {}
- void Target1 (void) {m_test1 = true;}
+ void Target1 (void) { m_test1 = true;}
private:
virtual void DoRun (void);
@@ -435,7 +435,7 @@
MakeCallbackTemplatesTestCase ();
virtual ~MakeCallbackTemplatesTestCase () {}
- void Target1 (void) {m_test1 = true;}
+ void Target1 (void) { m_test1 = true;}
private:
virtual void DoRun (void);
--- a/src/core/test/config-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/config-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -69,36 +69,36 @@
static TypeId tid = TypeId ("ConfigTestObject")
.SetParent<Object> ()
.AddAttribute ("NodesA", "",
- ObjectVectorValue (),
- MakeObjectVectorAccessor (&ConfigTestObject::m_nodesA),
- MakeObjectVectorChecker<ConfigTestObject> ())
+ ObjectVectorValue (),
+ MakeObjectVectorAccessor (&ConfigTestObject::m_nodesA),
+ MakeObjectVectorChecker<ConfigTestObject> ())
.AddAttribute ("NodesB", "",
- ObjectVectorValue (),
- MakeObjectVectorAccessor (&ConfigTestObject::m_nodesB),
- MakeObjectVectorChecker<ConfigTestObject> ())
+ ObjectVectorValue (),
+ MakeObjectVectorAccessor (&ConfigTestObject::m_nodesB),
+ MakeObjectVectorChecker<ConfigTestObject> ())
.AddAttribute ("NodeA", "",
PointerValue (),
- MakePointerAccessor (&ConfigTestObject::m_nodeA),
- MakePointerChecker<ConfigTestObject> ())
+ MakePointerAccessor (&ConfigTestObject::m_nodeA),
+ MakePointerChecker<ConfigTestObject> ())
.AddAttribute ("NodeB", "",
PointerValue (),
- MakePointerAccessor (&ConfigTestObject::m_nodeB),
- MakePointerChecker<ConfigTestObject> ())
+ MakePointerAccessor (&ConfigTestObject::m_nodeB),
+ MakePointerChecker<ConfigTestObject> ())
.AddAttribute ("A", "",
- IntegerValue (10),
- MakeIntegerAccessor (&ConfigTestObject::m_a),
- MakeIntegerChecker<int8_t> ())
+ IntegerValue (10),
+ MakeIntegerAccessor (&ConfigTestObject::m_a),
+ MakeIntegerChecker<int8_t> ())
.AddAttribute ("B", "",
- IntegerValue (9),
- MakeIntegerAccessor (&ConfigTestObject::m_b),
- MakeIntegerChecker<int8_t> ())
+ IntegerValue (9),
+ MakeIntegerAccessor (&ConfigTestObject::m_b),
+ MakeIntegerChecker<int8_t> ())
.AddAttribute ("Source", "XX",
- IntegerValue (-1),
- MakeIntegerAccessor (&ConfigTestObject::m_trace),
- MakeIntegerChecker<int16_t> ())
+ IntegerValue (-1),
+ MakeIntegerAccessor (&ConfigTestObject::m_trace),
+ MakeIntegerChecker<int16_t> ())
.AddTraceSource ("Source", "XX",
- MakeTraceSourceAccessor (&ConfigTestObject::m_trace))
- ;
+ MakeTraceSourceAccessor (&ConfigTestObject::m_trace))
+ ;
return tid;
}
@@ -457,8 +457,8 @@
ObjectVectorTraceConfigTestCase ();
virtual ~ObjectVectorTraceConfigTestCase () {}
- void Trace (int16_t oldValue, int16_t newValue) {m_newValue = newValue;}
- void TraceWithPath (std::string path, int16_t old, int16_t newValue) {m_newValue = newValue; m_path = path;}
+ void Trace (int16_t oldValue, int16_t newValue) { m_newValue = newValue;}
+ void TraceWithPath (std::string path, int16_t old, int16_t newValue) { m_newValue = newValue; m_path = path;}
private:
virtual void DoRun (void);
--- a/src/core/test/global-value-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/global-value-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -49,8 +49,8 @@
// keep it hidden from the documentation.
//
GlobalValue uint = GlobalValue ("TestUint", "help text",
- UintegerValue (10),
- MakeUintegerChecker<uint32_t> ());
+ UintegerValue (10),
+ MakeUintegerChecker<uint32_t> ());
//
// Make sure we can get at the value and that it was initialized correctly.
@@ -66,8 +66,8 @@
for (GlobalValue::Vector::iterator i = vector->begin (); i != vector->end (); ++i)
{
if ((*i) == &uint)
- {
- vector->erase (i);
+ {
+ vector->erase (i);
break;
}
}
--- a/src/core/test/int64x64-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/int64x64-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -17,9 +17,9 @@
{
int64x64_t tmp = int64x64_t (hi,lo);
NS_TEST_EXPECT_MSG_EQ (tmp.GetHigh (), hi,
- "High part does not match");
+ "High part does not match");
NS_TEST_EXPECT_MSG_EQ (tmp.GetLow (), lo,
- "Low part does not match");
+ "Low part does not match");
}
Int64x64FracTestCase::Int64x64FracTestCase ()
@@ -273,25 +273,26 @@
{
#define TEST(factor) \
do { \
- int64x64_t a; \
- a = int64x64_t::Invert (factor); \
- int64x64_t b = V (factor); \
- b.MulByInvert (a); \
- NS_TEST_ASSERT_MSG_EQ (b.GetHigh (), 1, \
- "x * 1/x should be 1 for x=" << factor); \
- int64x64_t c = V (1); \
- c.MulByInvert (a); \
- NS_TEST_ASSERT_MSG_EQ (c.GetHigh (), 0, \
- "1 * 1/x should be 0 for x=" << factor); \
- int64x64_t d = V (1); \
- d /= (V(factor)); \
- NS_TEST_ASSERT_MSG_EQ (d.GetDouble (), c.GetDouble (), \
- "1 * 1/x should be equal to 1/x for x=" << factor); \
- int64x64_t e = V (-factor); \
- e.MulByInvert (a); \
- NS_TEST_ASSERT_MSG_EQ (e.GetHigh (), -1, \
- "-x * 1/x should be -1 for x=" << factor); \
- } while(false)
+ int64x64_t a; \
+ a = int64x64_t::Invert (factor); \
+ int64x64_t b = V (factor); \
+ b.MulByInvert (a); \
+ NS_TEST_ASSERT_MSG_EQ (b.GetHigh (), 1, \
+ "x * 1/x should be 1 for x=" << factor); \
+ int64x64_t c = V (1); \
+ c.MulByInvert (a); \
+ NS_TEST_ASSERT_MSG_EQ (c.GetHigh (), 0, \
+ "1 * 1/x should be 0 for x=" << factor); \
+ int64x64_t d = V (1); \
+ d /= (V(factor)); \
+ NS_TEST_ASSERT_MSG_EQ (d.GetDouble (), c.GetDouble (), \
+ "1 * 1/x should be equal to 1/x for x=" << factor); \
+ int64x64_t e = V (-factor); \
+ e.MulByInvert (a); \
+ NS_TEST_ASSERT_MSG_EQ (e.GetHigh (), -1, \
+ "-x * 1/x should be -1 for x=" << factor); \
+ } \
+ while(false)
TEST(2);
TEST(3);
TEST(4);
--- a/src/core/test/names-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/names-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -903,20 +903,20 @@
foundTestObject = Names::Find<TestObject> ("Test Object");
NS_TEST_ASSERT_MSG_EQ (foundTestObject, testObject,
- "Could not find a previously named TestObject via GetObject");
+ "Could not find a previously named TestObject via GetObject");
foundAlternateTestObject = Names::Find<AlternateTestObject> ("Alternate Test Object");
NS_TEST_ASSERT_MSG_EQ (foundAlternateTestObject, alternateTestObject,
- "Could not find a previously named AlternateTestObject via GetObject");
+ "Could not find a previously named AlternateTestObject via GetObject");
foundAlternateTestObject = Names::Find<AlternateTestObject> ("Test Object");
NS_TEST_ASSERT_MSG_EQ (foundAlternateTestObject, 0,
- "Unexpectedly able to GetObject<AlternateTestObject> on a TestObject");
+ "Unexpectedly able to GetObject<AlternateTestObject> on a TestObject");
foundTestObject = Names::Find<TestObject> ("Alternate Test Object");
NS_TEST_ASSERT_MSG_EQ (foundTestObject, 0,
- "Unexpectedly able to GetObject<TestObject> on an AlternateTestObject");
+ "Unexpectedly able to GetObject<TestObject> on an AlternateTestObject");
}
class NamesTestSuite : public TestSuite
--- a/src/core/test/ptr-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/ptr-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -62,15 +62,17 @@
Base::Base ()
: m_count (1)
-{}
+{
+}
Base::~Base ()
-{}
-void
+{
+}
+void
Base::Ref (void) const
{
m_count++;
}
-void
+void
Base::Unref (void) const
{
m_count--;
@@ -82,7 +84,8 @@
NoCount::NoCount (PtrTestCase *test)
: m_test (test)
-{}
+{
+}
NoCount::~NoCount ()
{
m_test->DestroyNotify ();
@@ -95,19 +98,20 @@
PtrTestCase::PtrTestCase (void)
: TestCase ("Sanity checking of Ptr<>")
-{}
-void
+{
+}
+void
PtrTestCase::DestroyNotify (void)
{
m_nDestroyed++;
}
-Ptr<NoCount>
+Ptr<NoCount>
PtrTestCase::CallTest (Ptr<NoCount> p)
{
return p;
}
-Ptr<NoCount> const
+Ptr<NoCount> const
PtrTestCase::CallTestConst (Ptr<NoCount> const p)
{
return p;
@@ -263,7 +267,7 @@
{
public:
PtrTestSuite ()
- : TestSuite ("ptr", UNIT)
+ : TestSuite ("ptr", UNIT)
{
AddTestCase (new PtrTestCase ());
}
--- a/src/core/test/rng-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/rng-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -31,7 +31,7 @@
{
double increment = (end - start) / (n - 1.);
double d = start;
-
+
for (uint32_t i = 0; i < n; ++i)
{
array[i] = d;
@@ -98,7 +98,7 @@
{
chiSquared += tmp[i];
}
-
+
return chiSquared;
}
@@ -195,7 +195,7 @@
{
chiSquared += tmp[i];
}
-
+
return chiSquared;
}
@@ -291,7 +291,7 @@
{
chiSquared += tmp[i];
}
-
+
return chiSquared;
}
@@ -388,7 +388,7 @@
{
chiSquared += tmp[i];
}
-
+
return chiSquared;
}
--- a/src/core/test/sample-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/sample-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -7,7 +7,7 @@
// to use the using directive to access the ns3 namespace directly
using namespace ns3;
-// This is an example TestCase.
+// This is an example TestCase.
class SampleTestCase1 : public TestCase
{
public:
--- a/src/core/test/simulator-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/simulator-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -53,13 +53,14 @@
: TestCase ("Check that basic event handling is working with " +
schedulerFactory.GetTypeId ().GetName ()),
m_schedulerFactory (schedulerFactory)
-{}
+{
+}
uint64_t
SimulatorEventsTestCase::NowUs (void)
{
uint64_t ns = Now ().GetNanoSeconds ();
return ns / 1000;
-}
+}
void
SimulatorEventsTestCase::A (int a)
@@ -249,7 +250,8 @@
SimulatorTemplateTestCase::SimulatorTemplateTestCase ()
: TestCase ("Check that all templates are instanciated correctly. This is a compilation test, it cannot fail at runtime.")
-{}
+{
+}
void
SimulatorTemplateTestCase::DoRun (void)
{
--- a/src/core/test/time-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/time-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -39,7 +39,8 @@
TimeSimpleTestCase::TimeSimpleTestCase (enum Time::Unit resolution)
: TestCase ("Sanity check of common time operations"),
m_resolution (resolution)
-{}
+{
+}
void
TimeSimpleTestCase::DoSetup (void)
--- a/src/core/test/type-traits-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/type-traits-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -39,12 +39,12 @@
void
TypeTraitsTestCase::DoRun (void)
{
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void)>::IsPointerToMember, 1, "Check");
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void) const>::IsPointerToMember, 1, "Check");
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int)>::IsPointerToMember, 1, "Check");
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int) const>::IsPointerToMember, 1, "Check");
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void) const>::PointerToMemberTraits::nArgs, 0, "Check");
- NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int) const>::PointerToMemberTraits::nArgs, 1, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void)>::IsPointerToMember, 1, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void) const>::IsPointerToMember, 1, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int)>::IsPointerToMember, 1, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int) const>::IsPointerToMember, 1, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void) const>::PointerToMemberTraits::nArgs, 0, "Check");
+ NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int) const>::PointerToMemberTraits::nArgs, 1, "Check");
}
class TypeTraitsTestSuite : public TestSuite
--- a/src/core/test/watchdog-test-suite.cc Fri May 13 14:51:51 2011 -0400
+++ b/src/core/test/watchdog-test-suite.cc Fri May 13 14:52:27 2011 -0400
@@ -35,7 +35,8 @@
WatchdogTestCase::WatchdogTestCase()
: TestCase ("Check that we can keepalive a watchdog")
-{}
+{
+}
void
WatchdogTestCase::Expire (Time expected)