Carna Version 3.3.3
Loading...
Searching...
No Matches
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
20
21namespace Carna
22{
23
24namespace base
25{
26
27
28
29// ----------------------------------------------------------------------------------
30// Aggregation
31// ----------------------------------------------------------------------------------
32
39template< typename AssociatedObjectType >
40class Aggregation : public Association< AssociatedObjectType >
41{
42
45 {
46 }
47
48public:
49
54
63
67 explicit Aggregation( AssociatedObjectType& associatedObject )
68 : Association< AssociatedObjectType >( &associatedObject )
69 {
70 }
71
79
80}; // Aggregation
81
82
83template< typename AssociatedObjectType >
84const Aggregation< AssociatedObjectType > Aggregation< AssociatedObjectType >::NULL_PTR
86
87
88
89} // namespace Carna :: base
90
91} // namespace Carna
92
93#endif // AGGREGATION_H_6014714286
Defines Carna::base::Association.
Represents an aggregation, i.e. a weak reference.
Definition Aggregation.h:41
static const Aggregation< AssociatedObjectType > NULL_PTR
Holds instance of this class template that behaves like a nullptr pointer.
Definition Aggregation.h:53
static Aggregation< AssociatedObjectType > createNullPtr()
Creates instance of this class template that behaves like a nullptr pointer. For internal usage only....
Definition Aggregation.h:59
Aggregation(const Aggregation< AssociatedObjectType > &other)
Copies reference from other.
Definition Aggregation.h:75
Aggregation(AssociatedObjectType &associatedObject)
Instantiates.
Definition Aggregation.h:67
Represents an association.
Definition Association.h:45
AssociatedObjectType * get() const
Returns raw pointer to the referenced object.
Definition Association.h:61