From 626bf898cd5f8a892696b633d5aeb7119b93f239 Mon Sep 17 00:00:00 2001 From: Dax Hawkins <57684232+daxhaw@users.noreply.github.com> Date: Thu, 18 Mar 2021 20:23:28 -0700 Subject: [PATCH] Ensure samples comply with March release docs and C++11 (#592) --- production/examples/hello/CMakeLists.txt | 2 +- production/examples/hello/README.md | 4 ++-- production/examples/hello/build.sh | 4 ++-- production/examples/hello/hello.ddl | 4 ++-- production/examples/incubator/incubator.ddl | 10 +++++----- production/examples/incubator/incubator.ruleset | 3 +-- production/inc/gaia/direct_access/edc_expressions.hpp | 2 +- production/inc/gaia/direct_access/edc_object.hpp | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/production/examples/hello/CMakeLists.txt b/production/examples/hello/CMakeLists.txt index 2214a50d2d93..fdc469408259 100644 --- a/production/examples/hello/CMakeLists.txt +++ b/production/examples/hello/CMakeLists.txt @@ -47,4 +47,4 @@ set_target_properties(hello PROPERTIES COMPILE_FLAGS ${GAIA_COMPILE_FLAGS}) set_target_properties(hello PROPERTIES LINK_FLAGS ${GAIA_LINK_FLAGS}) target_include_directories(hello PRIVATE ${GAIA_INC}) target_include_directories(hello PRIVATE ${PROJECT_BINARY_DIR}) -target_link_libraries(hello PRIVATE rt pthread gaia) +target_link_libraries(hello PRIVATE gaia rt pthread) diff --git a/production/examples/hello/README.md b/production/examples/hello/README.md index 6ae773af6a99..37b65f61c092 100644 --- a/production/examples/hello/README.md +++ b/production/examples/hello/README.md @@ -18,8 +18,8 @@ select * from hello_fdw.greetings; You can also build this code with the `cmake` and `make` tools, by using the included CMakeLists.txt file. Before doing this, you should specify the clang compiler by setting the following variables in your environment: ``` -export CC=/usr/bin/clang-8 -export CXX=/usr/bin/clang++-8 +export CC=/usr/bin/clang-10 +export CXX=/usr/bin/clang++-10 ``` The steps for the cmake build are: diff --git a/production/examples/hello/build.sh b/production/examples/hello/build.sh index e4197273ee56..1167707a9e22 100755 --- a/production/examples/hello/build.sh +++ b/production/examples/hello/build.sh @@ -7,6 +7,6 @@ gaiac -g hello.ddl -gaiat hello.ruleset -output hello_ruleset.cpp -- -I /usr/lib/clang/8/include/ -I /opt/gaia/include/ +gaiat hello.ruleset -output hello_ruleset.cpp -- -I /usr/lib/clang/10/include/ -I /opt/gaia/include/ -clang++-8 hello.cpp hello_ruleset.cpp /usr/local/lib/libgaia.so -I /opt/gaia/include -Wl,-rpath,/usr/local/lib -lpthread -o hello +clang++-10 hello.cpp hello_ruleset.cpp /usr/local/lib/libgaia.so -I /opt/gaia/include -Wl,-rpath,/usr/local/lib -lpthread -o hello diff --git a/production/examples/hello/hello.ddl b/production/examples/hello/hello.ddl index b10ed49dab1d..8c21cc29fa1b 100644 --- a/production/examples/hello/hello.ddl +++ b/production/examples/hello/hello.ddl @@ -5,10 +5,10 @@ create table if not exists names ( - name string active + name string ); create table if not exists greetings ( - greeting string active + greeting string ); diff --git a/production/examples/incubator/incubator.ddl b/production/examples/incubator/incubator.ddl index 2cb5b57dd08b..e4eb43e59bde 100644 --- a/production/examples/incubator/incubator.ddl +++ b/production/examples/incubator/incubator.ddl @@ -5,21 +5,21 @@ create table if not exists incubator ( name string, - is_on bool active, - min_temp float active, - max_temp float active + is_on bool, + min_temp float, + max_temp float ); create table if not exists sensor ( name string, timestamp uint64, - value float active, + value float, references incubator ); create table if not exists actuator ( name string, timestamp uint64, - value float active, + value float, references incubator ); diff --git a/production/examples/incubator/incubator.ruleset b/production/examples/incubator/incubator.ruleset index f5972e4ec578..464c7329217d 100644 --- a/production/examples/incubator/incubator.ruleset +++ b/production/examples/incubator/incubator.ruleset @@ -37,9 +37,8 @@ ruleset incubator_ruleset } // Rule 2: Turn off all the fans if the incubator is powered down. - OnUpdate(incubator.is_on) { - if (!incubator.is_on) + if (!@incubator.is_on) { actuator.value = 0; actuator.timestamp = g_timestamp; diff --git a/production/inc/gaia/direct_access/edc_expressions.hpp b/production/inc/gaia/direct_access/edc_expressions.hpp index 527a1abb962c..be93c56dccde 100644 --- a/production/inc/gaia/direct_access/edc_expressions.hpp +++ b/production/inc/gaia/direct_access/edc_expressions.hpp @@ -166,7 +166,7 @@ class expression_t template expression_decorator_t contains(expression_decorator_t predicate); - template >> + template ::value>> expression_decorator_t contains(const T_value& object); expression_decorator_t empty(); diff --git a/production/inc/gaia/direct_access/edc_object.hpp b/production/inc/gaia/direct_access/edc_object.hpp index 647176c5e485..e73fed2e5122 100644 --- a/production/inc/gaia/direct_access/edc_object.hpp +++ b/production/inc/gaia/direct_access/edc_object.hpp @@ -167,7 +167,7 @@ struct edc_object_t : edc_base_t template static edc_vector_t to_edc_vector(const flatbuffers::Vector* vector_ptr) { - return edc_vector_t(vector_ptr); + return edc_vector_t(vector_ptr); }; };