BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/GeneratorObject/include/DataModel/tools/IsSTLSequence.h
Go to the documentation of this file.
1/***************************************************************************
2 determines whether CONTAINER is one of supported ATLAS sequences Requires
3 CONTAINER to define value_type
4 ----------------------------------------------------------------
5 ATLAS Collaboration
6 ***************************************************************************/
7
8// $Id: IsSTLSequence.h,v 1.4 2003/07/25 22:36:46 calaf Exp $
9
10#ifndef DATAMODEL_TOOLS_ISSTLSEQUENCE_H
11#define DATAMODEL_TOOLS_ISSTLSEQUENCE_H
12
13//<<<<<< INCLUDES >>>>>>
14#ifndef _CPP_VECTOR
15# include <vector>
16#endif
17#ifndef _CPP_LIST
18# include <list>
19#endif
20#ifndef _CPP_DEQUE
21# include <deque>
22#endif
23#ifndef BOOST_CONFIG_HPP
24# include <boost/config.hpp>
25#endif
26#ifndef BOOST_CONCEPT_CHECKS_HPP
27# include <boost/concept_check.hpp>
28#endif
29#ifndef BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED
30# include <boost/type_traits/is_base_and_derived.hpp>
31#endif
32#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED
33# include <boost/type_traits/is_same.hpp>
34#endif
35#ifndef BOOST_TT_ICE_HPP_INCLUDED
36# include <boost/type_traits/ice.hpp>
37#endif
38#ifndef BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
39# include <boost/type_traits/remove_pointer.hpp>
40#endif
41#ifndef DATAMODEL_DATALIST_H
42# include "DataModel/DataList.h"
43#endif
44#ifndef DATAMODEL_DATAVECTOR_H
45# include "DataModel/DataVector.h"
46#endif
47
48//<<<<<< CLASS DECLARATIONS >>>>>>
49namespace SG {
50 using boost::ContainerConcept;
51 template <class CONTAINER> struct IsSTLSequence {
52 private:
53 BOOST_CLASS_REQUIRES( CONTAINER, ContainerConcept );
54 typedef typename CONTAINER::value_type value_type;
55 typedef typename boost::remove_pointer<value_type>::type dv_value_type;
56
57 // vectors
58 typedef typename boost::is_same<std::vector<value_type>, CONTAINER> isStdVector;
59 typedef typename boost::is_same<DataVector<dv_value_type>, CONTAINER> isDataVector;
60 typedef typename boost::type_traits::ice_or<isStdVector::value, isDataVector::value>
61 isVector;
62
63 typedef typename boost::is_base_and_derived<std::vector<value_type>, CONTAINER>
64 derivesFromStdVector;
65 typedef typename boost::is_base_and_derived<DataVector<dv_value_type>, CONTAINER>
66 derivesFromDataVector;
67 typedef typename boost::type_traits::ice_or<derivesFromStdVector::value,
68 derivesFromDataVector::value>
69 derivesFromVector;
70
71 // lists
72 typedef typename boost::is_same<std::list<value_type>, CONTAINER> isStdList;
73 typedef typename boost::is_same<DataList<dv_value_type>, CONTAINER> isDataList;
74 typedef typename boost::type_traits::ice_or<isStdList::value, isDataList::value> isList;
75
76 typedef typename boost::is_base_and_derived<std::list<value_type>, CONTAINER>
77 derivesFromStdList;
78 typedef typename boost::is_base_and_derived<DataList<dv_value_type>, CONTAINER>
79 derivesFromDataList;
80 typedef typename boost::type_traits::ice_or<derivesFromStdList::value,
81 derivesFromDataList::value>
82 derivesFromList;
83
84 // queues
85 typedef typename boost::is_same<std::deque<value_type>, CONTAINER> isDeque;
86 typedef typename boost::is_base_and_derived<std::deque<value_type>, CONTAINER>
87 derivesFromDeque;
88
89 // putting it all together
90 typedef
91 typename boost::type_traits::ice_or<isDeque::value, isList::value, isVector::value,
92 derivesFromDeque::value, derivesFromList::value,
93 derivesFromVector::value>
94 isSequence;
95
96 public:
97 BOOST_STATIC_CONSTANT( bool, value = isSequence::value );
98 };
99} // namespace SG
100#endif // TOOLS_ISSTLSEQUENCE_H
BOOST_STATIC_CONSTANT(bool, value=isSequence::value)