-
Notifications
You must be signed in to change notification settings - Fork 8
/
CommunicationManager.hpp
34 lines (27 loc) · 825 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
31
32
33
34
#ifndef CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP
#define CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP
#include "SerialFormatter.hpp"
#include "SerialPortClient.hpp"
namespace before
{
struct CommunicationManager
{
CommunicationManager(SerialPortClient& serialPortClient);
void sendViaSerial(std::string message);
private:
SerialPortClient& mSerialPortClient;
};
} // namespace before
namespace after
{
struct CommunicationManager
{
CommunicationManager(SerialPortClient& serialPortClient,
SerialFormatter& serialFormatter);
void sendViaSerial(std::string message);
private:
SerialPortClient& mSerialPortClient;
SerialFormatter& mSerialFormatter;
};
} // namespace after
#endif // CPP_REFACTORING_FOR_TESTABILITY_COMMUNICATIONMANAGER_HPP