Project

General

Profile

Statistics
| Branch: | Revision:

root / include / eventtype.h @ 18befb2d

History | View | Annotate | Download (1.46 KB)

1
//==========================================================================
2
//   EVENTTYPE.H  -  header for
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//
7
//  Declaration of the following classes:
8
//    EventType: identifying an event type
9
//
10
//==========================================================================
11

    
12
/*--------------------------------------------------------------*
13
 Copyright (C) 2013 Mirko Stoffers
14

15
 This file is distributed WITHOUT ANY WARRANTY. See the file
16
 `license' for details on this and other legal matters.
17
 *--------------------------------------------------------------*/
18

    
19
#include "simkerneldefs.h"
20
#include "pdf.h"
21

    
22
#include "cmessage.h"
23

    
24
class SuccessorEvent
25
{
26
        private:
27
                evType_t* type;
28
                int modId;
29
                pdf_t pdf;
30

    
31
        public:
32
                pdf_t getProbabilityDistributionCopy()
33
                {
34
                        return pdf;
35
                }
36

    
37
                evType_t* getEvType()
38
                {
39
                        return type;
40
                }
41

    
42
                int getEvModId()
43
                {
44
                        return modId;
45
                }
46
};
47

    
48
class EventType
49
{
50
        private:
51
                succList_t succs;
52
                int modId;
53
                int kind;
54
                int sender;
55

    
56
        public:
57
                EventType(const cMessage* const msg)
58
                {
59
                        modId=msg->getArrivalModuleId();
60
                        kind=msg->getKind();
61
                        sender=msg->getSenderModuleId();
62
                }
63

    
64
                bool operator==(const cMessage& msg)
65
                {
66
                        return
67
                                msg.getArrivalModuleId()==modId
68
                                && msg.getKind()==kind
69
                                && msg.getSenderModuleId()==sender
70
                                ;
71
                }
72

    
73
                const succList_t& getSuccessors() const
74
                {
75
                        return succs;
76
                }
77

    
78
                int getModId()
79
                {
80
                        return modId;
81
                }
82
};
83

    
84