-
Notifications
You must be signed in to change notification settings - Fork 8
/
CommunicationManager.hpp
30 lines (24 loc) · 857 Bytes
/
CommunicationManager.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP
#define CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP
#include "SerialPortClient.hpp" // Remove after refactoring
#include <string>
namespace before
{
struct CommunicationManager
{
virtual ~CommunicationManager() = default;
virtual void sendViaSerial(std::string message) = 0;
virtual SerialPortClient& getSerialPortClient() const = 0;
};
} // namespace before
namespace after
{
struct CommunicationManager
{
virtual ~CommunicationManager() = default;
virtual void sendViaSerial(std::string message) = 0;
virtual void sendViaRawSerial(std::string message) const = 0;
// or let whoever wants to use the "raw" serial port inject it themselves
};
} // namespace after
#endif // CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP