CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

edm::ErrorObj Class Reference

#include <ErrorObj.h>

List of all members.

Public Member Functions

virtual void clear ()
ELstring context () const
virtual ErrorObjemitToken (const ELstring &txt)
 ErrorObj (const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
 ErrorObj (const ErrorObj &orig)
ELstring fullText () const
const ELstringidOverflow () const
bool is_verbatim () const
const ELlist_stringitems () const
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
ErrorObjoperator<< (std::ios_base &(*f)(std::ios_base &))
template<class T >
ErrorObjopltlt (const T &t)
ErrorObjopltlt (const char s[])
bool reactedTo () const
int serial () const
virtual void set (const ELseverityLevel &sev, const ELstring &id)
virtual void setContext (const ELstring &context)
virtual void setID (const ELstring &ID)
virtual void setModule (const ELstring &module)
virtual void setProcess (const ELstring &proc)
virtual void setReactedTo (bool r)
virtual void setSeverity (const ELseverityLevel &sev)
virtual void setSubroutine (const ELstring &subroutine)
time_t timestamp () const
const ELextendedIDxid () const
virtual ~ErrorObj ()

Private Attributes

std::string emptyString
ELstring myContext
ELstring myIdOverflow
ELlist_string myItems
std::ostringstream myOs
bool myReactedTo
int mySerial
time_t myTimestamp
ELextendedID myXid
bool verbatim

Static Private Attributes

static int ourSerial

Detailed Description

Definition at line 51 of file ErrorObj.h.


Constructor & Destructor Documentation

edm::ErrorObj::ErrorObj ( const ELseverityLevel sev,
const ELstring id,
bool  verbatim = false 
)

Definition at line 79 of file ErrorObj.cc.

References benchmark_cfg::cerr, and clear().

                                   : verbatim(verbat) {

  #ifdef ErrorObjCONSTRUCTOR_TRACE
    std::cerr << "Constructor for ErrorObj\n";
  #endif

  clear();
  set( sev, id );

}  // ErrorObj()
edm::ErrorObj::ErrorObj ( const ErrorObj orig)

Definition at line 93 of file ErrorObj.cc.

References benchmark_cfg::cerr.

                                           :
          mySerial        ( orig.mySerial )
        , myXid           ( orig.myXid )
        , myIdOverflow    ( orig.myIdOverflow )
        , myTimestamp     ( orig.myTimestamp )
        , myItems         ( orig.myItems )
        , myReactedTo     ( orig.myReactedTo )
        , myOs            ( )
        , emptyString     ( )
        , verbatim        ( orig.verbatim )
{

  #ifdef ErrorObjCONSTRUCTOR_TRACE
    std::cerr << "Copy Constructor for ErrorObj\n";
  #endif

}  // ErrorObj(ErrorObj)
edm::ErrorObj::~ErrorObj ( ) [virtual]

Definition at line 112 of file ErrorObj.cc.

References benchmark_cfg::cerr.

                     {

  #ifdef ErrorObjCONSTRUCTOR_TRACE
    std::cerr << "Destructor for ErrorObj\n";
  #endif

}  // ~ErrorObj()

Member Function Documentation

void edm::ErrorObj::clear ( void  ) [virtual]

Definition at line 242 of file ErrorObj.cc.

References edm::ELextendedID::clear(), myIdOverflow, myItems, myReactedTo, mySerial, myTimestamp, and myXid.

Referenced by edm::service::ELadministrator::clearMsg(), ErrorObj(), edm::service::ELtsErrorLog::initiateMsg(), and set().

                      {

  mySerial     = 0;
  myXid.clear();
  myIdOverflow = "";
  myTimestamp  = 0;
  myItems.erase( myItems.begin(), myItems.end() );  // myItems.clear();
  myReactedTo  = false;

}  // clear()
ELstring edm::ErrorObj::context ( ) const

Definition at line 133 of file ErrorObj.cc.

References myContext.

Referenced by edm::service::MessageLoggerScribe::log(), and edm::ELlog4cplus::log().

                                 {
  return myContext;
}
ErrorObj & edm::ErrorObj::emitToken ( const ELstring txt) [virtual]

Definition at line 200 of file ErrorObj.cc.

References benchmark_cfg::cerr, edm::eq_nocase(), myItems, and setSubroutine().

Referenced by edm::service::ErrorLog::emitToken(), edm::service::ELtsErrorLog::item(), edm::service::ELerrorList::log(), and opltlt().

                                                    {

  #ifdef ErrorObj_EMIT_TRACE
    std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
  #endif

  #ifdef ErrorObj_SUB_TRACE
    if ( subN > 0 )  {
      std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
      subN--;
    }
  #endif

  if ( eq_nocase(s.substr(0,5), "@SUB=" ) )  {
    #ifdef ErrorObj_SUB_TRACE
      std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5)
                << '\n';
    #endif
    setSubroutine(s.substr(5));
  }
  else  {
    myItems.push_back( s );
  }

  return * this;

}  // emitToken()
ELstring edm::ErrorObj::fullText ( ) const

Definition at line 137 of file ErrorObj.cc.

References myItems, and query::result.

                                   {

  ELstring result;
  for ( ELlist_string::const_iterator it = myItems.begin();
        it != myItems.end();
        ++it )
    result +=  *it;
  return result;

}  // fullText()
const ELstring & edm::ErrorObj::idOverflow ( ) const

Definition at line 127 of file ErrorObj.cc.

References myIdOverflow.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

{ return myIdOverflow; }
bool edm::ErrorObj::is_verbatim ( ) const

Definition at line 131 of file ErrorObj.cc.

References verbatim.

Referenced by edm::service::ELoutput::log().

{ return verbatim; }
const ELlist_string & edm::ErrorObj::items ( ) const
ErrorObj& edm::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f) [inline]
ErrorObj& edm::ErrorObj::operator<< ( std::ostream &(*)(std::ostream &)  f) [inline]
ErrorObj & edm::ErrorObj::opltlt ( const char  s[])

Definition at line 254 of file ErrorObj.cc.

References emitToken(), emptyString, myOs, asciidump::s, and verbatim.

                                  {
  // Exactly equivalent to the general template. 
  // If this is not provided explicitly, then the template will
  // be instantiated once for each length of string ever used.
  myOs.str(emptyString); 
  myOs << s;
#ifdef OLD_STYLE_AUTOMATIC_SPACES
  if ( ! myOs.str().empty() ) {
    if ( !verbatim ) {
      emitToken( myOs.str() + ' ' );
    } else {
       emitToken( myOs.str() );
    }
  }
#else
  if ( ! myOs.str().empty() ) emitToken( myOs.str() );
#endif
  return *this;
}
template<class T >
ErrorObj& edm::ErrorObj::opltlt ( const T t) [inline]

Referenced by edm::operator<<().

bool edm::ErrorObj::reactedTo ( ) const

Definition at line 130 of file ErrorObj.cc.

References myReactedTo.

Referenced by edm::service::ELstatistics::log().

{ return myReactedTo; }
int edm::ErrorObj::serial ( ) const

Definition at line 125 of file ErrorObj.cc.

References mySerial.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

{ return mySerial; }
void edm::ErrorObj::set ( const ELseverityLevel sev,
const ELstring id 
) [virtual]
void edm::ErrorObj::setContext ( const ELstring context) [virtual]

Definition at line 170 of file ErrorObj.cc.

References trackerHits::c, and myContext.

Referenced by edm::MessageSender::~MessageSender().

{ myContext = c; }
void edm::ErrorObj::setID ( const ELstring ID) [virtual]

Definition at line 161 of file ErrorObj.cc.

References edm::ELextendedID::id, edm::maxIDlength(), myIdOverflow, and myXid.

Referenced by edm::service::MessageLoggerScribe::log(), and set().

                                           {
  myXid.id = ELstring( id, 0, maxIDlength );
  if ( id.length() > maxIDlength )
    myIdOverflow = ELstring( id, maxIDlength, id.length()-maxIDlength );
}
void edm::ErrorObj::setModule ( const ELstring module) [virtual]
void edm::ErrorObj::setProcess ( const ELstring proc) [virtual]

Definition at line 183 of file ErrorObj.cc.

References benchmark_cfg::cerr, myXid, proc, and edm::ELextendedID::process.

Referenced by edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

                                                  {
  myXid.process = proc;
  #if 0
    std::cerr << "ErrorObj process set to \"" << proc << "\"\n";
  #endif
}
void edm::ErrorObj::setReactedTo ( bool  r) [virtual]
void edm::ErrorObj::setSeverity ( const ELseverityLevel sev) [virtual]

Definition at line 153 of file ErrorObj.cc.

References edm::ELfatal, edm::ELhighestSeverity, edm::ELincidental, edm::ELzeroSeverity, myXid, and edm::ELextendedID::severity.

Referenced by set().

                                                         {
  myXid.severity = (sev <= ELzeroSeverity   ) ? (ELseverityLevel)ELincidental
                 : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELfatal
                 :                              sev
                 ;
}
void edm::ErrorObj::setSubroutine ( const ELstring subroutine) [virtual]

Definition at line 173 of file ErrorObj.cc.

References benchmark_cfg::cerr, myXid, and edm::ELextendedID::subroutine.

Referenced by emitToken(), edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

                                                           {
  #ifdef ErrorObj_SUB_TRACE
    std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
  #endif
  myXid.subroutine = (subroutine[0] == ' ')
                   ? subroutine.substr(1)
                   : subroutine;
}
time_t edm::ErrorObj::timestamp ( ) const

Definition at line 128 of file ErrorObj.cc.

References myTimestamp.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

{ return myTimestamp; }
const ELextendedID & edm::ErrorObj::xid ( ) const

Member Data Documentation

std::string edm::ErrorObj::emptyString [private]

Definition at line 116 of file ErrorObj.h.

Referenced by opltlt().

Definition at line 114 of file ErrorObj.h.

Referenced by context(), and setContext().

Definition at line 110 of file ErrorObj.h.

Referenced by clear(), idOverflow(), and setID().

Definition at line 112 of file ErrorObj.h.

Referenced by clear(), emitToken(), fullText(), and items().

std::ostringstream edm::ErrorObj::myOs [private]

Definition at line 115 of file ErrorObj.h.

Referenced by opltlt().

Definition at line 113 of file ErrorObj.h.

Referenced by clear(), reactedTo(), and setReactedTo().

int edm::ErrorObj::mySerial [private]

Definition at line 108 of file ErrorObj.h.

Referenced by clear(), serial(), and set().

time_t edm::ErrorObj::myTimestamp [private]

Definition at line 111 of file ErrorObj.h.

Referenced by clear(), set(), and timestamp().

Definition at line 109 of file ErrorObj.h.

Referenced by clear(), setID(), setModule(), setProcess(), setSeverity(), setSubroutine(), and xid().

int edm::ErrorObj::ourSerial [static, private]

Definition at line 104 of file ErrorObj.h.

Referenced by set().

bool edm::ErrorObj::verbatim [private]

Definition at line 117 of file ErrorObj.h.

Referenced by is_verbatim(), and opltlt().