Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:29:55

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 
0036 namespace dd4hep {
0037   struct SpecPar;
0038 
0039   struct Filter {
0040     std::vector<bool> isRegex;
0041     std::vector<bool> hasNamespace;
0042     std::vector<int> index;
0043     std::vector<std::string_view> skeys;
0044     std::vector<std::regex> keys;
0045     std::unique_ptr<Filter> next;
0046     struct Filter* up;
0047     const SpecPar* spec = nullptr;
0048   };
0049 
0050   namespace dd {
0051     bool accepted(std::vector<std::regex> const&, std::string_view);
0052     bool accepted(const Filter*, std::string_view);
0053     bool isRegex(std::string_view);
0054     bool hasNamespace(std::string_view);
0055     bool isMatch(std::string_view, std::string_view);
0056     bool compareEqual(std::string_view, std::string_view);
0057     bool compareEqual(std::string_view, std::regex);
0058     bool compareEqualName(std::string_view, std::string_view);
0059     bool compareEqualCopyNumber(std::string_view, int);
0060     std::string_view realTopName(std::string_view);
0061     std::vector<std::string_view> split(std::string_view, const char*);
0062     std::string_view noNamespace(std::string_view);
0063   }  // namespace dd
0064 }  // namespace dd4hep
0065 
0066 #endif