Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
IndicatorCollection.h
1// trax track library
2// AD 2014
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include "trax/Indicator.h"
30#include "Collection.h"
31#include "CollectionDecorator.h"
32
33namespace trax{
34
35 struct Module;
36
38 struct IndicatorCollection : Collection<IndicatorCollection,Indicator>
39 {
41 static dclspc std::unique_ptr<IndicatorCollection> Make() noexcept;
42
43
47 virtual void Update() = 0;
48 };
49
50
58 public:
61
62
65 IndicatorCollectionDecorator( std::unique_ptr<IndicatorCollection> pSwitchCollection )
66 : CollectionDecorator<Decorator<IndicatorCollection>>(std::move(pSwitchCollection))
67 {}
68
69
72
73 void Update() override{
74 return m_pComponent->Update();
75 }
76
77 };
78}
CollectionDecorator(std::shared_ptr< InterfaceType > pComponent)
Definition CollectionDecorator.h:58
The base for decorator implementations. Needed as BaseDecorator to combine other decorator implemente...
Definition ObjectIDDecorator.h:27
std::shared_ptr< InterfaceType > m_pComponent
Definition ObjectIDDecorator.h:54
IndicatorCollection ComponentType
Type of the decoree.
Definition IndicatorCollection.h:60
void Update() override
Called during simulation to update position values.
Definition IndicatorCollection.h:73
IndicatorCollectionDecorator(std::unique_ptr< IndicatorCollection > pSwitchCollection)
Constructs the decorator.
Definition IndicatorCollection.h:65
STL namespace.
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Collection to hold a set of Indicator objects.
Definition IndicatorCollection.h:39
virtual void Update()=0
Called during simulation to update position values.
static dclspc std::unique_ptr< IndicatorCollection > Make() noexcept
Makes a IndicatorCollection object.
A module is a chunck of railroad stuff that is all located in one rectangular volume.
Definition Module.h:60