From e2be23c269f7733f065e7dfd7dcde1fcc53daf7b Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Mon, 23 Mar 2015 17:21:35 -0500 Subject: [PATCH] Add emitMessage, emitError, and emitWarning member functions to MemoryMananger --- .../MemoryManager/include/MemoryManager.hh | 4 ++++ .../MemoryManager/src/MemoryManager.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/trick_source/sim_services/MemoryManager/include/MemoryManager.hh b/trick_source/sim_services/MemoryManager/include/MemoryManager.hh index 8cc8429e..4ee5d760 100644 --- a/trick_source/sim_services/MemoryManager/include/MemoryManager.hh +++ b/trick_source/sim_services/MemoryManager/include/MemoryManager.hh @@ -659,6 +659,10 @@ namespace Trick { int alloc_info_map_counter ; /**< ** counter to assign unique ids to allocations as they are added to map */ int extern_alloc_info_map_counter ; /**< ** counter to assign unique ids to allocations as they are added to map */ + void emitMessage( std::string s); + void emitError( std::string s); + void emitWarning( std::string s); + void write_checkpoint( std::ostream& out_s, std::vector& dependencies); /** diff --git a/trick_source/sim_services/MemoryManager/src/MemoryManager.cpp b/trick_source/sim_services/MemoryManager/src/MemoryManager.cpp index 985290a0..08408d02 100644 --- a/trick_source/sim_services/MemoryManager/src/MemoryManager.cpp +++ b/trick_source/sim_services/MemoryManager/src/MemoryManager.cpp @@ -94,3 +94,21 @@ Trick::MemoryManager::~MemoryManager() { } alloc_info_map.clear() ; } + +#include +void Trick::MemoryManager::emitMessage( std::string s) { + std::cout << s << std::endl; +} + +void Trick::MemoryManager::emitError( std::string s) { + std::stringstream ss; + ss << "Error: " << s << std::endl; + emitMessage( ss.str() ); +} + +void Trick::MemoryManager::emitWarning( std::string s) { + std::stringstream ss; + ss << "Warning: " << s << std::endl; + emitMessage( ss.str() ); +} +