Skip to content

Commit

Permalink
2.5.1
Browse files Browse the repository at this point in the history
Maintenance update
  • Loading branch information
andrew-gresyk committed May 25, 2024
1 parent 6ac8806 commit 0b5cb38
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 45 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ jobs:
CC: gcc-12,
CXX: g++-12
}
- {
OS: ubuntu-22.04,
CC: gcc-13,
CXX: g++-13
}
- {
OS: ubuntu-22.04,
CC: gcc-14,
CXX: g++-14
}
- {
OS: ubuntu-20.04,
CC: clang-6.0,
Expand Down Expand Up @@ -101,12 +111,12 @@ jobs:
VERSION: '15'
}
- {
OS: macos-11,
OS: macos-14,
CC: clang,
CXX: clang++
}
- {
OS: macos-12,
OS: macos-14-large,
CC: clang,
CXX: clang++
}
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 3.5)

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "Found ccache in ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()

project(ffsm2_test)

file(GLOB SOURCE_FILES "test/*.cpp" "test/shared/*.cpp")
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ Header-only flat FSM framework in C++11, with fully statically-defined structure

## Compiler Support

- Visual Studio: 2015, **2017, 2019, 2022**
- GCC: 5, 6, 7, **8, 9, 10, 11, 12**
- ARM GCC: **9**
- Clang: 3.9, 4, 5, **6, 7, 8, 9, 10, 11, 12, 13, 14, 15**
- AppleClang: 12, **13, 13**

(Currently CI-tested toolchains in **bold**)
- Visual Studio: **2017, 2019, 2022**
- GCC: **8, 9, 10, 11, 12, 13, 14**
- GCC (ARM): **9**
- Clang: **6, 7, 8, 9, 10, 11, 12, 13, 14, 15**
- AppleClang: **14**
- AppleClang (ARM): **14**

---

Expand Down
28 changes: 14 additions & 14 deletions development/ffsm2/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ struct G_ final {
using Context = TContext;
using Activation = TActivation;

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

static constexpr Short SUBSTITUTION_LIMIT = NSubstitutionLimit;

#if FFSM2_PLANS_AVAILABLE()
Expand All @@ -34,8 +30,12 @@ struct G_ final {
using Task = TaskT<Payload>;
#endif

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

/// @brief Set Context type
/// @tparam T Context type for data shared between states and/or data interface between FSM and external code
/// @tparam `T` Context type for data shared between states and/or data interface between FSM and external code
template <typename T>
using ContextT = G_<FEATURE_TAG, T , Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

Expand All @@ -46,21 +46,21 @@ struct G_ final {
#endif

/// @brief Set Substitution limit
/// @tparam N Maximum number times 'guard()' methods can substitute their states for others
template <Long N>
/// @tparam `N` Maximum number times 'guard()' methods can substitute their states for others
template <Short N>
using SubstitutionLimitN = G_<FEATURE_TAG, Context, Activation, N FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

#if FFSM2_PLANS_AVAILABLE()

/// @brief Set Task capacity
/// @tparam N Maximum number of tasks across all plans
/// @tparam `N` Maximum number of tasks across all plans
template <Long N>
using TaskCapacityN = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT , N , Payload>;

#endif

/// @brief Set Transition Payload type
/// @tparam T Utility type for 'TUtility State::utility() const' method
/// @tparam `T` Payload type
template <typename T>
using PayloadT = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), T >;
};
Expand Down Expand Up @@ -116,13 +116,13 @@ struct M_<
// COMMON

/// @brief Root
/// @tparam THead Head state
/// @tparam TSubStates Sub-states
/// @tparam `THead` Head state
/// @tparam `TSubStates` Sub-states
template <typename THead, typename... TSubStates>
using Root = RF_<Cfg, CI_<THead, TSubStates...>>;

/// @brief Headless root
/// @tparam TSubStates Sub-states
/// @tparam `TSubStates` Sub-states
template < typename... TSubStates>
using PeerRoot = RF_<Cfg, CI_<void, TSubStates...>>;

Expand All @@ -148,8 +148,8 @@ using Config = detail::G_<
>;

/// @brief 'Template namespace' for FSM classes
/// @tparam TConfig 'ConfigT<>' type configuration for MachineT<>
/// @see ConfigT<>
/// @tparam `TConfig` `ConfigT<>` type configuration for MachineT<>
/// @see `ConfigT<>`
template <typename TConfig = Config>
using MachineT = detail::M_<TConfig>;

Expand Down
10 changes: 6 additions & 4 deletions development/ffsm2/machine_dev.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FFSM2 (flat state machine for games and interactive applications)
// 2.4.0 (2023-12-25)
// 2.5.1 (2024-05-25)
//
// Created by Andrew Gresyk
//
Expand All @@ -9,7 +9,7 @@
//
// MIT License
//
// Copyright (c) 2023
// Copyright (c) 2024
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,11 +32,13 @@
#pragma once

#define FFSM2_VERSION_MAJOR 2
#define FFSM2_VERSION_MINOR 4
#define FFSM2_VERSION_PATCH 0
#define FFSM2_VERSION_MINOR 5
#define FFSM2_VERSION_PATCH 1

#define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH)

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#include <stdint.h> // uint32_t, uint64_t
#include <string.h> // memcpy_s()

Expand Down
36 changes: 18 additions & 18 deletions include/ffsm2/machine.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FFSM2 (flat state machine for games and interactive applications)
// 2.4.0 (2023-12-25)
// 2.5.1 (2024-05-25)
//
// Created by Andrew Gresyk
//
Expand All @@ -9,7 +9,7 @@
//
// MIT License
//
// Copyright (c) 2023
// Copyright (c) 2024
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,8 +32,8 @@
#pragma once

#define FFSM2_VERSION_MAJOR 2
#define FFSM2_VERSION_MINOR 4
#define FFSM2_VERSION_PATCH 0
#define FFSM2_VERSION_MINOR 5
#define FFSM2_VERSION_PATCH 1

#define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH)

Expand Down Expand Up @@ -6483,10 +6483,6 @@ struct G_ final {
using Context = TContext;
using Activation = TActivation;

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

static constexpr Short SUBSTITUTION_LIMIT = NSubstitutionLimit;

#if FFSM2_PLANS_AVAILABLE()
Expand All @@ -6500,8 +6496,12 @@ struct G_ final {
using Task = TaskT<Payload>;
#endif

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

/// @brief Set Context type
/// @tparam T Context type for data shared between states and/or data interface between FSM and external code
/// @tparam `T` Context type for data shared between states and/or data interface between FSM and external code
template <typename T>
using ContextT = G_<FEATURE_TAG, T , Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

Expand All @@ -6512,21 +6512,21 @@ struct G_ final {
#endif

/// @brief Set Substitution limit
/// @tparam N Maximum number times 'guard()' methods can substitute their states for others
template <Long N>
/// @tparam `N` Maximum number times 'guard()' methods can substitute their states for others
template <Short N>
using SubstitutionLimitN = G_<FEATURE_TAG, Context, Activation, N FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

#if FFSM2_PLANS_AVAILABLE()

/// @brief Set Task capacity
/// @tparam N Maximum number of tasks across all plans
/// @tparam `N` Maximum number of tasks across all plans
template <Long N>
using TaskCapacityN = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT , N , Payload>;

#endif

/// @brief Set Transition Payload type
/// @tparam T Utility type for 'TUtility State::utility() const' method
/// @tparam `T` Payload type
template <typename T>
using PayloadT = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), T >;
};
Expand Down Expand Up @@ -6577,13 +6577,13 @@ struct M_<
#endif

/// @brief Root
/// @tparam THead Head state
/// @tparam TSubStates Sub-states
/// @tparam `THead` Head state
/// @tparam `TSubStates` Sub-states
template <typename THead, typename... TSubStates>
using Root = RF_<Cfg, CI_<THead, TSubStates...>>;

/// @brief Headless root
/// @tparam TSubStates Sub-states
/// @tparam `TSubStates` Sub-states
template < typename... TSubStates>
using PeerRoot = RF_<Cfg, CI_<void, TSubStates...>>;

Expand All @@ -6604,8 +6604,8 @@ using Config = detail::G_<
>;

/// @brief 'Template namespace' for FSM classes
/// @tparam TConfig 'ConfigT<>' type configuration for MachineT<>
/// @see ConfigT<>
/// @tparam `TConfig` `ConfigT<>` type configuration for MachineT<>
/// @see `ConfigT<>`
template <typename TConfig = Config>
using MachineT = detail::M_<TConfig>;

Expand Down

0 comments on commit 0b5cb38

Please sign in to comment.