Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2017-12-14 16:51:00 -0500
committerJan Belle2017-12-14 16:51:00 -0500
commit8d1cde6da1afc6e63eb4930544bb43922f2154bd (patch)
treef110e06d48627e7463631d974ef1790ee29a04b6
parent5ec7fb22f369a60402a06fbfd6992491357ff23f (diff)
downloadorg.eclipse.etrice-8d1cde6da1afc6e63eb4930544bb43922f2154bd.tar.gz
org.eclipse.etrice-8d1cde6da1afc6e63eb4930544bb43922f2154bd.tar.xz
org.eclipse.etrice-8d1cde6da1afc6e63eb4930544bb43922f2154bd.zip
[releng] compile xtend files in gradle build
[runtime.c] moved etStaticDeque documentation to DoxyGen comments Change-Id: Iaa3232d709bce2acf7a00e35fa577ff2a7d15065
-rw-r--r--build.gradle9
-rw-r--r--doc/runtime/CRuntime.adoc39
-rw-r--r--plugins/build.gradle41
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle12
-rw-r--r--plugins/org.eclipse.etrice.core.common/build.gradle17
-rw-r--r--plugins/org.eclipse.etrice.core.config/build.gradle18
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/build.gradle17
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/build.gradle18
-rw-r--r--plugins/org.eclipse.etrice.core.fsm/build.gradle17
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle12
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/build.gradle12
-rw-r--r--plugins/org.eclipse.etrice.core.room/build.gradle17
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter/build.gradle10
-rw-r--r--plugins/org.eclipse.etrice.generator.c/build.gradle11
-rw-r--r--plugins/org.eclipse.etrice.generator.config/build.gradle13
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/build.gradle11
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/build.gradle14
-rw-r--r--plugins/org.eclipse.etrice.generator.fsm/build.gradle13
-rw-r--r--plugins/org.eclipse.etrice.generator.gnuplot/build.gradle13
-rw-r--r--plugins/org.eclipse.etrice.generator.java/build.gradle11
-rw-r--r--plugins/org.eclipse.etrice.generator/build.gradle13
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.c12
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.h40
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h63
24 files changed, 144 insertions, 309 deletions
diff --git a/build.gradle b/build.gradle
index b52ba603f..cfaa706ac 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,12 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'org.xtext:xtext-gradle-plugin:1.0.19'
+ }
+}
+
ext {
core_runtime_version = '3.12.0'
core_resources_version = '3.11.1'
diff --git a/doc/runtime/CRuntime.adoc b/doc/runtime/CRuntime.adoc
deleted file mode 100644
index 2efe0da0e..000000000
--- a/doc/runtime/CRuntime.adoc
+++ /dev/null
@@ -1,39 +0,0 @@
-= eTrice C Runtime
-:toc:
-
-== Container
-
-=== etStaticDeque
-
-etStaticDeque is a data structure for storing objects of equal size in order.
-The size of the deque is limited by the memory provided by the user.
-Pushing/Popping elements to/from the front and the back as well as arbitrary access is supported in constant time.
-
-The data structure relies on a circular buffer implemented as an array.
-
-.Example etStaticDeque
-[source, c]
-----
-typedef struct Data {
- int i;
- float f
-} Data;
-
-#define DEQUE_SIZE 100
-
-Data deque_memory[DEQUE_SIZE];
-etStaticDeque deque;
-etStaticDeque_construct(&deque, deque_memory, DEQUE_SIZE, sizeof(Data)); // Construct deque and hand over memory for the objects
-
-Data d = { 1, 0.1f };
-etStaticDeque_push_front(&deque, &d); // Push to the front
-
-d = { 2, 0.2f };
-etStaticDeque_push_back(&deque, &d); // Push to the end
-
-etStaticDeque_get(&deque, 0); // Returns pointer to { 1, 0.1f }
-etStaticDeque_get(&deque, 1); // Returns pointer to { 2, 0.2f }
-
-etStaticDeque_pop_front(&deque) // Pop from the the front
-etStaticDeque_pop_back(&deque) // Pop from the back
-----
diff --git a/plugins/build.gradle b/plugins/build.gradle
new file mode 100644
index 000000000..f1cf52dea
--- /dev/null
+++ b/plugins/build.gradle
@@ -0,0 +1,41 @@
+def xtextProjects = [
+ 'org.eclipse.etrice.core.common',
+ 'org.eclipse.etrice.core.config',
+ 'org.eclipse.etrice.core.etmap',
+ 'org.eclipse.etrice.core.etphys',
+ 'org.eclipse.etrice.core.fsm',
+ 'org.eclipse.etrice.core.room'
+].collect { project it }
+
+subprojects {
+ apply plugin: 'java'
+ apply plugin: 'org.xtext.xtend'
+
+ apply from: "$rootDir/gradle/publish.gradle"
+
+ sourceSets {
+ main {
+ java {
+ srcDir 'src'
+ }
+ }
+ }
+
+ tasks.withType(JavaCompile) {
+ options.encoding = 'cp1252'
+ }
+}
+
+configure(xtextProjects) {
+ sourceSets {
+ main {
+ java {
+ srcDir 'src-gen'
+ }
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
index f85643e51..2ae95e0ac 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
@@ -1,7 +1,3 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.fsm')
@@ -10,12 +6,4 @@ dependencies {
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_runtime_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.common/build.gradle b/plugins/org.eclipse.etrice.core.common/build.gradle
index a7f391845..3f57e1ea2 100644
--- a/plugins/org.eclipse.etrice.core.common/build.gradle
+++ b/plugins/org.eclipse.etrice.core.common/build.gradle
@@ -1,21 +1,6 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_runtime_version"
compile "org.eclipse.platform:org.eclipse.core.resources:$core_resources_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/build.gradle b/plugins/org.eclipse.etrice.core.config/build.gradle
index 0212fd1ab..a1fc32d4f 100644
--- a/plugins/org.eclipse.etrice.core.config/build.gradle
+++ b/plugins/org.eclipse.etrice.core.config/build.gradle
@@ -1,20 +1,6 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.room')
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
+
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etmap/build.gradle b/plugins/org.eclipse.etrice.core.etmap/build.gradle
index 3941075b6..34609e441 100644
--- a/plugins/org.eclipse.etrice.core.etmap/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etmap/build.gradle
@@ -1,24 +1,9 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.etphys')
compile project(':plugins:org.eclipse.etrice.core.room')
compile project(':plugins:org.eclipse.etrice.core.genmodel')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etphys/build.gradle b/plugins/org.eclipse.etrice.core.etphys/build.gradle
index df10849f2..81164bb42 100644
--- a/plugins/org.eclipse.etrice.core.etphys/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etphys/build.gradle
@@ -1,19 +1,5 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
+
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.fsm/build.gradle b/plugins/org.eclipse.etrice.core.fsm/build.gradle
index c2990effc..a28c2698f 100644
--- a/plugins/org.eclipse.etrice.core.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.core.fsm/build.gradle
@@ -1,21 +1,6 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle b/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
index 47043d9b8..8b11df973 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/build.gradle
@@ -1,17 +1,5 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.fsm')
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.genmodel/build.gradle b/plugins/org.eclipse.etrice.core.genmodel/build.gradle
index cec4cbf94..5da59d6ce 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/build.gradle
+++ b/plugins/org.eclipse.etrice.core.genmodel/build.gradle
@@ -1,17 +1,5 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.room')
compile project(':plugins:org.eclipse.etrice.core.genmodel.fsm')
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.room/build.gradle b/plugins/org.eclipse.etrice.core.room/build.gradle
index 65c27312e..b87635769 100644
--- a/plugins/org.eclipse.etrice.core.room/build.gradle
+++ b/plugins/org.eclipse.etrice.core.room/build.gradle
@@ -1,24 +1,9 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.fsm')
runtime project(':plugins:org.eclipse.etrice.abstractexec.behavior')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_runtime_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'src-gen', 'xtend-gen']
- }
- resources {
- srcDirs = ['src', 'src-gen']
- include '**/*.xtextbin', '**/*.tokens'
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.etunit.converter/build.gradle b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
index d360d108f..5f87ab688 100644
--- a/plugins/org.eclipse.etrice.etunit.converter/build.gradle
+++ b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
@@ -1,7 +1,5 @@
apply plugin: 'application'
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_runtime_version"
compile "org.eclipse.emf:org.eclipse.emf.common:$xtext_version"
@@ -9,14 +7,6 @@ dependencies {
compile "org.eclipse.emf:org.eclipse.emf.ecore.xmi:$xtext_version"
}
-sourceSets {
- main {
- java {
- srcDirs = ['src']
- }
- }
-}
-
ext.classpath = sourceSets.main.runtimeClasspath
mainClassName = 'org.eclipse.etrice.etunit.converter.EtUnitReportConverter'
diff --git a/plugins/org.eclipse.etrice.generator.c/build.gradle b/plugins/org.eclipse.etrice.generator.c/build.gradle
index 9b30ce947..e9e58ab22 100644
--- a/plugins/org.eclipse.etrice.generator.c/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.c/build.gradle
@@ -1,7 +1,5 @@
apply plugin: 'application'
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.room')
compile project(':plugins:org.eclipse.etrice.core.etphys')
@@ -14,17 +12,10 @@ dependencies {
compile project(':plugins:org.eclipse.etrice.generator.doc')
compile project(':plugins:org.eclipse.etrice.generator.gnuplot')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
}
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
-}
-
mainClassName = 'org.eclipse.etrice.generator.c.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.config/build.gradle b/plugins/org.eclipse.etrice.generator.config/build.gradle
index e515771f8..bca312710 100644
--- a/plugins/org.eclipse.etrice.generator.config/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.config/build.gradle
@@ -1,7 +1,3 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.room')
@@ -10,13 +6,6 @@ dependencies {
compile project(':plugins:org.eclipse.etrice.core.config')
compile project(':plugins:org.eclipse.etrice.generator')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/build.gradle b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
index 3e8f4dc88..c76486974 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
@@ -1,7 +1,5 @@
apply plugin: 'application'
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.room')
compile project(':plugins:org.eclipse.etrice.core.etphys')
@@ -13,17 +11,10 @@ dependencies {
compile project(':plugins:org.eclipse.etrice.generator.config')
compile project(':plugins:org.eclipse.etrice.generator.doc')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
}
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
-}
-
mainClassName = 'org.eclipse.etrice.generator.cpp.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.doc/build.gradle b/plugins/org.eclipse.etrice.generator.doc/build.gradle
index ae948a25c..b6b3b2411 100644
--- a/plugins/org.eclipse.etrice.generator.doc/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.doc/build.gradle
@@ -1,19 +1,9 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.etmap')
compile project(':plugins:org.eclipse.etrice.core.genmodel')
compile project(':plugins:org.eclipse.etrice.core.genmodel.fsm')
compile project(':plugins:org.eclipse.etrice.generator')
compile project(':plugins:org.eclipse.etrice.generator.fsm')
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
+
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.fsm/build.gradle b/plugins/org.eclipse.etrice.generator.fsm/build.gradle
index 54c69c79e..328aee339 100644
--- a/plugins/org.eclipse.etrice.generator.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.fsm/build.gradle
@@ -1,20 +1,9 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.fsm')
compile project(':plugins:org.eclipse.etrice.core.genmodel.fsm')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_runtime_version"
compile "org.eclipse.platform:org.eclipse.core.resources:$core_resources_version"
compile "commons-io:commons-io:$commons_io_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle b/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
index cc039f1c1..7970f2b44 100644
--- a/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.gnuplot/build.gradle
@@ -1,20 +1,9 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.genmodel')
compile project(':plugins:org.eclipse.etrice.generator')
compile project(':plugins:org.eclipse.etrice.generator.fsm')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.java/build.gradle b/plugins/org.eclipse.etrice.generator.java/build.gradle
index 623d2729e..b40a25ab1 100644
--- a/plugins/org.eclipse.etrice.generator.java/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.java/build.gradle
@@ -1,7 +1,5 @@
apply plugin: 'application'
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.room')
compile project(':plugins:org.eclipse.etrice.core.etphys')
@@ -13,17 +11,10 @@ dependencies {
compile project(':plugins:org.eclipse.etrice.generator.config')
compile project(':plugins:org.eclipse.etrice.generator.doc')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
}
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
-}
-
mainClassName = 'org.eclipse.etrice.generator.java.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator/build.gradle b/plugins/org.eclipse.etrice.generator/build.gradle
index 65d2e65c7..492adc6a8 100644
--- a/plugins/org.eclipse.etrice.generator/build.gradle
+++ b/plugins/org.eclipse.etrice.generator/build.gradle
@@ -1,7 +1,3 @@
-apply plugin: 'java'
-
-apply from: "$rootDir/gradle/publish.gradle"
-
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.fsm')
@@ -11,13 +7,6 @@ dependencies {
compile project(':plugins:org.eclipse.etrice.core.etmap')
compile project(':plugins:org.eclipse.etrice.generator.fsm')
+ compile "org.eclipse.xtend:org.eclipse.xtend.lib:$xtext_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
-}
-
-sourceSets {
- main {
- java {
- srcDirs = ['src', 'xtend-gen']
- }
- }
} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.c b/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.c
index 09d1e5a2a..763185dee 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.c
@@ -12,6 +12,8 @@
#include "etStaticDeque.h"
+#include <string.h>
+
void etStaticDeque_construct(etStaticDeque* const self, void* memory, int size, int objectSize) {
self->size = 0;
self->first = 0;
@@ -28,12 +30,12 @@ void etStaticDeque_clear(etStaticDeque* const self) {
}
void* etStaticDeque_get(const etStaticDeque* const self, int position) {
- // TODO JB: Handle position out of bounds exception
+ /* TODO JB: Handle position out of bounds exception */
return (void*) &self->memory[(self->first + position * self->objectSize) % (self->objectSize * self->maxSize)];
}
void etStaticDeque_push_front(etStaticDeque* const self, void* object) {
- // TODO JB: Handle out of memory exception
+ /* TODO JB: Handle out of memory exception */
if(self->size < self->maxSize) {
++self->size;
self->first = (self->first + (self->maxSize - 1) * self->objectSize) % (self->objectSize * self->maxSize);
@@ -42,7 +44,7 @@ void etStaticDeque_push_front(etStaticDeque* const self, void* object) {
}
void etStaticDeque_push_back(etStaticDeque* const self, void* object) {
- // TODO JB: Handle out of memory exception
+ /* TODO JB: Handle out of memory exception */
if(self->size < self->maxSize) {
++self->size;
memcpy(etStaticDeque_back(self), object, self->objectSize);
@@ -50,7 +52,7 @@ void etStaticDeque_push_back(etStaticDeque* const self, void* object) {
}
void etStaticDeque_pop_front(etStaticDeque* const self) {
- // TODO JB: Handle deque empty exception
+ /* TODO JB: Handle deque empty exception */
if(self->size > 0) {
self->first = (self->first + self->objectSize) % (self->objectSize * self->maxSize);
--self->size;
@@ -58,7 +60,7 @@ void etStaticDeque_pop_front(etStaticDeque* const self) {
}
void etStaticDeque_pop_back(etStaticDeque* const self) {
- // TODO JB: Handle deque empty exception
+ /* TODO JB: Handle deque empty exception */
if(self->size > 0) {
--self->size;
}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.h b/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.h
index 23cc4ca67..2333bb0dc 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/container/etStaticDeque.h
@@ -16,7 +16,10 @@
#include <stdint.h>
/**
- * Implementation of a double ended queue with a circular buffer
+ * etStaticDeque (static double ended queue) is a data structure for storing objects of equal size in order.
+ * The size of the deque is limited by the memory provided by the user.
+ * Pushing/Popping elements to/from the front and the back as well as arbitrary access is supported in constant time.
+ * The data structure relies on a circular buffer implemented as an array.
*/
typedef struct etStaticDeque {
uint8_t* memory; /* memory for the objects */
@@ -27,47 +30,74 @@ typedef struct etStaticDeque {
} etStaticDeque;
/**
- * Constructs the Deque on the given memory with specified size and objectSize
+ * Constructs the Deque on the given memory with specified size and objectSize.
+ *
+ * \param self the pointer to the StaticDeque
+ * \param memory a pointer to the memory for the objects of the StaticDeque
+ * \param size the maximum count of objects that fit into the specified memory
+ * \param objectSize the size of the objects stored in the StaticDeque
*/
void etStaticDeque_construct(etStaticDeque* self, void* memory, int size, int objectSize);
/**
- * Clears the Deque, removes all objects
+ * Clears the Deque, removes all objects.
+ *
+ * \param self the pointer to the StaticDeque
*/
-void etStaticDeque_clear(etStaticDeque* const self);
+void etStaticDeque_clear(etStaticDeque* self);
/**
- * Returns a reference to an arbitrary object at the specified position
+ * Returns a reference to an arbitrary object at the specified position.
+ *
+ * \param self the pointer to the StaticDeque
+ * \param position the position of the object to be returned
+ * \return the object at the specified position
*/
void* etStaticDeque_get(const etStaticDeque* self, int position);
/**
* Copies the object and stores it at the front
+ *
+ * \param self the pointer to the StaticDeque
+ * \param object the object to push to the front of the queue
*/
void etStaticDeque_push_front(etStaticDeque* self, void* object);
/**
* Copies the object and stores it at the end
+ *
+ * \param self the pointer to the StaticDeque
+ * \param object the object to push to the end of the queue
*/
void etStaticDeque_push_back(etStaticDeque* self, void* object);
/**
* Removes the first object
+ *
+ * \param self the pointer to the StaticDeque
*/
void etStaticDeque_pop_front(etStaticDeque* self);
/**
* Removes the last element
+ *
+ * \param self the pointer to the StaticDeque
*/
void etStaticDeque_pop_back(etStaticDeque* self);
/**
* Returns a reference to the first object
+ *
+ * \param self the pointer to the StaticDeque
+ * \return the object at the front of the queue
*/
void* etStaticDeque_front(const etStaticDeque* self);
/**
* Returns a reference to the last object
+ *
+ * \param self the pointer to the StaticDeque
+ * \return the object at the end of the queue
*/
void* etStaticDeque_back(const etStaticDeque* self);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h
index ca1e5e397..de729de9a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/osal/etSocket.h
@@ -28,59 +28,66 @@ typedef struct {
etServerSocket;
/*
- * Constructs a new etSocket and connects to the specified host
- * @param self: pointer to etSocket
- * @param address: address of the host to connect to
- * @param port: port of the host
- * @return: 0 on success
+ * Constructs a new etSocket and connects to the specified host.
+ *
+ * \param self pointer to etSocket
+ * \param address address of the host to connect to
+ * \param port port of the host
+ * \return 0 on success
*/
int etSocket_construct(etSocket* self, const char* address, short port);
/*
- * Destructs the etSocket
- * @param self: pointer to etSocket
- * @return: 0 on success
+ * Destructs the etSocket.
+ *
+ * \param self pointer to etSocket
+ * \return 0 on success
*/
int etSocket_destruct(etSocket* self);
/*
- * Receives data from an etSocket
- * @param self: pointer to etSocket
- * @param buffer: buffer for received data
- * @param length: max length of received data
- * @return: length of received data, -1 when failed
+ * Receives data from an etSocket.
+ *
+ * \param self pointer to etSocket
+ * \param buffer buffer for received data
+ * \param length max length of received data
+ * \return length of received data, -1 when failed
*/
int etSocket_recv(etSocket* self, uint8* buffer, size_t length);
/*
- * Sends data over the etSocket
- * @param self: pointer to etSocket
- * @param buffer: buffer that holds the data to be sent
- * @param length: length of the data
- * @return: length of sent data, -1 when failed
+ * Sends data over the etSocket.
+ *
+ * \param self pointer to etSocket
+ * \param buffer buffer that holds the data to be sent
+ * \param length length of the data
+ * \return length of sent data, -1 when failed
*/
int etSocket_send(etSocket* self, uint8* buffer, size_t length);
/*
- * Constructs a new etServerSocket and starts to listen on the specified port
- * @param self: pointer to etServerSocket
- * @param port: port number
- * @return: 0 on success
+ * Constructs a new etServerSocket and starts to listen on the specified port.
+ *
+ * \param self pointer to etServerSocket
+ * \param port port number
+ * \return: 0 on success
*/
int etServerSocket_construct(etServerSocket* self, short port);
/*
- * Destructs an etServerSocket
- * @param self: pointer to etServerSocket
- * @return: 0 on success
+ * Destructs an etServerSocket.
+ *
+ * \param self pointer to etServerSocket
+ * \return 0 on success
*/
int etServerSocket_destruct(etServerSocket* self);
/*
- * Accepts a new connection
- * @param self: pointer to etServerSocket
- * @param socket: pointer to the etSocket for the new connection
+ * Accepts a new connection.
+ *
+ * \param self pointer to etServerSocket
+ * \param socket pointer to the etSocket for the new connection
*/
int etServerSocket_accept(etServerSocket* self, etSocket* socket);

Back to the top