• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

traintastic / traintastic / 22554474183

01 Mar 2026 09:47PM UTC coverage: 27.1%. First build
22554474183

push

github

reinder
[cbus] added simulator basics

0 of 56 new or added lines in 8 files covered. (0.0%)

8182 of 30192 relevant lines covered (27.1%)

189.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/server/src/hardware/protocol/cbus/iohandler/cbussimulationiohandler.cpp
1
/**
2
 * This file is part of Traintastic,
3
 * see <https://github.com/traintastic/traintastic>.
4
 *
5
 * Copyright (C) 2026 Reinder Feenstra
6
 *
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 */
21

22
#include "cbussimulationiohandler.hpp"
23
#include "../cbuskernel.hpp"
24
#include "../simulator/cbussimulator.hpp"
25

26
namespace CBUS {
27

NEW
28
SimulationIOHandler::SimulationIOHandler(Kernel& kernel, Simulator& simulator)
×
29
  : IOHandler(kernel)
NEW
30
  , m_simulator{simulator}
×
31
{
NEW
32
  m_simulator.onSend = std::bind_front(&Kernel::receive, &kernel);
×
NEW
33
}
×
34

NEW
35
SimulationIOHandler::~SimulationIOHandler() = default;
×
36

NEW
37
void SimulationIOHandler::start()
×
38
{
NEW
39
  m_kernel.started();
×
NEW
40
}
×
41

NEW
42
void SimulationIOHandler::stop()
×
43
{
NEW
44
}
×
45

NEW
46
std::error_code SimulationIOHandler::send(const Message& message)
×
47
{
NEW
48
  m_simulator.receive(message);
×
NEW
49
  return {};
×
50
}
51

52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc