mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-02-04 06:13:00 +08:00
83 lines
2.2 KiB
C++
83 lines
2.2 KiB
C++
//****************************************************************************
|
|
// Model: dpp_qmsm.qm
|
|
// File: ./dpp.h
|
|
//
|
|
// This code has been generated by QM tool (see state-machine.com/qm).
|
|
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
|
//
|
|
// This code is covered by the following commercial QP license:
|
|
// License # : QPCPP-EVAL-170201
|
|
// Issued to : Company/individual evaluating the QP/C++ framework
|
|
// Framework(s): qpcpp
|
|
// Support ends: 2017-02-28
|
|
// Product(s) :
|
|
// This license is available only for evaluation purposes and
|
|
// the generated code is still licensed under the terms of GPL.
|
|
// Please submit request for extension of the evaluaion period at:
|
|
// https://state-machine.com/licensing/index.html#RequestForm
|
|
//****************************************************************************
|
|
//${.::dpp.h} ................................................................
|
|
#ifndef dpp_h
|
|
#define dpp_h
|
|
|
|
namespace DPP {
|
|
|
|
enum DPPSignals {
|
|
EAT_SIG = QP::Q_USER_SIG, // published by Table to let a philosopher eat
|
|
DONE_SIG, // published by Philosopher when done eating
|
|
PAUSE_SIG, // published by BSP to pause the application
|
|
SERVE_SIG, // published by BSP to serve re-start serving forks
|
|
TEST_SIG, // published by BSP to test the application
|
|
MAX_PUB_SIG, // the last published signal
|
|
|
|
HUNGRY_SIG, // posted direclty to Table from hungry Philo
|
|
MAX_SIG // the last signal
|
|
};
|
|
|
|
} // namespace DPP
|
|
|
|
namespace DPP {
|
|
|
|
|
|
#if ((QP_VERSION < 580) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8)))
|
|
#error qpcpp version 5.8.0 or higher required
|
|
#endif
|
|
|
|
//${Events::TableEvt} ........................................................
|
|
class TableEvt : public QP::QEvt {
|
|
public:
|
|
uint8_t philoNum;
|
|
};
|
|
|
|
} // namespace DPP
|
|
|
|
// number of philosophers
|
|
#define N_PHILO ((uint8_t)5)
|
|
|
|
namespace DPP {
|
|
|
|
extern QP::QActive * const AO_Philo[N_PHILO];
|
|
|
|
} // namespace DPP
|
|
|
|
namespace DPP {
|
|
|
|
extern QP::QActive * const AO_Table;
|
|
|
|
} // namespace DPP
|
|
|
|
#ifdef qxk_h
|
|
namespace DPP {
|
|
|
|
extern QP::QXThread * const XT_Test1;
|
|
|
|
} // namespace DPP
|
|
namespace DPP {
|
|
|
|
extern QP::QXThread * const XT_Test2;
|
|
|
|
} // namespace DPP
|
|
#endif // qxk_h
|
|
|
|
#endif // dpp_h
|