Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference/src-gen')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c24
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h33
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c18
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h25
4 files changed, 100 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
new file mode 100644
index 000000000..d4235dbc3
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
@@ -0,0 +1,24 @@
+#include "DataClass1.h"
+
+#include <string.h>
+
+//--------------------- begin user code
+ // usercode3
+//--------------------- end user code
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value) {
+ return self->Attr1*value;
+}
+float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value) {
+ return self->Attr3*value;
+}
+
+// deep copy
+void DataClass1_deepCopy(DataClass1* source, DataClass1* target) {
+ memcpy(target, source, sizeof(DataClass1));
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
new file mode 100644
index 000000000..dbf8dee81
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
@@ -0,0 +1,33 @@
+#ifndef _DataClass1_H_
+#define _DataClass1_H_
+
+#include "etDatatypes.h"
+
+/* TODO: includes only for used DataClasses, also for other models */
+#include "DataClass2.h"
+
+//--------------------- begin user code
+ // usercode1
+//--------------------- end user code
+
+typedef struct {
+ //--------------------- begin user code
+ // usercode2
+ //--------------------- end user code
+ //--------------------- attributes
+ int32 Attr1;
+ DataClass2 ComplexAttr;
+ float32 Attr3;
+} DataClass1;
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+int32 DataClass1_MultiplyWithAttr1(DataClass1* self, int32 value);
+float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value);
+
+// deep copy
+void DataClass1_deepCopy(DataClass1* source, DataClass1* target);
+
+#endif /* _DataClass1_H_ */
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
new file mode 100644
index 000000000..2150d7b41
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
@@ -0,0 +1,18 @@
+#include "DataClass2.h"
+
+#include <string.h>
+
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+void DataClass2_Operation1(DataClass2* self) {
+ /*nothing to do*/
+}
+
+// deep copy
+void DataClass2_deepCopy(DataClass2* source, DataClass2* target) {
+ memcpy(target, source, sizeof(DataClass2));
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
new file mode 100644
index 000000000..2d8cbb74f
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
@@ -0,0 +1,25 @@
+#ifndef _DataClass2_H_
+#define _DataClass2_H_
+
+#include "etDatatypes.h"
+
+/* TODO: includes only for used DataClasses, also for other models */
+
+
+typedef struct {
+ //--------------------- attributes
+ int32 Attr1;
+ float32 Attr2;
+ int32 Attr3;
+} DataClass2;
+
+// TODO: do we need setters and getters for C and C++ ?
+
+//--------------------- operations
+void DataClass2_Operation1(DataClass2* self);
+
+// deep copy
+void DataClass2_deepCopy(DataClass2* source, DataClass2* target);
+
+#endif /* _DataClass2_H_ */
+

Back to the top