Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.doc/featuremodel')
-rw-r--r--plugins/org.eclipse.etrice.doc/featuremodel/etrice.roomlanguage.featurizer86
1 files changed, 86 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.doc/featuremodel/etrice.roomlanguage.featurizer b/plugins/org.eclipse.etrice.doc/featuremodel/etrice.roomlanguage.featurizer
index f3a983d3c..ebb499f38 100644
--- a/plugins/org.eclipse.etrice.doc/featuremodel/etrice.roomlanguage.featurizer
+++ b/plugins/org.eclipse.etrice.doc/featuremodel/etrice.roomlanguage.featurizer
@@ -1098,11 +1098,97 @@ Feature ProtocolClass
contains Attribute
contains Operation
contains Annotation
+ contains PortClass
uses Inheritance
stable
;
+Feature PortClass
+ description '''A PortClass allows a specifc implementation of a port class of a protocol'''
+ text '''
+ *This is an advanced feature which is highly target language specific.*
+
+ A ProtocolClass may define a port class which can be used to intercept messages within a port either on the sending or on the receiving side. On the sending side the messages are intercepted before they are passed to the message service. On the receiving side they are intercepted before they are passed to the receiving actor.
+
+ A PortClass is always either *regular*, i.e. it "lives" within a regular port, or *conjugated*. A PortClass may define local attributes, operations and/or handlers for incoming or outgoing messages. The message direction of handlers in PortClasses always matches the message direction of the ProtocolClass. It is not switched for the *conjugated* PortClass. Whether a message is passed from the message service into the handler and has to be forwarded to the actor or vise versa depends on the type of the PortClass (*regular*, *conjugated*) and the message direction in the ProtocolClass.
+ '''
+ example |||
+ ```room
+ // This example uses the port class interface provided by the c code generator
+ ProtocolClass PingPong {
+ incoming {
+ Message ping(uint8)
+ }
+ outgoing {
+ Message pong(uint8)
+ }
+ regular PortClass {
+ handle incoming ping '''
+ uint8 msgDataOffset = MEM_CEIL(sizeof(etMessage));
+ uint8 transitionData = (uint8)((char*)msg + msgDataOffset);;
+
+ // do something here
+
+ /* hand over the message to the actor: */
+ (*receiveMessageFunc)(actor, self, msg);
+ '''
+ handle outgoing pong '''
+ uint8 transitionData = data__et;
+
+ // do something with the data here
+
+ // hand over data to message service
+ etPort_sendMessage(self, PingPong_OUT_pong, sizeof(uint8), &transitionData);
+ '''
+ }
+ conjugated PortClass {
+ handle incoming ping '''
+ // The ping message is outgoing in the conjugated portclass
+ uint8 transitionData = data__et;
+
+ // do something with the data here
+
+ // hand over data to message service
+ etPort_sendMessage(self, PingPong_IN_ping, sizeof(uint8), &transitionData);
+ '''
+ handle outgoing pong '''
+ // The pong message is incoming in the conjugated portclass
+ uint8 msgDataOffset = MEM_CEIL(sizeof(etMessage));
+ uint8 transitionData = (uint8)((char*)msg + msgDataOffset);;
+
+ // do something here
+
+ /* hand over the message to the actor: */
+ (*receiveMessageFunc)(actor, self, msg);
+ '''
+ }
+ }
+ ```
+ |||
+ help |||
+ ```room
+ // This example uses the port class interface provided by the c code generator
+ ProtocolClass PingPong {
+ incoming {
+ Message ping(uint8)
+ }
+ outgoing {
+ Message pong(uint8)
+ }
+ regular PortClass {
+ //...
+ }
+ conjugated PortClass {
+ // ...
+ }
+ }
+ ```
+ |||
+
+ stable
+;
+
abstract Feature DataType
description '''A DataType can take 4 forms and types data elements like an Attribute or Operation argument'''
stable

Back to the top