forked from AIDASoft/podio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleReferencingType.h
90 lines (62 loc) · 2.41 KB
/
ExampleReferencingType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef ExampleReferencingType_H
#define ExampleReferencingType_H
#include "ExampleReferencingTypeData.h"
#include <vector>
#include "ExampleCluster.h"
#include "ExampleReferencingType.h"
#include <vector>
#include "podio/ObjectID.h"
// Referencing Type
// author: B. Hegner
//forward declarations
#include "ExampleReferencingTypeConst.h"
#include "ExampleReferencingTypeObj.h"
class ExampleReferencingTypeCollection;
class ExampleReferencingTypeCollectionIterator;
class ConstExampleReferencingType;
class ExampleReferencingType {
friend ExampleReferencingTypeCollection;
friend ExampleReferencingTypeCollectionIterator;
friend ConstExampleReferencingType;
public:
/// default constructor
ExampleReferencingType();
/// constructor from existing ExampleReferencingTypeObj
ExampleReferencingType(ExampleReferencingTypeObj* obj);
/// copy constructor
ExampleReferencingType(const ExampleReferencingType& other);
/// copy-assignment operator
ExampleReferencingType& operator=(const ExampleReferencingType& other);
/// support cloning (deep-copy)
ExampleReferencingType clone() const;
/// destructor
~ExampleReferencingType();
/// conversion to const object
operator ConstExampleReferencingType () const;
public:
void addClusters(ConstExampleCluster);
unsigned int Clusters_size() const;
ConstExampleCluster Clusters(unsigned int) const;
std::vector<ConstExampleCluster>::const_iterator Clusters_begin() const;
std::vector<ConstExampleCluster>::const_iterator Clusters_end() const;
void addRefs(ConstExampleReferencingType);
unsigned int Refs_size() const;
ConstExampleReferencingType Refs(unsigned int) const;
std::vector<ConstExampleReferencingType>::const_iterator Refs_begin() const;
std::vector<ConstExampleReferencingType>::const_iterator Refs_end() const;
/// check whether the object is actually available
bool isAvailable() const;
/// disconnect from ExampleReferencingTypeObj instance
void unlink(){m_obj = nullptr;}
bool operator==(const ExampleReferencingType& other) const {
return (m_obj==other.m_obj);
}
bool operator==(const ConstExampleReferencingType& other) const;
// less comparison operator, so that objects can be e.g. stored in sets.
// friend bool operator< (const ExampleReferencingType& p1,
// const ExampleReferencingType& p2 );
const podio::ObjectID getObjectID() const;
private:
ExampleReferencingTypeObj* m_obj;
};
#endif