CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DetectorDescription/Core/interface/DDPartSelection.h

Go to the documentation of this file.
00001 #ifndef DDPartSelection_h
00002 #define DDPartSelection_h
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <iostream>
00007 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
00008 
00009 //#include <boost/spirit.hpp>
00010 
00011 
00012 class DDLogicalPart;
00013 
00014 enum ddselection_type { ddunknown,   //   ->    (should never appear!)
00015                         ddanynode,   //   ->    //*
00016                         ddanychild,  //   ->    /*
00017                         ddanylogp,   //   ->    //NameOfLogicalPart
00018                         ddanyposp,   //   ->    //NameOfLogicalPart[copyno]
00019                         ddchildlogp, //   ->    /NameOfLogicalPart
00020                         ddchildposp  //   ->    /NameOfLogicalPart[copyno]
00021                        };
00022 
00023 //typedef DDRedirect<DDLogicalPartImpl> lpredir_type; // logical-part-redirection_type
00024 
00025 struct DDPartSelRegExpLevel
00026 {
00027   DDPartSelRegExpLevel(const std::string & ns, const std::string & nm, int cpn, ddselection_type t, bool isRegex=false)
00028   : ns_(ns), nm_(nm), copyno_(cpn), selectionType_(t), isRegex_(isRegex) { }
00029   std::string ns_, nm_;
00030   int copyno_;
00031   ddselection_type selectionType_;
00032   bool isRegex_;
00033 };
00034 
00035 
00036 struct DDPartSelectionLevel
00037 {
00038   DDPartSelectionLevel(const DDLogicalPart &, int, ddselection_type);
00039   DDLogicalPart lp_;
00040   int copyno_;
00041   ddselection_type selectionType_;
00042 };
00043 
00044 
00045 class DDPartSelection : public std::vector<DDPartSelectionLevel>
00046 {
00047 public:
00048   DDPartSelection() : std::vector<DDPartSelectionLevel>() { }
00049 };
00050 /*
00051 class DDPartSelection : public std::vector<DDPartSelectionLevel>
00052 {
00053 public:
00054   DDPartSelection() { }; // to use it in stl-containers
00055   DDPartSelection(const std::string & selectionString);
00056   
00057   ~DDPartSelection() { }
00058   
00059 };
00060 */
00061 
00062 
00063 std::ostream & operator<<(std::ostream &, const DDPartSelection &);
00064 std::ostream & operator<<(std::ostream &, const std::vector<DDPartSelection> &);
00065 
00066 void DDTokenize2(const std::string & selectionString, std::vector<DDPartSelRegExpLevel> & result);
00067 void DDTokenize(const std::string & selectionString, std::vector<DDPartSelRegExpLevel> & result);
00068 std::ostream & operator<<(std::ostream &, const DDPartSelection &);
00069 
00070 #endif