...
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
#include <iostream>
|
||||
#include <typeinfo>
|
||||
|
||||
#include "../mcc_fsm.h"
|
||||
#include "../mcc_finite_state_machine.h"
|
||||
// #include "../mcc_fsm.h"
|
||||
|
||||
using namespace mcc;
|
||||
|
||||
@@ -30,34 +31,52 @@ struct EV3 {
|
||||
struct ST1;
|
||||
struct ST2;
|
||||
|
||||
struct STN : fsm::MccFsmAbstractState {
|
||||
struct STN {
|
||||
static constexpr std::string_view ID = "STN";
|
||||
using transition_t = trans_table_t<std::pair<EV1, STN>, std::pair<EV2, ST2>>;
|
||||
using transition_t = fsm::fsm_transition_table_t<std::pair<EV1, STN>, std::pair<EV2, ST2>>;
|
||||
};
|
||||
|
||||
struct ST3 : fsm::MccFsmAbstractState {
|
||||
struct ST3 {
|
||||
static constexpr std::string_view ID = "ST3";
|
||||
using transition_t = trans_table_t<std::pair<EV1, ST1>, std::pair<EV2, ST2>>;
|
||||
using transition_t = fsm::fsm_transition_table_t<std::pair<EV1, ST1>, std::pair<EV2, ST2>>;
|
||||
};
|
||||
|
||||
struct ST2 : fsm::MccFsmAbstractState {
|
||||
struct ST2 {
|
||||
static constexpr std::string_view ID = "ST2";
|
||||
using transition_t = trans_table_t<std::pair<EV2, STN>, std::pair<EV3, ST3>>;
|
||||
using transition_t = fsm::fsm_transition_table_t<std::pair<EV2, STN>, std::pair<EV3, ST3>>;
|
||||
};
|
||||
|
||||
struct ST1 : fsm::MccFsmAbstractState {
|
||||
struct ST1 {
|
||||
static constexpr std::string_view ID = "ST1";
|
||||
using transition_t = trans_table_t<std::pair<EV1, ST2>, std::pair<EV2, STN>>;
|
||||
using transition_t = fsm::fsm_transition_table_t<std::pair<EV1, ST2>, std::pair<EV2, STN>>;
|
||||
};
|
||||
|
||||
// using tr_t = fsm::MccFsmAbstractState::trans_table_t<std::pair<EV1, ST1>>;
|
||||
// struct STN : fsm::MccFsmAbstractState {
|
||||
// static constexpr std::string_view ID = "STN";
|
||||
// using transition_t = trans_table_t<std::pair<EV1, STN>, std::pair<EV2, ST2>>;
|
||||
// };
|
||||
|
||||
// static_assert(fsm::traits::fsm_trans_table_c<tr_t>, "!!!!!!!!!!!!!");
|
||||
// struct ST3 : fsm::MccFsmAbstractState {
|
||||
// static constexpr std::string_view ID = "ST3";
|
||||
// using transition_t = trans_table_t<std::pair<EV1, ST1>, std::pair<EV2, ST2>>;
|
||||
// };
|
||||
|
||||
fsm::MccFiniteStateMachine<ST1> fsm;
|
||||
// struct ST2 : fsm::MccFsmAbstractState {
|
||||
// static constexpr std::string_view ID = "ST2";
|
||||
// using transition_t = trans_table_t<std::pair<EV2, STN>, std::pair<EV3, ST3>>;
|
||||
// };
|
||||
|
||||
// struct ST1 : fsm::MccFsmAbstractState {
|
||||
// static constexpr std::string_view ID = "ST1";
|
||||
// using transition_t = trans_table_t<std::pair<EV1, ST2>, std::pair<EV2, STN>>;
|
||||
// };
|
||||
|
||||
|
||||
// fsm::MccFiniteStateMachine<ST1> fsm;
|
||||
|
||||
int main()
|
||||
{
|
||||
/*
|
||||
typedef fsm::unique_tuple_t<int, float, long, int, double, char, long> ut_t;
|
||||
|
||||
std::cout << "type index: " << fsm::unique_tuple_type_index_t<double, ut_t>::index << " (double)\n";
|
||||
@@ -100,6 +119,11 @@ int main()
|
||||
|
||||
aa = abi::__cxa_demangle(typeid(fsm::MccFiniteStateMachine<ST1>::states_t).name(), NULL, NULL, &status);
|
||||
std::cout << "states = " << aa << "\n";
|
||||
free(aa);
|
||||
|
||||
*/
|
||||
|
||||
fsm::MccFiniteStateMachine(ST1{});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user