blob: 554040a2bdf890c253a7e702b2dbc1b49d55c174 [file] [log] [blame]
Ernesto Posse8a4f2962015-05-12 13:28:46 -04001// umlrtrtsinterface.hh
2
3/*******************************************************************************
4* Copyright (c) 2015 Zeligsoft (2009) Limited and others.
5* All rights reserved. This program and the accompanying materials
6* are made available under the terms of the Eclipse Public License v1.0
7* which accompanies this distribution, and is available at
8* http://www.eclipse.org/legal/epl-v10.html
9*******************************************************************************/
10
11#ifndef UMLRTRTSINTERFACE_HH
12#define UMLRTRTSINTERFACE_HH
13
14#include <stdlib.h>
15
16struct UMLRTCapsule;
17struct UMLRTCapsuleClass;
18struct UMLRTCommsPort;
19struct UMLRTCommsPortRole;
20struct UMLRTSlot;
21
22// An instance of an object of this type is used to access the RTS from capsule-instance code.
23
24class UMLRTRtsInterface
25{
26public:
27 // Used to connect two ports. If the far-end of 'p1' already exists, it is the far-end of 'p1' that gets connected to 'p2'.
28 virtual void connectPorts ( const UMLRTCommsPort * p1, size_t p1Index, const UMLRTCommsPort * p2, size_t p2Index ) const = 0;
29
30 // Create a connection between the far end of the 'relay' port to the 'dest' port. The relay port itself is not modified.
31 virtual void connectRelayPort ( const UMLRTCommsPort * relayPort, size_t relayIndex, const UMLRTCommsPort * destPort, size_t destIndex ) const = 0;
32
33 // Used for creating a border-port-list from a slot, passed to a capsule instantiate function.
34 virtual const UMLRTCommsPort * * createBorderPorts ( UMLRTSlot * slot, size_t numPorts ) const = 0;
35
36 // Create a internal port list. No ports are connected yet.
37 virtual const UMLRTCommsPort * createInternalPorts ( UMLRTSlot * slot, const UMLRTCapsuleClass * capsuleClass, size_t numPortRoles, const UMLRTCommsPortRole portRoles[] ) const = 0;
38
39 // The capsule is declaring the port as 'bound'. The port is not a relay port.
40 virtual void bindPort ( const UMLRTCommsPort * port, int index ) const = 0;
41
42 // The capsule is binding the port to a sub-capsule port. The port a relay port.
43 virtual void bindSubcapsulePort ( bool isBorder, UMLRTCapsule * subcapsule, int portIndex, int farEndIndex ) const = 0;
44
45 // The capsule is unbinding its port. The port is not a relay port.
46 virtual void unbindPort ( const UMLRTCommsPort * port, int index ) const = 0;
47
48 // The capsule is unbinding the port from a sub-capsule port. The port a relay port.
49 virtual void unbindSubcapsulePort ( bool isBorder, UMLRTCapsule * subcapsule, int portIndex, int farEndIndex ) const = 0;
50
51};
52
53#endif // UMLRTRTSINTERFACE_HH