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 ErrorObj &orig)
 ErrorObj (const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
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 &))
ErrorObjoperator= (const ErrorObj &other)
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)
void swap (ErrorObj &other)
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 dtNoiseDBValidation_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 dtNoiseDBValidation_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 dtNoiseDBValidation_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 262 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 153 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 220 of file ErrorObj.cc.

References dtNoiseDBValidation_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 157 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 147 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 151 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::ostream &(*)(std::ostream &)  f) [inline]
ErrorObj& edm::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f) [inline]
ErrorObj & edm::ErrorObj::operator= ( const ErrorObj other)

Definition at line 120 of file ErrorObj.cc.

References swap(), and groupFilesInBlocks::temp.

                                                      {
  ErrorObj temp(other);
  this->swap(temp);
  return *this;
}
template<class T >
ErrorObj& edm::ErrorObj::opltlt ( const T t) [inline]

Referenced by edm::operator<<().

ErrorObj & edm::ErrorObj::opltlt ( const char  s[])

Definition at line 274 of file ErrorObj.cc.

References emitToken(), emptyString, myOs, alignCSCRings::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;
}
bool edm::ErrorObj::reactedTo ( ) const

Definition at line 150 of file ErrorObj.cc.

References myReactedTo.

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

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

Definition at line 145 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 190 of file ErrorObj.cc.

References trackerHits::c, and myContext.

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

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

Definition at line 181 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 203 of file ErrorObj.cc.

References dtNoiseDBValidation_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 173 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 193 of file ErrorObj.cc.

References dtNoiseDBValidation_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;
}
void edm::ErrorObj::swap ( ErrorObj other)

Definition at line 126 of file ErrorObj.cc.

References emptyString, myContext, myIdOverflow, myItems, myOs, myReactedTo, mySerial, myTimestamp, myXid, groupFilesInBlocks::temp, and verbatim.

Referenced by operator=(), edm::swap(), and edm::service::ELtsErrorLog::swap().

                                     {
  std::swap(mySerial, other.mySerial);
  std::swap(myXid, other.myXid);
  myIdOverflow.swap(other.myIdOverflow);
  std::swap(myTimestamp, other.myTimestamp);
  myItems.swap(other.myItems);
  std::swap(myReactedTo, other.myReactedTo);
  myContext.swap(other.myContext);
  std::string temp(other.myOs.str());
  other.myOs.str(myOs.str());
  myOs.str(temp);
  emptyString.swap(other.emptyString);
  std::swap(verbatim, other.verbatim);
}
time_t edm::ErrorObj::timestamp ( ) const

Definition at line 148 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 118 of file ErrorObj.h.

Referenced by opltlt(), and swap().

Definition at line 116 of file ErrorObj.h.

Referenced by context(), setContext(), and swap().

Definition at line 112 of file ErrorObj.h.

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

Definition at line 114 of file ErrorObj.h.

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

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

Definition at line 117 of file ErrorObj.h.

Referenced by opltlt(), and swap().

Definition at line 115 of file ErrorObj.h.

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

int edm::ErrorObj::mySerial [private]

Definition at line 110 of file ErrorObj.h.

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

time_t edm::ErrorObj::myTimestamp [private]

Definition at line 113 of file ErrorObj.h.

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

Definition at line 111 of file ErrorObj.h.

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

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

Definition at line 106 of file ErrorObj.h.

Referenced by set().

bool edm::ErrorObj::verbatim [private]

Definition at line 119 of file ErrorObj.h.

Referenced by is_verbatim(), opltlt(), and swap().