]>
Commit | Line | Data |
---|---|---|
4b31e06b | 1 | // -*- Mode: C++ -*- |
2 | // $Id$ | |
3 | ||
4 | #ifndef ALIHLTBLOCKDATACOLLECTION_H | |
5 | #define ALIHLTBLOCKDATACOLLECTION_H | |
6 | //* This file is property of and copyright by the ALICE HLT Project * | |
7 | //* ALICE Experiment at CERN, All rights reserved. * | |
8 | //* See cxx source for full Copyright notice * | |
9 | ||
10 | /** @file AliHLTBlockDataCollection.h | |
11 | @author Matthias Richter | |
12 | @date | |
13 | @brief A collection of AliHLTComponentBlockData descriptors providing | |
14 | argument parsing and basic selection. | |
15 | */ | |
16 | ||
17 | #include "AliHLTLogging.h" | |
18 | #include "vector" | |
19 | #include "TObject.h" | |
20 | ||
21 | /** | |
22 | * @class AliHLTBlockDataCollection | |
23 | * Class handles a list of AliHLTComponentBlockData entries and parsing of | |
24 | * argument list to fill it. Originally taken from AliHLTBlickFilterComponent, | |
25 | * but decided to be commonly of benefit. | |
26 | * | |
27 | * See ScanArgument() function for description of available arguments | |
28 | * <pre> | |
29 | * -datatype ID ORIGIN | |
30 | * -typeid ID | |
31 | * -origin ORIGIN | |
32 | * -dataspec SPEC | |
33 | * </pre> | |
34 | * | |
35 | * @ingroup alihlt_base | |
36 | */ | |
37 | class AliHLTBlockDataCollection : public TObject, public AliHLTLogging | |
38 | { | |
39 | public: | |
40 | /** standard constructor */ | |
41 | AliHLTBlockDataCollection(); | |
42 | /** destructor */ | |
43 | virtual ~AliHLTBlockDataCollection(); | |
44 | ||
45 | /** | |
46 | * Add data block descriptor. | |
47 | */ | |
48 | int Add(const AliHLTComponentBlockData& block); | |
49 | ||
50 | /** | |
51 | * Check if the data block is selected by the filter rules. | |
52 | * @return 1 if selected | |
53 | */ | |
54 | int IsSelected(const AliHLTComponentBlockData& block); | |
55 | ||
56 | /** | |
57 | * Scan argument and read block descriptor data. | |
58 | * The function is invoked by components in the course of argument | |
59 | * scan. | |
60 | * | |
61 | * Scan the list for known arguments, terminates at the first unknown argument. | |
62 | * Recognized arguments: | |
63 | * \li -datatype <i> id origin </i> <br> | |
64 | * e.g. <tt> -datatype 'ESD_TREE' 'TPC ' </tt> <br> | |
65 | * \b Note: due to the 4-character data origin it might be necessary to | |
66 | * append a blank to the detectorname, e.g. <tt>TPC -> 'TPC '</tt> | |
67 | * | |
68 | * \li -origin <i> origin </i> <br> | |
69 | * e.g. -origin 'TPC ', \b Note: the filter rule has type id 'ANY' | |
70 | * | |
71 | * \li -typeid <i> id </i> <br> | |
72 | * e.g. -typeid ESD_TREE, \b Note: the filter rule has origin 'ANY' | |
73 | * | |
74 | * \li -dataspec <i> specification </i> <br> | |
75 | * data specification treated as decimal number or hex number if | |
76 | * prepended by '0x' | |
77 | * | |
78 | * @return number of arguments which have been treated. | |
79 | */ | |
80 | int ScanArgument(int argc, const char** argv ); | |
81 | ||
82 | /** | |
83 | * Check collection for content. | |
84 | * @return 1 if empty, 0 if content available | |
85 | */ | |
86 | int IsEmpty(); | |
87 | protected: | |
88 | ||
89 | private: | |
90 | /** copy constructor prohibited */ | |
91 | AliHLTBlockDataCollection(const AliHLTBlockDataCollection&); | |
92 | /** assignment operator prohibited */ | |
93 | AliHLTBlockDataCollection& operator=(const AliHLTBlockDataCollection&); | |
94 | ||
95 | /** filtering rules, only the data type and specification members are use */ | |
96 | vector<AliHLTComponentBlockData> fFilterRules; //! transient | |
97 | ||
98 | ClassDef(AliHLTBlockDataCollection, 0) | |
99 | }; | |
100 | #endif |