Carna  Version 3.3.2
Aggregation.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef AGGREGATION_H_6014714286
13 #define AGGREGATION_H_6014714286
14 
19 #include <Carna/base/Association.h>
20 
21 namespace Carna
22 {
23 
24 namespace base
25 {
26 
27 
28 
29 // ----------------------------------------------------------------------------------
30 // Aggregation
31 // ----------------------------------------------------------------------------------
32 
39 template< typename AssociatedObjectType >
40 class Aggregation : public Association< AssociatedObjectType >
41 {
42 
43  Aggregation()
45  {
46  }
47 
48 public:
49 
54 
60  {
62  }
63 
67  explicit Aggregation( AssociatedObjectType& associatedObject )
68  : Association< AssociatedObjectType >( &associatedObject )
69  {
70  }
71 
76  : Association< AssociatedObjectType >( other.get() )
77  {
78  }
79 
80 }; // Aggregation
81 
82 
83 template< typename AssociatedObjectType >
86 
87 
88 
89 } // namespace Carna :: base
90 
91 } // namespace Carna
92 
93 #endif // AGGREGATION_H_6014714286
Defines Carna::base::Association.
Aggregation(const Aggregation< AssociatedObjectType > &other)
Copies reference from other.
Definition: Aggregation.h:75
Represents an aggregation, i.e. a weak reference.
Definition: Aggregation.h:40
AssociatedObjectType * get() const
Returns raw pointer to the referenced object.
Definition: Association.h:61
Aggregation(AssociatedObjectType &associatedObject)
Instantiates.
Definition: Aggregation.h:67
static Aggregation< AssociatedObjectType > createNullPtr()
Creates instance of this class template that behaves like a nullptr pointer. For internal usage only...
Definition: Aggregation.h:59
Represents an association.
Definition: Association.h:44
static const Aggregation< AssociatedObjectType > NULL_PTR
Holds instance of this class template that behaves like a nullptr pointer.
Definition: Aggregation.h:53