/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/ers/ers-00-00-03/src/Precondition.cxx

Go to the documentation of this file.
00001 /*
00002  *  Precondition.cxx
00003  *  ers
00004  *
00005  *  Created by Matthias Wiesmann on 08.12.04.
00006  *  Copyright 2004 CERN. All rights reserved.
00007  *
00008  */
00009 
00010 #include "ers/Precondition.h"
00011 #include <iostream>
00012 #include <sstream>
00013 
00014 const char * const ers::Precondition::PRECONDITION_CLASS = "ers::Precondition" ; 
00015 
00016 namespace {
00017     ers::Issue *create_issue() { return new ers::Precondition(); } 
00018     bool registered = ers::IssueFactory::instance()->register_issue(ers::Precondition::PRECONDITION_CLASS,create_issue) ;
00019 } // anonymous context
00020 
00024 ers::Precondition::Precondition() : Assertion() {} 
00025 
00032 ers::Precondition::Precondition(const Context &c, severity_t s) : Assertion(c,s) {}  
00033 
00042 ers::Precondition::Precondition(const Context &context, severity_t s, const char*condition, const std::string &msg , bool constant_expression) : Assertion(context,s) {
00043     this->setup(condition,msg,constant_expression); 
00044 } // Precondition
00045 
00048 const char* ers::Precondition::get_class_name() const throw () { return PRECONDITION_CLASS ;} 
00049 
00057 std::string ers::Precondition::build_message(const char* condition_text, const std::string &msg, bool constant_expression) throw() {
00058     std::ostringstream m ;
00059     m << "Precondition '" << condition_text << "' failed: " << msg ;
00060     if (constant_expression) {
00061         m << " (this condition is constant)" ; 
00062     } // constant expression 
00063     return m.str();
00064 } // build_message

Generated on Tue Nov 29 22:58:27 2016 for BOSS_7.0.2 by  doxygen 1.4.7