2022-08-11 15:36:19 -04:00
|
|
|
//$file${.::dpp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
//
|
|
|
|
// Model: dpp.qm
|
2019-10-27 12:26:31 -04:00
|
|
|
// File: ${.::dpp.hpp}
|
2019-06-18 16:56:56 -04:00
|
|
|
//
|
2022-09-22 11:13:20 -04:00
|
|
|
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
|
2019-06-18 16:56:56 -04:00
|
|
|
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
|
|
|
//
|
2022-08-11 15:36:19 -04:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2019-06-18 16:56:56 -04:00
|
|
|
//
|
2022-08-11 15:36:19 -04:00
|
|
|
// This generated code is open source software: you can redistribute it under
|
|
|
|
// the terms of the GNU General Public License as published by the Free
|
|
|
|
// Software Foundation.
|
2019-06-18 16:56:56 -04:00
|
|
|
//
|
2022-08-11 15:36:19 -04:00
|
|
|
// This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
// more details.
|
|
|
|
//
|
|
|
|
// NOTE:
|
|
|
|
// Alternatively, this generated code may be distributed under the terms
|
|
|
|
// of Quantum Leaps commercial licenses, which expressly supersede the GNU
|
|
|
|
// General Public License and are specifically designed for licensees
|
|
|
|
// interested in retaining the proprietary status of their code.
|
|
|
|
//
|
|
|
|
// Contact information:
|
|
|
|
// <www.state-machine.com/licensing>
|
|
|
|
// <info@state-machine.com>
|
|
|
|
//
|
|
|
|
//$endhead${.::dpp.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-10-27 12:26:31 -04:00
|
|
|
#ifndef DPP_HPP
|
|
|
|
#define DPP_HPP
|
2019-06-18 16:56:56 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
namespace DPP {
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${Events::TableEvt} ........................................................
|
2019-06-18 16:56:56 -04:00
|
|
|
class TableEvt : public QP::QEvt {
|
|
|
|
public:
|
|
|
|
uint8_t philoNum;
|
2022-08-11 15:36:19 -04:00
|
|
|
}; // class TableEvt
|
2019-06-18 16:56:56 -04:00
|
|
|
|
|
|
|
} // namespace DPP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-06-18 16:56:56 -04:00
|
|
|
|
|
|
|
// number of philosophers
|
|
|
|
#define N_PHILO ((uint8_t)5)
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
namespace DPP {
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${AOs::AO_Philo[N_PHILO]} ..................................................
|
2019-06-18 16:56:56 -04:00
|
|
|
extern QP::QActive * const AO_Philo[N_PHILO];
|
|
|
|
|
|
|
|
} // namespace DPP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-06-18 16:56:56 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
namespace DPP {
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${AOs::AO_Table} ...........................................................
|
2019-06-18 16:56:56 -04:00
|
|
|
extern QP::QActive * const AO_Table;
|
|
|
|
|
|
|
|
} // namespace DPP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-06-18 16:56:56 -04:00
|
|
|
|
2022-09-22 11:13:20 -04:00
|
|
|
#ifdef QP_INC_QXK_HPP_
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${AOs::XT_Test1} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
namespace DPP {
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${AOs::XT_Test1} ...........................................................
|
2019-06-18 16:56:56 -04:00
|
|
|
extern QP::QXThread * const XT_Test1;
|
|
|
|
|
|
|
|
} // namespace DPP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${AOs::XT_Test1} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
//$declare${AOs::XT_Test2} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2019-06-18 16:56:56 -04:00
|
|
|
namespace DPP {
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${AOs::XT_Test2} ...........................................................
|
2019-06-18 16:56:56 -04:00
|
|
|
extern QP::QXThread * const XT_Test2;
|
|
|
|
|
|
|
|
} // namespace DPP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${AOs::XT_Test2} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-09-22 11:13:20 -04:00
|
|
|
#endif // QP_INC_QXK_HPP_
|
2019-06-18 16:56:56 -04:00
|
|
|
|
2019-10-27 12:26:31 -04:00
|
|
|
#endif // DPP_HPP
|
2022-09-22 11:13:20 -04:00
|
|
|
|