CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Services/src/VertexTracker.h

Go to the documentation of this file.
00001 #ifndef FWCore_Services_Vertex_Tracker_h
00002 #define FWCore_Services_Vertex_Tracker_h
00003 
00004 #include <iosfwd>
00005 #include <string>
00006 
00007 #include "Sym.h"
00008 #include "ProfParseTypedefs.h"
00009 
00010 // ------------------- Vertex Tracker class ----------------
00011 struct VertexTracker
00012 {
00013   typedef void* address_type;
00014   VertexTracker():
00015     name_(),
00016     library_(),
00017     addr_(),
00018     id_(),
00019     total_as_leaf_(),
00020     total_seen_(),
00021     in_path_(),
00022     //size_(),
00023     percent_leaf_(0.0),
00024     percent_path_(0.0)
00025   { } 
00026 
00027   explicit VertexTracker(unsigned int id):
00028     name_(),
00029     library_(),
00030     addr_(),
00031     id_(id),
00032     total_as_leaf_(),
00033     total_seen_(),
00034     in_path_(),
00035     //size_(),
00036     percent_leaf_(0.0),
00037     percent_path_(0.0)
00038   { }
00039 
00040   VertexTracker(address_type addr, const std::string& name):
00041     name_(name),
00042     library_(),
00043     addr_(addr),
00044     id_(),
00045     total_as_leaf_(),
00046     total_seen_(),
00047     in_path_(),
00048     //size_(),
00049     percent_leaf_(0.0),
00050     percent_path_(0.0)
00051   { }
00052 
00053   explicit VertexTracker(const Sym& sym) :
00054     name_(sym.name_),
00055     library_(sym.library_),
00056     addr_(sym.addr_),
00057     id_(),
00058     total_as_leaf_(),
00059     total_seen_(),
00060     in_path_(),
00061     //size_(sym.size_),
00062     percent_leaf_(0.0),
00063     percent_path_(0.0)
00064   { }
00065 
00066   bool 
00067   operator<(const VertexTracker& a) const 
00068   { return addr_<a.addr_; }
00069 
00070   bool 
00071   operator<(unsigned int id) const 
00072   { return id_<id; }
00073 
00074   void 
00075   incLeaf() const 
00076   { ++total_as_leaf_; }
00077 
00078   void 
00079   incTotal() const 
00080   { ++total_seen_; }
00081 
00082   void 
00083   incPath(int by) const 
00084   { in_path_+=by; }
00085 
00086   void 
00087   setID() const 
00088   { id_=next_id_++; }
00089 
00090   std::string name_;
00091   std::string library_;
00092   address_type addr_;
00093   mutable unsigned int id_;
00094   mutable unsigned int total_as_leaf_;
00095   mutable unsigned int total_seen_;
00096   mutable unsigned int in_path_;
00097   mutable EdgeMap      edges_;
00098   //mutable int          size_;
00099   mutable float        percent_leaf_;
00100   mutable float        percent_path_;
00101 
00102   static unsigned int next_id_;
00103 };
00104 
00105 std::ostream&
00106 operator<< (std::ostream& os, VertexTracker const& vt);
00107 
00108 #endif