Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kotbegemot committed Mar 17, 2024
1 parent e7fd54a commit 3fef01f
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 24 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/mac-os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
runs-on: macos-latest

steps:
#- uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest

- uses: actions/checkout@v2
- name: Install system dependencies
run: |
Expand All @@ -31,8 +27,7 @@ jobs:
mkdir -p build
cmake -B build -GNinja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
-DALLOW_EXAMPLES=ON \
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
-DALLOW_TESTS=ON \
-DENABLE_TESTS_MEASUREMENTS=ON \
-DALLOW_BENCHMARK=ON \
Expand Down
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,34 @@ if (NOT CMAKE_BUILD_TYPE)
endif()

add_compile_options(
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang,AppleClang>,$<CONFIG:DEBUG>>:-fno-rtti;-Wall>"
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang,AppleClang>,$<CONFIG:RELEASE>>:-fno-rtti;-Wall>"
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang,AppleClang>,$<CONFIG:DEBUG>>:-fno-rtti;>"
"$<$<AND:$<CXX_COMPILER_ID:GNU,Clang,AppleClang>,$<CONFIG:RELEASE>>:-fno-rtti;>"
)

if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
add_compile_options(
-Wall
-Wextra
-Wpedantic

-Wcast-align
-Wcast-qual
-Wconversion
-Wctor-dtor-privacy
-Wenum-compare
-Wfloat-equal
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wredundant-decls
-Wsign-conversion
-Wsign-promo
)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4 /WX)
endif ()


if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND UNIX AND NOT APPLE ) #------------------------------------- Clang
############## LLVM CONFIGURATION #################
# https://github.com/nsumner/llvm-demo Example LLVM Build
Expand Down
2 changes: 1 addition & 1 deletion examples/dataflow/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class actor_test_t final : public actor_zeta::basic_actor<actor_test_t> {
}

void process_data(data_t&& data) {
auto ms_dur = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - data.time()).count();
///auto ms_dur = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - data.time()).count();
packets_a--;
if (packets_a.load() > 0)
std::cout << __func__ << " :: packets_a " << packets_a.load() << " OUT >>>" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions header/actor-zeta/base/behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace actor_zeta { namespace base {
behavior_t(behavior_t&&) = default;
behavior_t& operator=(behavior_t&&) = default;

behavior_t(actor_zeta::pmr::memory_resource* resource, id name, action handler) {
behavior_t(actor_zeta::pmr::memory_resource*, id name, action handler) {
///assert(id_.integer_value() == mailbox::detail::default_async_value);
id_ = name;
handler_ = std::move(handler);
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace actor_zeta { namespace base {

template<class F>
behavior_t make_behavior(actor_zeta::pmr::memory_resource* resource, F&& f) {
return {resource, mailbox::message_id{}, std::move(action(std::forward<F>(f)))};
return {resource, mailbox::message_id{}, action(std::forward<F>(f))};
}
//// todo: rename behavior
/*template<class F>
Expand All @@ -86,7 +86,7 @@ namespace actor_zeta { namespace base {
}
*/
template<class T>
void invoke(behavior_t& instance, T* ptr, mailbox::message* msg) {
void invoke(behavior_t& instance, T* , mailbox::message* msg) {
instance(msg);
/// todo: add error handling
/*
Expand Down
3 changes: 1 addition & 2 deletions header/actor-zeta/base/detail/hfsm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace actor_zeta { namespace detail {
hfsm& operator=(const hfsm&) = delete;
hfsm() = delete;

hfsm(actor_zeta::pmr::memory_resource* resource) {
}
hfsm(actor_zeta::pmr::memory_resource* ) {}

void pop_back() {
assert(!elements_.empty());
Expand Down
7 changes: 0 additions & 7 deletions header/actor-zeta/impl/actor/actor_abstract.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@

namespace actor_zeta { namespace base {

static void error_sync_contacts(const std::string& name, const std::string& error) {
std::cerr << "WARNING" << '\n';
std::cerr << "Actor name : " << name << '\n';
std::cerr << "Not initialization address type:" << error << '\n';
std::cerr << "WARNING" << std::endl;
}

actor_abstract::~actor_abstract() {
}

Expand Down
2 changes: 1 addition & 1 deletion header/actor-zeta/impl/handler.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace actor_zeta { namespace base {
void apply_impl_for_class(ClassPtr *ptr,F &&f, mailbox::message *ctx, type_traits::index_sequence<I...>) {
using call_trait = type_traits::get_callable_trait_t<type_traits::remove_reference_t<F>>;
using args_type_list = typename call_trait::args_types;
using result_type = typename call_trait::result_type;
//using result_type = typename call_trait::result_type;
///using Tuple = type_list_to_tuple_t<args_type_list>;
auto &args = ctx->body();
//(ptr->*f)(static_cast< forward_arg<args_type_list, I>>(std::get<I>(args))...);
Expand Down
2 changes: 1 addition & 1 deletion header/actor-zeta/impl/scheduler/scheduler_abstract.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace actor_zeta { namespace scheduler {

dummy_unit dummy{};
while (!dummy.resumables.empty()) {
auto sub = dummy.resumables.back();
/* ??? auto sub = ??? */ dummy.resumables.back();
dummy.resumables.pop_back();
}

Expand Down
2 changes: 1 addition & 1 deletion test/actor-id/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class storage_t final : public actor_zeta::basic_actor<storage_t> {
actor_zeta::behavior_t behavior() {
return actor_zeta::make_behavior(
resource(),
[this](actor_zeta::message* msg) -> void {
[](actor_zeta::message* ) -> void {

});
}
Expand Down

0 comments on commit 3fef01f

Please sign in to comment.