Add emitMessage, emitError, and emitWarning member functions to MemoryMananger

This commit is contained in:
John M. Penn 2015-03-23 17:21:35 -05:00
parent 48a09d386e
commit e2be23c269
2 changed files with 22 additions and 0 deletions

View File

@ -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<ALLOC_INFO*>& dependencies);
/**

View File

@ -94,3 +94,21 @@ Trick::MemoryManager::~MemoryManager() {
}
alloc_info_map.clear() ;
}
#include <sstream>
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() );
}