CMS 3D CMS Logo

GroupSelector.h

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

Generated on Tue Jun 9 17:35:41 2009 for CMSSW by  doxygen 1.5.4