1
0
Fork 0

implements reinit of IO channels

This commit is contained in:
Hans Kunkell 2020-07-25 23:19:07 +09:00 committed by James Turner
parent 04a5c37a55
commit 2992e1b100
3 changed files with 12 additions and 0 deletions

View file

@ -383,6 +383,12 @@ FGProtocol* FGIO::add_channel(const string& config)
void
FGIO::reinit()
{
SG_LOG(SG_IO, SG_INFO, "FGIO::reinit()");
std::for_each(io_channels.begin(), io_channels.end(), [](FGProtocol* p) {
SG_LOG(SG_IO, SG_INFO, "Restarting channel \"" << p->get_name() << "\"");
p->reinit();
});
}
// process any IO channel work

View file

@ -81,6 +81,11 @@ bool FGProtocol::close() {
return false;
}
// dummy reinit routine
void FGProtocol::reinit()
{
SG_LOG(SG_IO, SG_INFO, "dummy FGProtocol::reinit()");
}
// standard I/O channel close routine
bool FGProtocol::gen_message() {

View file

@ -65,6 +65,7 @@ public:
virtual bool open();
virtual bool process();
virtual bool close();
virtual void reinit();
inline SGProtocolDir get_direction() const { return dir; }
void set_direction( const string& d );