Skip to content

Commit

Permalink
Merge pull request #31530 from makortel/removeELstring
Browse files Browse the repository at this point in the history
Remove edm::ELstring
  • Loading branch information
cmsbuild committed Sep 24, 2020
2 parents ddf1f0e + 3b718ff commit 612ee25
Show file tree
Hide file tree
Showing 22 changed files with 282 additions and 424 deletions.
9 changes: 5 additions & 4 deletions FWCore/MessageLogger/interface/ELextendedID.h
Expand Up @@ -12,9 +12,10 @@
//
// ----------------------------------------------------------------------

#include "FWCore/MessageLogger/interface/ELstring.h"
#include "FWCore/MessageLogger/interface/ELseverityLevel.h"

#include <string>

namespace edm {

// ----------------------------------------------------------------------
Expand All @@ -25,10 +26,10 @@ namespace edm {
public:
// ----- Publicly accessible data members:
//
ELstring id;
std::string id;
ELseverityLevel severity;
ELstring module;
ELstring subroutine;
std::string module;
std::string subroutine;

// ----- Comparator:
//
Expand Down
7 changes: 2 additions & 5 deletions FWCore/MessageLogger/interface/ELlist.h
Expand Up @@ -20,11 +20,8 @@
//
// ----------------------------------------------------------------------

#ifndef ELSTRING_H
#include "FWCore/MessageLogger/interface/ELstring.h"
#endif

#include <list>
#include <string>

namespace edm {

Expand All @@ -33,7 +30,7 @@ namespace edm {
class ELdestination;
typedef std::list<ELdestination *> ELlist_dest;

typedef std::list<ELstring> ELlist_string;
typedef std::list<std::string> ELlist_string;

// ----------------------------------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions FWCore/MessageLogger/interface/ELmap.h
Expand Up @@ -32,8 +32,8 @@
// ----------------------------------------------------------------------

#include <map>
#include <string>

#include "FWCore/MessageLogger/interface/ELstring.h"
#include "FWCore/MessageLogger/interface/ELextendedID.h"

namespace edm {
Expand Down Expand Up @@ -70,18 +70,18 @@ namespace edm {
int n;
int aggregateN;
bool ignoredFlag;
ELstring context1;
ELstring context2;
ELstring contextLast;
std::string context1;
std::string context2;
std::string contextLast;

StatsCount();
void add(const ELstring& context, bool reactedTo);
void add(std::string_view context, bool reactedTo);

}; // StatsCount

// ----------------------------------------------------------------------

typedef std::map<ELstring, LimitAndTimespan> ELmap_limits;
typedef std::map<std::string, LimitAndTimespan> ELmap_limits;

typedef std::map<ELextendedID, CountAndLimit> ELmap_counts;

Expand Down
23 changes: 11 additions & 12 deletions FWCore/MessageLogger/interface/ELseverityLevel.h
Expand Up @@ -37,9 +37,8 @@
//
// ----------------------------------------------------------------------

#ifndef ELSTRING_H
#include "FWCore/MessageLogger/interface/ELstring.h"
#endif
#include <string>
#include <string_view>

namespace edm {

Expand Down Expand Up @@ -78,10 +77,10 @@ namespace edm {
// --- forwarding:
//
int getLevel() const;
const ELstring getSymbol() const;
const ELstring getName() const;
const ELstring getInputStr() const;
const ELstring getVarName() const;
const std::string& getSymbol() const;
const std::string& getName() const;
const std::string& getInputStr() const;
const std::string& getVarName() const;

}; // ELslProxy<ELslGen>

Expand Down Expand Up @@ -122,7 +121,7 @@ namespace edm {
// ----- Birth/death:
//
ELseverityLevel(ELsev_ lev = ELsev_unspecified);
ELseverityLevel(ELstring const& str);
ELseverityLevel(std::string_view str);
// str may match getSymbol, getName, getInputStr,
// or getVarName -- see accessors
~ELseverityLevel();
Expand All @@ -134,10 +133,10 @@ namespace edm {
// ----- Accessors:
//
int getLevel() const;
const ELstring getSymbol() const; // example: "-e"
const ELstring getName() const; // example: "Error"
const ELstring getInputStr() const; // example: "ERROR"
const ELstring getVarName() const; // example: "ELerror"
const std::string& getSymbol() const; // example: "-e"
const std::string& getName() const; // example: "Error"
const std::string& getInputStr() const; // example: "ERROR"
const std::string& getVarName() const; // example: "ELerror"

// ----- Emitter:
//
Expand Down
8 changes: 4 additions & 4 deletions FWCore/MessageLogger/interface/ELseverityLevel.icc
Expand Up @@ -45,22 +45,22 @@ namespace edm {
}

template <ELslGen ELgen>
inline const ELstring ELslProxy<ELgen>::getSymbol() const {
inline const std::string& ELslProxy<ELgen>::getSymbol() const {
return ELgen().getSymbol();
}

template <ELslGen ELgen>
inline const ELstring ELslProxy<ELgen>::getName() const {
inline const std::string& ELslProxy<ELgen>::getName() const {
return ELgen().getName();
}

template <ELslGen ELgen>
inline const ELstring ELslProxy<ELgen>::getInputStr() const {
inline const std::string& ELslProxy<ELgen>::getInputStr() const {
return ELgen().getInputStr();
}

template <ELslGen ELgen>
inline const ELstring ELslProxy<ELgen>::getVarName() const {
inline const std::string& ELslProxy<ELgen>::getVarName() const {
return ELgen().getVarName();
}

Expand Down
31 changes: 0 additions & 31 deletions FWCore/MessageLogger/interface/ELstring.h

This file was deleted.

19 changes: 9 additions & 10 deletions FWCore/MessageLogger/interface/ErrorObj.h
Expand Up @@ -21,7 +21,6 @@
//
// ----------------------------------------------------------------------

#include "FWCore/MessageLogger/interface/ELstring.h"
#include "FWCore/MessageLogger/interface/ELlist.h"
#include "FWCore/MessageLogger/interface/ELextendedID.h"
#include "FWCore/MessageLogger/interface/ELseverityLevel.h"
Expand Down Expand Up @@ -55,21 +54,21 @@ namespace edm {
//
int serial() const;
const ELextendedID& xid() const;
const ELstring& idOverflow() const;
const std::string& idOverflow() const;
time_t timestamp() const;
const ELlist_string& items() const;
bool reactedTo() const;
ELstring fullText() const;
ELstring context() const;
std::string fullText() const;
const std::string& context() const;
bool is_verbatim() const;

// mutators:
//
virtual void setSeverity(const ELseverityLevel& sev);
virtual void setID(std::string_view ID);
virtual void setModule(const ELstring& module);
virtual void setSubroutine(const ELstring& subroutine);
virtual void setContext(const std::string_view& context);
virtual void setModule(std::string_view module);
virtual void setSubroutine(std::string_view subroutine);
virtual void setContext(std::string_view context);

// ----- Methods for ErrorLog or for physicists logging errors:
//
Expand All @@ -81,7 +80,7 @@ namespace edm {
template <typename... Args>
inline ErrorObj& format(std::string_view fmt, Args const&... args);

virtual ErrorObj& emitToken(const ELstring& txt);
virtual ErrorObj& emitToken(std::string_view txt);

// --- mutators for use by ELadministrator and ELtsErrorLog
//
Expand All @@ -94,11 +93,11 @@ namespace edm {
//
int mySerial;
ELextendedID myXid;
ELstring myIdOverflow;
std::string myIdOverflow;
time_t myTimestamp;
ELlist_string myItems;
bool myReactedTo;
ELstring myContext;
std::string myContext;
std::ostringstream myOs;
std::string emptyString;
bool verbatim;
Expand Down
1 change: 0 additions & 1 deletion FWCore/MessageLogger/interface/MessageSender.h
@@ -1,7 +1,6 @@
#ifndef FWCore_MessageLogger_MessageSender_h
#define FWCore_MessageLogger_MessageSender_h

#include "FWCore/MessageLogger/interface/ELstring.h"
#include "FWCore/MessageLogger/interface/ELseverityLevel.h"
#include "FWCore/MessageLogger/interface/ErrorObj.h"

Expand Down
4 changes: 2 additions & 2 deletions FWCore/MessageLogger/src/ELmap.cc
Expand Up @@ -116,11 +116,11 @@ namespace edm {

StatsCount::StatsCount() : n(0), aggregateN(0), ignoredFlag(false), context1(""), context2(""), contextLast("") {}

void StatsCount::add(const ELstring& context, bool reactedTo) {
void StatsCount::add(std::string_view context, bool reactedTo) {
++n;
++aggregateN;

((1 == n) ? context1 : (2 == n) ? context2 : contextLast) = ELstring(context, 0, 16);
((1 == n) ? context1 : (2 == n) ? context2 : contextLast) = std::string(context, 0, 16);

if (!reactedTo)
ignoredFlag = true;
Expand Down

0 comments on commit 612ee25

Please sign in to comment.