CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Framework/interface/GroupSelector.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_GroupSelector_h
00002 #define FWCore_Framework_GroupSelector_h
00003 
00005 //
00006 // Class GroupSelector. Class for user to select specific groups in event.
00007 //
00008 // Author: Bill Tanenbaum, Marc Paterno
00009 //
00011 
00012 #include <iosfwd>
00013 #include <string>
00014 #include <vector>
00015 
00016 namespace edm {
00017   class BranchDescription;
00018   class GroupSelectorRules;
00019   class ParameterSet;
00020 
00021   class GroupSelector {
00022   public:
00023     GroupSelector();
00024 
00025     // N.B.: we assume there are not null pointers in the vector allBranches.
00026     void initialize(GroupSelectorRules const& rules,
00027                     std::vector<BranchDescription const*> const& branchDescriptions);
00028 
00029     bool selected(BranchDescription const& desc) const;
00030 
00031     // Printout intended for debugging purposes.
00032     void print(std::ostream& os) const;
00033 
00034     bool initialized() const {return initialized_;}
00035 
00036   private:
00037 
00038     // We keep a sorted collection of branch names, indicating the
00039     // groups which are to be selected.
00040 
00041     // TODO: See if we can keep pointer to (const) BranchDescriptions,
00042     // so that we can do pointer comparison rather than string
00043     // comparison. This will work if the BranchDescription we are
00044     // given in the 'selected' member function is one of the instances
00045     // that are managed by the ProductRegistry used to initialize the
00046     // entity that contains this GroupSelector.
00047     std::vector<std::string> groupsToSelect_;
00048     bool initialized_;
00049   };
00050 
00051   std::ostream&
00052   operator<< (std::ostream& os, const GroupSelector& gs);
00053 
00054 } // namespace edm
00055 
00056 
00057 
00058 #endif