mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-28 06:02:56 +08:00
102 lines
3.3 KiB
C++
102 lines
3.3 KiB
C++
//$file${.::dpp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
//
|
|
// Model: dpp-comp.qm
|
|
// File: ${.::dpp.hpp}
|
|
//
|
|
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
|
|
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
//
|
|
// 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.
|
|
//
|
|
// 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} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
#ifndef DPP_HPP
|
|
#define DPP_HPP
|
|
|
|
namespace DPP {
|
|
|
|
enum DPPSignals {
|
|
TIMEOUT_SIG = QP::Q_USER_SIG, // time event timeout
|
|
EAT_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
|
|
};
|
|
|
|
enum {
|
|
N_PHILO = 5 // number of Philos
|
|
};
|
|
|
|
} // namespace DPP
|
|
|
|
//$declare${Cont::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
//${Cont::TableEvt} ..........................................................
|
|
class TableEvt : public QP::QEvt {
|
|
public:
|
|
std::uint8_t philoNum;
|
|
}; // class TableEvt
|
|
|
|
} // namespace DPP
|
|
//$enddecl${Cont::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
//$declare${Cont::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
//${Cont::AO_Table} ..........................................................
|
|
extern QP::QActive * const AO_Table;
|
|
|
|
} // namespace DPP
|
|
//$enddecl${Cont::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
//$declare${Comp::CompTimeEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
//${Comp::CompTimeEvt} .......................................................
|
|
class CompTimeEvt : public QP::QTimeEvt {
|
|
public:
|
|
std::uint16_t compNum;
|
|
|
|
public:
|
|
CompTimeEvt(
|
|
QP::QActive * act,
|
|
std::uint16_t num,
|
|
enum_t const sig,
|
|
std::uint_fast8_t const tickRate);
|
|
}; // class CompTimeEvt
|
|
|
|
} // namespace DPP
|
|
//$enddecl${Comp::CompTimeEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
//$declare${Comp::SM_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
//${Comp::SM_Philo[N_PHILO]} .................................................
|
|
extern QP::QHsm * const SM_Philo[N_PHILO];
|
|
|
|
} // namespace DPP
|
|
//$enddecl${Comp::SM_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
#endif // DPP_HPP
|