Skip to content

Commit

Permalink
Ensure samples comply with March release docs and C++11 (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxhaw authored Mar 19, 2021
1 parent b4c00b2 commit 626bf89
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion production/examples/hello/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions production/examples/hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions production/examples/hello/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions production/examples/hello/hello.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
10 changes: 5 additions & 5 deletions production/examples/incubator/incubator.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
3 changes: 1 addition & 2 deletions production/examples/incubator/incubator.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion production/inc/gaia/direct_access/edc_expressions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class expression_t
template <typename T_value>
expression_decorator_t<T_class> contains(expression_decorator_t<T_value> predicate);

template <typename T_value, typename = std::enable_if<std::is_base_of_v<edc_base_t, T_value>>>
template <typename T_value, typename = std::enable_if<std::is_base_of<edc_base_t, T_value>::value>>
expression_decorator_t<T_class> contains(const T_value& object);

expression_decorator_t<T_class> empty();
Expand Down
2 changes: 1 addition & 1 deletion production/inc/gaia/direct_access/edc_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct edc_object_t : edc_base_t
template <typename T_type>
static edc_vector_t<T_type> to_edc_vector(const flatbuffers::Vector<T_type>* vector_ptr)
{
return edc_vector_t(vector_ptr);
return edc_vector_t<T_type>(vector_ptr);
};
};

Expand Down

0 comments on commit 626bf89

Please sign in to comment.