Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:07

0001 #ifndef FWCore_ServiceRegistry_PathContext_h
0002 #define FWCore_ServiceRegistry_PathContext_h
0003 
0004 /**\class edm::PathContext
0005 
0006  Description: This is intended primarily to be passed to
0007 Services as an argument to their callback functions.
0008 
0009  Usage:
0010 
0011 
0012 */
0013 //
0014 // Original Author: W. David Dagenhart
0015 //         Created: 7/10/2013
0016 
0017 #include <iosfwd>
0018 #include <string>
0019 
0020 namespace edm {
0021 
0022   class StreamContext;
0023 
0024   class PathContext {
0025   public:
0026     enum class PathType { kPath, kEndPath };
0027 
0028     PathContext(std::string const& pathName, StreamContext const* streamContext, unsigned int pathID, PathType pathType);
0029 
0030     std::string const& pathName() const { return pathName_; }
0031     StreamContext const* streamContext() const { return streamContext_; }
0032     unsigned int pathID() const { return pathID_; }
0033     PathType pathType() const { return pathType_; }
0034 
0035     bool isEndPath() const { return pathType_ == PathType::kEndPath; }
0036 
0037   private:
0038     std::string pathName_;
0039     StreamContext const* streamContext_;
0040     unsigned int pathID_;
0041     PathType pathType_;
0042   };
0043 
0044   std::ostream& operator<<(std::ostream&, PathContext const&);
0045 }  // namespace edm
0046 #endif