-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.h
46 lines (35 loc) · 971 Bytes
/
interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* interface.h
* PhoenixSim
*
* Created by Johnnie Chan on 6/24/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
* Abstract class for interface between data generation and network. Only
* offers variable length input and output ports and unique message ID numbers.
* All other interfaces should be derived from Interface.
*/
#ifndef __INTERFACE_H__
#define __INTERFACE_H__
#include <list>
#include <vector>
#include "systemc.h"
#include "electronicmessage.h"
namespace PhoenixSim
{
class Interface : public sc_module
{
public:
Interface(sc_module_name name, int p_numofNetworkPorts);
~Interface();
std::vector< sc_in<ElectronicMessage*>* > inputPort;
std::vector< sc_out<ElectronicMessage*>* > outputPort;
protected:
const int numOfNetworkPorts;
virtual void NetworkMessageReceived(int inputPortId) = 0;
static int GetUniqueId();
private:
static int currentMessageCount;
};
}
#endif // __INTERFACE_H__