Merge "core/sal: Added features that indicate whether FAIL* is initialized"

This commit is contained in:
Richard Hellwig
2014-01-21 15:35:22 +01:00
committed by Gerrit Code Review
2 changed files with 11 additions and 2 deletions

View File

@ -50,6 +50,9 @@ void SimulatorController::startup()
std::cout << "[SimulatorController] Initializing..." << std::endl; std::cout << "[SimulatorController] Initializing..." << std::endl;
// TODO: Log-Level? // TODO: Log-Level?
// Set Fail* as initialized
m_isInitialized = true;
// Activate previously added experiments to allow initialization: // Activate previously added experiments to allow initialization:
initExperiments(); initExperiments();
} }

View File

@ -34,14 +34,15 @@ class MemoryManager;
*/ */
class SimulatorController { class SimulatorController {
protected: protected:
bool m_isInitialized;
ListenerManager m_LstList; //!< storage where listeners are being buffered ListenerManager m_LstList; //!< storage where listeners are being buffered
CoroutineManager m_Flows; //!< managed experiment flows CoroutineManager m_Flows; //!< managed experiment flows
MemoryManager *m_Mem; //!< access to memory pool MemoryManager *m_Mem; //!< access to memory pool
std::vector<ConcreteCPU*> m_CPUs; //!< list of CPUs in the target system std::vector<ConcreteCPU*> m_CPUs; //!< list of CPUs in the target system
friend class ListenerManager; //!< "outsources" the listener management friend class ListenerManager; //!< "outsources" the listener management
public: public:
SimulatorController() : m_Mem(NULL) { } SimulatorController() : m_isInitialized(false), m_Mem(NULL) { }
SimulatorController(MemoryManager* mem) : m_Mem(mem) { } SimulatorController(MemoryManager* mem) : m_isInitialized(false), m_Mem(mem) { }
virtual ~SimulatorController() { } virtual ~SimulatorController() { }
/** /**
* @brief Initialization function each implementation needs to call on * @brief Initialization function each implementation needs to call on
@ -251,6 +252,11 @@ public:
* @see SimulatorController::getTimerTicks() * @see SimulatorController::getTimerTicks()
*/ */
virtual simtime_t getTimerTicksPerSecond() { return 0; } virtual simtime_t getTimerTicksPerSecond() { return 0; }
/**
* Returns whether FAIL* has already been initialized.
* @return A Boolean, indicating whether FAIL* has been initialized.
*/
bool isInitialized() { return m_isInitialized; }
}; };
} // end-of-namespace: fail } // end-of-namespace: fail