2016-06-15 23:48:41 +02:00
|
|
|
#ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
|
|
|
#define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_
|
|
|
|
|
|
|
|
#include <framework/serviceinterface/ServiceInterfaceBuffer.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <sstream>
|
|
|
|
#include <cstdio>
|
|
|
|
|
2020-04-12 23:06:57 +02:00
|
|
|
// Unfortunately, there must be a forward declaration of log_fe
|
2020-04-08 18:08:14 +02:00
|
|
|
// (MUST be defined in main), to let the system know where to write to.
|
2020-04-23 19:13:18 +02:00
|
|
|
namespace sif {
|
2016-06-15 23:48:41 +02:00
|
|
|
extern std::ostream debug;
|
|
|
|
extern std::ostream info;
|
|
|
|
extern std::ostream warning;
|
|
|
|
extern std::ostream error;
|
2020-04-23 19:13:18 +02:00
|
|
|
}
|
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2020-04-10 17:06:06 +02:00
|
|
|
class ServiceInterfaceStream :
|
|
|
|
public std::basic_ostream<char, std::char_traits<char>> {
|
2016-06-15 23:48:41 +02:00
|
|
|
protected:
|
|
|
|
ServiceInterfaceBuffer buf;
|
|
|
|
public:
|
2020-04-12 23:06:57 +02:00
|
|
|
ServiceInterfaceStream( std::string set_message,
|
|
|
|
bool addCrToPreamble = false, uint16_t port = 1234);
|
2016-06-15 23:48:41 +02:00
|
|
|
void setActive( bool );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACESTREAM_H_ */
|