mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-14 05:42:57 +08:00
87 lines
2.7 KiB
C++
87 lines
2.7 KiB
C++
//.$file${.::dpp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
//
|
|
// Model: dpp.qm
|
|
// File: ${.::dpp.hpp}
|
|
//
|
|
// This code has been generated by QM 4.6.0 <www.state-machine.com/qm/>.
|
|
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
|
//
|
|
// This program is open source software: you can redistribute it and/or
|
|
// modify it under the terms of the GNU General Public License as published
|
|
// by the Free Software Foundation.
|
|
//
|
|
// This program 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.
|
|
//
|
|
//.$endhead${.::dpp.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
#ifndef DPP_HPP
|
|
#define DPP_HPP
|
|
|
|
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
|
|
|
|
//.$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
//.${Events::TableEvt} .......................................................
|
|
class TableEvt : public QP::QEvt {
|
|
public:
|
|
uint8_t philoNum;
|
|
};
|
|
|
|
} // namespace DPP
|
|
//.$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
// number of philosophers
|
|
#define N_PHILO 5U
|
|
|
|
//.$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
extern QP::QActive * const AO_Philo[N_PHILO];
|
|
|
|
} // namespace DPP
|
|
//.$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
//.$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
extern QP::QActive * const AO_Table;
|
|
|
|
} // namespace DPP
|
|
//.$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
#ifdef QXK_HPP
|
|
//.$declare${AOs::XT_Test1} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
extern QP::QXThread * const XT_Test1;
|
|
|
|
} // namespace DPP
|
|
//.$enddecl${AOs::XT_Test1} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
//.$declare${AOs::XT_Test2} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
namespace DPP {
|
|
|
|
extern QP::QXThread * const XT_Test2;
|
|
|
|
} // namespace DPP
|
|
//.$enddecl${AOs::XT_Test2} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
#endif // QXK_HPP
|
|
|
|
#endif // DPP_HPP
|