VPTissue Reference Manual
SimEvent.h
Go to the documentation of this file.
1 #ifndef SIM_EVENT_H_INCLUDED
2 #define SIM_EVENT_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "SimEventType.h"
23 #include <memory>
24 
25 namespace SimPT_Sim {
26 
27 class Sim;
28 
29 namespace Event {
30 
35 class SimEvent
36 {
37 public:
39  using Source = std::shared_ptr<Sim>;
40 
42  using Type = SimEventType;
43 
45  SimEvent(Source sim, int step, Type type) : m_source(sim), m_step(step), m_type(type) {}
46 
48  Source GetSource() const { return m_source; }
49 
51  int GetStep() const { return m_step; }
52 
54  Type GetType() const { return m_type;}
55 
56 private:
57  Source m_source;
58  int m_step;
59  Type m_type;
60 };
61 
62 } // namespace
63 } // namespace
64 
65 #endif
An event transmitted by a simulator.
Definition: SimEvent.h:35
Source GetSource() const
Get the data member value.
Definition: SimEvent.h:48
Definition for SimEventType.
Namespace for the core simulator.
SimEvent(Source sim, int step, Type type)
Initialize all data members.
Definition: SimEvent.h:45
Type GetType() const
Get Event type.
Definition: SimEvent.h:54
SimEventType Type
Type of events triggered by sim.
Definition: SimEvent.h:42
std::shared_ptr< Sim > Source
Convenience typedef for clients of this class.
Definition: SimEvent.h:39
SimEventType
Type of events triggered by sim or on behalf of sim by project.
Definition: SimEventType.h:37
int GetStep() const
Get step.
Definition: SimEvent.h:51