fix bug 230, rescan bindings

This commit is contained in:
mathieu.
2008-12-10 17:01:06 -08:00
parent c915a078d8
commit 691ce0fdde
9 changed files with 33 additions and 75 deletions

View File

@@ -1906,7 +1906,7 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls):
cls.add_method('ConnectWithoutContext',
'void',
[param('ns3::CallbackBase const &', 'cb')])
## traced-value.h: void ns3::TracedValue<unsigned int>::Connect(ns3::CallbackBase const & cb, std::string path) [member function]
## traced-value.h: void ns3::TracedValue<unsigned int>::Connect(ns3::CallbackBase const & cb, std::basic_string<char,std::char_traits<char>,std::allocator<char> > path) [member function]
cls.add_method('Connect',
'void',
[param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')])
@@ -1914,7 +1914,7 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls):
cls.add_method('DisconnectWithoutContext',
'void',
[param('ns3::CallbackBase const &', 'cb')])
## traced-value.h: void ns3::TracedValue<unsigned int>::Disconnect(ns3::CallbackBase const & cb, std::string path) [member function]
## traced-value.h: void ns3::TracedValue<unsigned int>::Disconnect(ns3::CallbackBase const & cb, std::basic_string<char,std::char_traits<char>,std::allocator<char> > path) [member function]
cls.add_method('Disconnect',
'void',
[param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')])

View File

@@ -764,11 +764,6 @@ def register_Ns3SimulatorImpl_methods(root_module, cls):
'void',
[],
is_pure_virtual=True, is_virtual=True)
## simulator-impl.h: void ns3::SimulatorImpl::Stop(ns3::Time const & time) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'time')],
is_pure_virtual=True, is_virtual=True)
## simulator-impl.h: ns3::EventId ns3::SimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
cls.add_method('Schedule',
'ns3::EventId',
@@ -1101,11 +1096,6 @@ def register_Ns3DefaultSimulatorImpl_methods(root_module, cls):
'void',
[],
is_virtual=True)
## default-simulator-impl.h: void ns3::DefaultSimulatorImpl::Stop(ns3::Time const & time) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'time')],
is_virtual=True)
## default-simulator-impl.h: ns3::EventId ns3::DefaultSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
cls.add_method('Schedule',
'ns3::EventId',
@@ -1299,11 +1289,6 @@ def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls):
'void',
[],
is_virtual=True)
## realtime-simulator-impl.h: void ns3::RealtimeSimulatorImpl::Stop(ns3::Time const & time) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'time')],
is_virtual=True)
## realtime-simulator-impl.h: ns3::EventId ns3::RealtimeSimulatorImpl::Schedule(ns3::Time const & time, ns3::EventImpl * event) [member function]
cls.add_method('Schedule',
'ns3::EventId',

View File

@@ -17,6 +17,8 @@ def register_types(module):
module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class]
module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
## sqlite-data-output.h: ns3::SqliteDataOutput [class]
module.add_class('SqliteDataOutput', parent=root_module['ns3::DataOutputInterface'])
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class]
module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator'])
## basic-data-calculators.h: ns3::CounterCalculator<unsigned int> [class]
@@ -72,6 +74,7 @@ def register_methods(root_module):
register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
register_Ns3OmnetDataOutput_methods(root_module, root_module['ns3::OmnetDataOutput'])
register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator'])
register_Ns3SqliteDataOutput_methods(root_module, root_module['ns3::SqliteDataOutput'])
register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::TimeMinMaxAvgTotalCalculator'])
register_Ns3CounterCalculator__Unsigned_int_methods(root_module, root_module['ns3::CounterCalculator< unsigned int >'])
register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator'])
@@ -315,6 +318,32 @@ def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls):
visibility='protected', is_virtual=True)
return
def register_Ns3SqliteDataOutput_methods(root_module, cls):
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput(ns3::SqliteDataOutput const & arg0) [copy constructor]
cls.add_constructor([param('ns3::SqliteDataOutput const &', 'arg0')])
## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput() [constructor]
cls.add_constructor([])
## sqlite-data-output.h: void ns3::SqliteDataOutput::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_virtual=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::SetDBFile(std::string const file) [member function]
cls.add_method('SetDBFile',
'void',
[param('std::string const', 'file')])
## sqlite-data-output.h: std::string ns3::SqliteDataOutput::GetDBFile() const [member function]
cls.add_method('GetDBFile',
'std::string',
[],
is_const=True)
## sqlite-data-output.h: void ns3::SqliteDataOutput::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, cls):
## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator(ns3::TimeMinMaxAvgTotalCalculator const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TimeMinMaxAvgTotalCalculator const &', 'arg0')])

View File

@@ -49,7 +49,6 @@ DefaultSimulatorImpl::GetTypeId (void)
DefaultSimulatorImpl::DefaultSimulatorImpl ()
{
m_stop = false;
m_stopAt = 0;
// uids are allocated from 4.
// uid 0 is "invalid" events
// uid 1 is "now" events
@@ -146,8 +145,7 @@ void
DefaultSimulatorImpl::Run (void)
{
while (!m_events->IsEmpty () && !m_stop &&
(m_stopAt == 0 || m_stopAt > NextTs ()))
while (!m_events->IsEmpty () && !m_stop)
{
ProcessOneEvent ();
}
@@ -169,13 +167,6 @@ DefaultSimulatorImpl::Stop (void)
m_stop = true;
}
void
DefaultSimulatorImpl::Stop (Time const &time)
{
NS_ASSERT (time.IsPositive ());
Time absolute = Simulator::Now () + time;
m_stopAt = absolute.GetTimeStep ();
}
//
// Schedule an event for a _relative_ time in the future.

View File

@@ -45,7 +45,6 @@ public:
virtual bool IsFinished (void) const;
virtual Time Next (void) const;
virtual void Stop (void);
virtual void Stop (Time const &time);
virtual EventId Schedule (Time const &time, EventImpl *event);
virtual EventId ScheduleNow (EventImpl *event);
virtual EventId ScheduleDestroy (EventImpl *event);
@@ -66,7 +65,6 @@ private:
typedef std::list<EventId> DestroyEvents;
DestroyEvents m_destroyEvents;
uint64_t m_stopAt;
bool m_stop;
Ptr<Scheduler> m_events;
uint32_t m_uid;

View File

@@ -68,7 +68,6 @@ RealtimeSimulatorImpl::RealtimeSimulatorImpl ()
NS_LOG_FUNCTION_NOARGS ();
m_stop = false;
m_stopAt = 0;
m_running = false;
// uids are allocated from 4.
// uid 0 is "invalid" events
@@ -441,16 +440,6 @@ RealtimeSimulatorImpl::Run (void)
{
done = true;
}
//
// We also want to stop the simulator at some time even if there are events
// that have been scheduled out in the future. If we're in realtime mode, we
// actually have time passing, so we must look at the realtime clock to see if
// we're past the end time.
//
if (m_stopAt && m_stopAt <= m_synchronizer->GetCurrentRealtime ())
{
done = true;
}
}
if (done)
@@ -539,37 +528,6 @@ RealtimeSimulatorImpl::Stop (void)
m_stop = true;
}
static void Placeholder (void) {}
//
// Schedule a stop for a _relative_ time in the future. If the simulation
// hasn't started yet, this will effectively be an absolute time.
//
void
RealtimeSimulatorImpl::Stop (Time const &time)
{
NS_LOG_FUNCTION (time);
Time tAbsolute = Simulator::Now () + time;
NS_ASSERT (tAbsolute.IsPositive ());
NS_ASSERT (tAbsolute >= TimeStep (m_currentTs));
m_stopAt = tAbsolute.GetTimeStep ();
//
// For the realtime case, we need a real event sitting out at the end of time
// to keep the simulator running (sleeping) while there are no other events
// present. If an "external" device in another thread decides to schedule an
// event, the sleeping synchronizer will be awakened and the new event will
// be run.
//
// The easiest thing to do is to call back up into the simulator to take
// advantage of all of the nice event wrappers. This will call back down into
// RealtimeSimulatorImpl::Schedule to do the work. This path interprets the
// time as relative, so pass the relative time.
//
Simulator::Schedule (time, &Placeholder);
}
//
// Schedule an event for a _relative_ time in the future.
//

View File

@@ -55,7 +55,6 @@ public:
virtual bool IsFinished (void) const;
virtual Time Next (void) const;
virtual void Stop (void);
virtual void Stop (Time const &time);
virtual EventId Schedule (Time const &time, EventImpl *event);
virtual EventId ScheduleNow (EventImpl *event);
virtual EventId ScheduleDestroy (EventImpl *event);
@@ -89,7 +88,6 @@ private:
typedef std::list<EventId> DestroyEvents;
DestroyEvents m_destroyEvents;
uint64_t m_stopAt;
bool m_stop;
bool m_running;

View File

@@ -38,7 +38,6 @@ public:
virtual bool IsFinished (void) const = 0;
virtual Time Next (void) const = 0;
virtual void Stop (void) = 0;
virtual void Stop (Time const &time) = 0;
virtual EventId Schedule (Time const &time, EventImpl *event) = 0;
virtual EventId ScheduleNow (EventImpl *event) = 0;
virtual EventId ScheduleDestroy (EventImpl *event) = 0;

View File

@@ -169,7 +169,7 @@ void
Simulator::Stop (Time const &time)
{
NS_LOG_FUNCTION (time);
GetImpl ()->Stop (time);
Simulator::Schedule (time, &Simulator::Stop);
}
Time