summaryrefslogtreecommitdiff
path: root/cesar/maximus/scheduler/src/Scheduler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/maximus/scheduler/src/Scheduler.cpp')
-rw-r--r--cesar/maximus/scheduler/src/Scheduler.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/cesar/maximus/scheduler/src/Scheduler.cpp b/cesar/maximus/scheduler/src/Scheduler.cpp
index 4a3e47ed90..45f0edf58d 100644
--- a/cesar/maximus/scheduler/src/Scheduler.cpp
+++ b/cesar/maximus/scheduler/src/Scheduler.cpp
@@ -11,7 +11,6 @@
*
*/
#include "maximus/scheduler/inc/Scheduler.h"
-#include "maximus/scheduler/inc/SchedulerEvent.h"
#include "maximus/processors/inc/PhyProcessor.h"
#include "maximus/processors/inc/ClockProcessor.h"
#include "maximus/utils/inc/Error.h"
@@ -45,13 +44,13 @@ Scheduler::~Scheduler ()
}
inline void
-Scheduler::remove_generic_event (SchedulerEvent &evt)
+Scheduler::remove_generic_event (SchedulerEvent_t &evt)
{
/* Note :
* Polymorphism possible on 'scheduler_drop_event ()'.
* */
- if (evt.get_clock_type () == NETWORK_CLOCK_TYPE_PHY)
- phy_proc.scheduler_drop_event (evt.get_sci_msg ());
+ if (evt.type == NETWORK_CLOCK_TYPE_PHY)
+ phy_proc.scheduler_drop_event (evt.msg);
}
inline void
@@ -73,8 +72,8 @@ Scheduler::add_generic_event (
for (it = range.first ; it != range.second; ++it)
{
- if ((it->second.get_sta_id () == sta_id)
- && (it->second.get_clock_id () == clock_id))
+ if ((it->second.sta_id == sta_id)
+ && (it->second.clock_id == clock_id))
{
is_event_already_exist = true;
break;
@@ -83,13 +82,14 @@ Scheduler::add_generic_event (
assert (!is_event_already_exist);
+ SchedulerEvent_t event = {sta_id, clock_id, evt_type, msg};
+
calendar.insert (
#if CONFIG_SCHEDULER_FASTER
range.first,
#endif
- std::pair <Network_Clock_Tick, SchedulerEvent>
- (tick, SchedulerEvent (sta_id, clock_id,
- evt_type, msg)));
+ std::pair <Network_Clock_Tick, SchedulerEvent_t>
+ (tick, event));
}
void
@@ -160,8 +160,8 @@ Scheduler::remove_event (
for (it = range.first ; it != range.second; ++it)
{
- if ((it->second.get_sta_id () == sta_id)
- && (it->second.get_clock_id () == clock_id))
+ if ((it->second.sta_id == sta_id)
+ && (it->second.clock_id == clock_id))
{
remove_generic_event (it->second);
calendar.erase (it);
@@ -182,7 +182,7 @@ Scheduler::remove_sta_events (
for (it = calendar.begin (); it != calendar.end (); ++it)
{
- if (it->second.get_sta_id () == sta_id)
+ if (it->second.sta_id == sta_id)
{
remove_generic_event (it->second);
todel.push_back (it);
@@ -246,10 +246,10 @@ Scheduler::process_next_event ()
}
else if (!is_calendar_empty)
{
- clock_staid = next->second.get_sta_id ();
- clock_id = next->second.get_clock_id ();
- clock_type = next->second.get_clock_type ();
- clock_msg = next->second.get_sci_msg ();
+ clock_staid = next->second.sta_id;
+ clock_id = next->second.clock_id;
+ clock_type = next->second.type;
+ clock_msg = next->second.msg;
calendar.erase (next);
maximus_log (
@@ -290,10 +290,10 @@ Scheduler::display_calendar () const
{
maximus_log (LOG_INFO, " ["
<< std::hex << it->first << "] = {"
- << "staid (" << std::hex << it->second.get_sta_id () << "), "
- << "id (" << std::hex << it->second.get_clock_id () << "), "
- << "type (" << std::hex << it->second.get_clock_type () << "), "
- << "scimsg* (" << std::hex << it->second.get_sci_msg () << ")},");
+ << "staid (" << std::hex << it->second.sta_id << "), "
+ << "id (" << std::hex << it->second.clock_id << "), "
+ << "type (" << std::hex << it->second.type << "), "
+ << "scimsg* (" << std::hex << it->second.msg << ")},");
}
#endif
}