Revision: | 1.8 |
Committed: | Wed Sep 9 03:38:50 2009 UTC (15 years, 7 months ago) by bendavid |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, HEAD |
Branch point for: | Mit_025c_branch |
Changes since 1.7: | +3 -1 lines |
Log Message: | Added typedef for template class |
# | User | Rev | Content |
---|---|---|---|
1 | loizides | 1.1 | //-------------------------------------------------------------------------------------------------- |
2 | bendavid | 1.8 | // $Id: Collection.h,v 1.7 2009/03/02 12:34:00 loizides Exp $ |
3 | loizides | 1.1 | // |
4 | // Collection | ||
5 | // | ||
6 | // Unification of read access to a collection of objects (ArrayElements). | ||
7 | // | ||
8 | // Authors: C.Loizides | ||
9 | //-------------------------------------------------------------------------------------------------- | ||
10 | |||
11 | loizides | 1.2 | #ifndef MITANA_DATACONT_COLLECTION_H |
12 | #define MITANA_DATACONT_COLLECTION_H | ||
13 | loizides | 1.1 | |
14 | #include "MitAna/DataCont/interface/BaseCollection.h" | ||
15 | |||
16 | namespace mithep | ||
17 | { | ||
18 | template<class ArrayElement> | ||
19 | class Collection : public BaseCollection | ||
20 | { | ||
21 | public: | ||
22 | Collection() {} | ||
23 | |||
24 | bendavid | 1.8 | typedef ArrayElement element_type; |
25 | |||
26 | loizides | 1.6 | virtual ArrayElement *At(UInt_t idx) = 0; |
27 | virtual const ArrayElement *At(UInt_t idx) const = 0; | ||
28 | virtual UInt_t GetEntries() const = 0; | ||
29 | virtual UInt_t GetSize() const = 0; | ||
30 | bendavid | 1.4 | virtual Bool_t HasObject(const ArrayElement *obj) const = 0; |
31 | loizides | 1.6 | virtual Bool_t IsOwner() const = 0; |
32 | void Print(Option_t *opt="") const; | ||
33 | virtual void Reset() = 0; | ||
34 | virtual void Trim() = 0; | ||
35 | virtual ArrayElement *UncheckedAt(UInt_t idx) = 0; | ||
36 | virtual const ArrayElement *UncheckedAt(UInt_t idx) const = 0; | ||
37 | virtual ArrayElement *operator[](UInt_t idx) = 0; | ||
38 | virtual const ArrayElement *operator[](UInt_t idx) const = 0; | ||
39 | loizides | 1.1 | |
40 | loizides | 1.7 | ClassDef(Collection, 1) // Generic access to a collection of ArrayElements |
41 | loizides | 1.1 | }; |
42 | } | ||
43 | loizides | 1.3 | |
44 | //-------------------------------------------------------------------------------------------------- | ||
45 | template<class ArrayElement> | ||
46 | loizides | 1.5 | void mithep::Collection<ArrayElement>::Print(Option_t */*opt*/) const |
47 | loizides | 1.3 | { |
48 | loizides | 1.6 | // Print information about this collection. |
49 | |||
50 | loizides | 1.3 | printf("%s: Contains %d (out of %d) objs\n", |
51 | GetName(), GetEntries(), GetSize()); | ||
52 | } | ||
53 | loizides | 1.1 | #endif |