CMS 3D CMS Logo

DDsvalues.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_CORE_DDSVALUES_H
2 #define DETECTOR_DESCRIPTION_CORE_DDSVALUES_H
3 
4 #include <algorithm>
5 #include <map>
6 #include <ostream>
7 #include <utility>
8 #include <vector>
9 
11 
12 using DDsvalues_type = std::vector< std::pair<unsigned int, DDValue> >;
14 
15 inline bool operator<( const DDsvalues_Content_type & lh, const DDsvalues_Content_type & rh ) {
16  return lh.first < rh.first;
17 }
18 
19 inline DDsvalues_type::const_iterator find( DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id ) {
20  static const DDValue dummy;
21  DDsvalues_Content_type v( id, dummy );
22  DDsvalues_type::const_iterator it = std::lower_bound( begin, end, v );
23  if( it != end && (*it).first == id ) return it;
24  return end;
25 }
26 
27 inline DDsvalues_type::const_iterator find( DDsvalues_type const & sv, unsigned int id ) {
28  return find( sv.begin(), sv.end(), id );
29 }
30 
31 void merge( DDsvalues_type & target, DDsvalues_type const & sv, bool sortit = true );
32 
34 bool DDfetch( const DDsvalues_type *, DDValue & );
35 
37 unsigned int DDfetch( const std::vector<const DDsvalues_type *> & sp,
38  DDValue & toFetch,
39  std::vector<DDValue> & result );
40 
41 std::ostream & operator<<( std::ostream & , const DDsvalues_type & );
42 std::ostream & operator<<( std::ostream & , const std::vector<const DDsvalues_type*> & );
43 
44 #endif
void merge(DDsvalues_type &target, DDsvalues_type const &sv, bool sortit=true)
Definition: DDsvalues.cc:5
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:13
bool int lh
Definition: SIMDVec.h:21
DDsvalues_type::const_iterator find(DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id)
Definition: DDsvalues.h:19
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
#define end
Definition: vmac.h:39
std::ostream & operator<<(std::ostream &, const DDsvalues_type &)
Definition: DDsvalues.cc:41
#define begin
Definition: vmac.h:32
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
bool operator<(const DDsvalues_Content_type &lh, const DDsvalues_Content_type &rh)
Definition: DDsvalues.h:15