Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:58:01

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : Ianna Osborne
0011 //
0012 //==========================================================================
0013 #ifndef DD4HEP_FILTER_H
0014 #define DD4HEP_FILTER_H
0015 
0016 // -*- C++ -*-
0017 //
0018 // Class:      Filter
0019 //
0020 /**\class Filter
0021 
0022  Description: Filter list
0023 
0024  Implementation:
0025      Filter criteria is defined in XML
0026 */
0027 //
0028 // Original Author:  Ianna Osborne
0029 //         Created:  Tue, 12 Mar 2019 09:51:33 CET
0030 //
0031 //
0032 #include <memory>
0033 #include <vector>
0034 #include <regex>
0035 #include <unordered_map>
0036 
0037 namespace dd4hep {
0038   struct SpecPar;
0039 
0040   struct Filter {
0041     std::vector<bool> isRegex;
0042     std::vector<bool> hasNamespace;
0043     std::vector<int> index;
0044     std::vector<std::string_view> skeys;
0045     std::vector<std::regex> keys;
0046     std::unique_ptr<Filter> next;
0047     struct Filter* up;
0048     const SpecPar* spec = nullptr;
0049   };
0050 
0051   namespace dd {
0052     bool accepted(std::vector<std::regex> const&, std::string_view);
0053     bool accepted(const Filter*, std::string_view);
0054     bool isRegex(std::string_view);
0055     bool hasNamespace(std::string_view);
0056     bool isMatch(std::string_view, std::string_view);
0057     bool compareEqual(std::string_view, std::string_view);
0058     bool compareEqual(std::string_view, std::regex);
0059     bool compareEqualName(std::string_view, std::string_view);
0060     bool compareEqualCopyNumber(std::string_view, int);
0061     std::string_view realTopName(std::string_view);
0062     std::vector<std::string_view> split(std::string_view, const char*);
0063     std::string_view noNamespace(std::string_view);
0064   }  // namespace dd
0065 }  // namespace dd4hep
0066 
0067 #endif