forked from AIDASoft/podio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleWithARelationConst.h
78 lines (54 loc) · 1.86 KB
/
ExampleWithARelationConst.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
#ifndef ConstExampleWithARelation_H
#define ConstExampleWithARelation_H
#include "ExampleWithARelationData.h"
#include <vector>
#include "podio/ObjectID.h"
// Type with namespace and namespaced relation
// author: Joschka Lingemann
//forward declarations
namespace ex {
class ExampleWithNamespace;
class ConstExampleWithNamespace;
}
#include "ExampleWithARelationObj.h"
namespace ex {
class ExampleWithARelationObj;
class ExampleWithARelation;
class ExampleWithARelationCollection;
class ExampleWithARelationCollectionIterator;
class ConstExampleWithARelation {
friend ExampleWithARelation;
friend ExampleWithARelationCollection;
friend ExampleWithARelationCollectionIterator;
public:
/// default constructor
ConstExampleWithARelation();
/// constructor from existing ExampleWithARelationObj
ConstExampleWithARelation(ExampleWithARelationObj* obj);
/// copy constructor
ConstExampleWithARelation(const ConstExampleWithARelation& other);
/// copy-assignment operator
ConstExampleWithARelation& operator=(const ConstExampleWithARelation& other);
/// support cloning (deep-copy)
ConstExampleWithARelation clone() const;
/// destructor
~ConstExampleWithARelation();
public:
const ex::ConstExampleWithNamespace ref() const;
/// check whether the object is actually available
bool isAvailable() const;
/// disconnect from ExampleWithARelationObj instance
void unlink(){m_obj = nullptr;}
bool operator==(const ConstExampleWithARelation& other) const {
return (m_obj==other.m_obj);
}
bool operator==(const ExampleWithARelation& other) const;
// less comparison operator, so that objects can be e.g. stored in sets.
// friend bool operator< (const ExampleWithARelation& p1,
// const ExampleWithARelation& p2 );
const podio::ObjectID getObjectID() const;
private:
ExampleWithARelationObj* m_obj;
};
} // namespace ex
#endif