Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: eac2b6b21bbf35d33463aa432c4e82ae0be3f055 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*******************************************************************************
 * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * CONTRIBUTORS:
 * 		Juergen Haug (initial contribution)
 *
 *******************************************************************************/
#ifndef SRC_COMMON_MODELBASE_DATAPORT_H_
#define SRC_COMMON_MODELBASE_DATAPORT_H_

#include "common/messaging/RTObject.h"
#include <string>

namespace etRuntime {

class DataPortBase: public RTObject {
public:
	static void connect(IRTObject* obj, const std::string& path1, const std::string& path2);

	DataPortBase(IRTObject* parent, const std::string& name, int localId) :
			RTObject(parent, name),
			m_localId(localId) {
	}

	int getLocalId() const {
		return m_localId;
	}

private:
	int m_localId;

	DataPortBase();
	DataPortBase(DataPortBase const&);
	DataPortBase& operator=(DataPortBase const&);
};

class DataSendPort: public DataPortBase {
public:
	DataSendPort(IRTObject* parent, const std::string& name, int localId) :
			DataPortBase(parent, name, localId) {
	}

private:

	DataSendPort(DataSendPort const&);
	DataSendPort& operator=(DataSendPort const&);
};

class DataReceivePort: public DataPortBase {
	friend class DataPortBase;
public:
	DataReceivePort(IRTObject* parent, const std::string& name, int localId) :
			DataPortBase(parent, name, localId) {
	}

	virtual void connect(DataSendPort* dataSendPort) = 0;
private:

	DataReceivePort(DataReceivePort const&);
	DataReceivePort& operator=(DataReceivePort const&);
};

} /* namespace etRuntime */

#endif /* SRC_COMMON_MODELBASE_DATAPORT_H_ */

Back to the top