Aspect-based implementation of fast breakpoints added (optional).
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1685 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
49
src/core/sal/perf/BreakpointControllerSlice.ah
Normal file
49
src/core/sal/perf/BreakpointControllerSlice.ah
Normal file
@ -0,0 +1,49 @@
|
||||
#ifndef __BREAKPOINT_CONTROLLER_SLICE_AH__
|
||||
#define __BREAKPOINT_CONTROLLER_SLICE_AH__
|
||||
|
||||
#include "config/FailConfig.hpp"
|
||||
|
||||
#ifdef CONFIG_FAST_BREAKPOINTS
|
||||
|
||||
#include <iostream>
|
||||
#include "../Listener.hpp"
|
||||
|
||||
/**
|
||||
* \class BreakpointControllerSlice
|
||||
*
|
||||
* The slice class definition to be used with FastBreakpoint.ah.
|
||||
* The members of this class will be sliced into the \c SimulatorController class.
|
||||
*/
|
||||
slice class BreakpointControllerSlice {
|
||||
public:
|
||||
bool addListener(fail::BPSingleListener* sli)
|
||||
{
|
||||
assert(sli != NULL && "FATAL ERROR: Argument (ptr) cannot be NULL!");
|
||||
m_LstList.add(sli, m_Flows.getCurrent());
|
||||
// Call the common postprocessing function:
|
||||
if (!sli->onAddition()) { // If the return value signals "false"...,
|
||||
m_LstList.remove(sli); // ...skip the addition
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
fail::BaseListener* addListenerAndResume(fail::BPSingleListener* sli)
|
||||
{ addListener(sli); return resume(); }
|
||||
bool addListener(fail::BPRangeListener* rli)
|
||||
{
|
||||
assert(rli != NULL && "FATAL ERROR: Argument (ptr) cannot be NULL!");
|
||||
m_LstList.add(rli, m_Flows.getCurrent());
|
||||
// Call the common postprocessing function:
|
||||
if (!rli->onAddition()) { // If the return value signals "false"...,
|
||||
m_LstList.remove(rli); // ...skip the addition
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
fail::BaseListener* addListenerAndResume(fail::BPRangeListener* rli)
|
||||
{ addListener(rli); return resume(); }
|
||||
};
|
||||
|
||||
#endif // CONFIG_FAST_BREAKPOINTS
|
||||
|
||||
#endif // __BREAKPOINT_CONTROLLER_SLICE_AH__
|
||||
Reference in New Issue
Block a user