Last change
on this file since 51 was
22,
checked in by rings, 15 years ago
|
|
-
Property svn:executable set to
*
|
File size:
1012 bytes
|
Line | |
---|
1 | #include "DataPort.h" |
---|
2 | |
---|
3 | #include <iostream> |
---|
4 | |
---|
5 | #include "Logger/Logger.h" |
---|
6 | #include "LowerTestAdapter.h" |
---|
7 | |
---|
8 | using namespace t3devlib; |
---|
9 | using namespace std; |
---|
10 | |
---|
11 | DataPort::DataPort (PortId& portId) |
---|
12 | :Port(portId) { |
---|
13 | Logger::Instance().LogInfo("DataPort::DataPort"); |
---|
14 | LowerTestAdapter::Instance().RegisterDataPort(this); |
---|
15 | } |
---|
16 | |
---|
17 | DataPort::~DataPort() { |
---|
18 | Logger::Instance().LogInfo("~DataPort::DataPort"); |
---|
19 | } |
---|
20 | |
---|
21 | bool DataPort::Map (const PortId& connectedPortId) { |
---|
22 | |
---|
23 | m_connectedPorts.push_back(&connectedPortId); |
---|
24 | return true; |
---|
25 | } |
---|
26 | |
---|
27 | bool DataPort::Unmap (const PortId& connectedPortId) { |
---|
28 | |
---|
29 | //TODO: remove from m_connectedPorts |
---|
30 | return true; |
---|
31 | } |
---|
32 | |
---|
33 | bool DataPort::Send (const ComponentId& from,const Bitstring& bsMsg) { |
---|
34 | |
---|
35 | return true; |
---|
36 | } |
---|
37 | |
---|
38 | const t3devlib::PortId& DataPort::GetConnectedPort(const ComponentId *pComponentId) { |
---|
39 | std::list<const PortId *>::iterator it; |
---|
40 | for(it = m_connectedPorts.begin(); it != m_connectedPorts.end(); it++) { |
---|
41 | if(&((*it)->GetComponentId()) == pComponentId) { |
---|
42 | return **it; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.