ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataCont/interface/Collection.h
Revision: 1.5
Committed: Mon Dec 8 15:26:23 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.4: +2 -2 lines
Log Message:
Coding style.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.5 // $Id: Collection.h,v 1.4 2008/12/01 17:17:20 bendavid 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     ~Collection() {}
24    
25     virtual ArrayElement *At(UInt_t idx) = 0;
26     virtual const ArrayElement *At(UInt_t idx) const = 0;
27     virtual UInt_t GetEntries() const = 0;
28 loizides 1.3 virtual UInt_t GetSize() const = 0;
29 bendavid 1.4 virtual Bool_t HasObject(const ArrayElement *obj) const = 0;
30 loizides 1.1 virtual Bool_t IsOwner() const = 0;
31 loizides 1.3 void Print(Option_t *opt="") const;
32 loizides 1.1 virtual void Reset() = 0;
33     virtual void Trim() = 0;
34     virtual ArrayElement *UncheckedAt(UInt_t idx) = 0;
35     virtual const ArrayElement *UncheckedAt(UInt_t idx) const = 0;
36     virtual ArrayElement *operator[](UInt_t idx) = 0;
37     virtual const ArrayElement *operator[](UInt_t idx) const = 0;
38    
39     ClassDefT(Collection,1) // Generic access to a collection of ArrayElements
40     };
41     }
42 loizides 1.3
43     //--------------------------------------------------------------------------------------------------
44     template<class ArrayElement>
45 loizides 1.5 void mithep::Collection<ArrayElement>::Print(Option_t */*opt*/) const
46 loizides 1.3 {
47     printf("%s: Contains %d (out of %d) objs\n",
48     GetName(), GetEntries(), GetSize());
49     }
50 loizides 1.1 #endif