From 04b619a15cd8dc7b26ccd85d78c94134828364ca Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 7 Sep 2022 17:58:49 +0200 Subject: [PATCH] update header as well --- .../ServiceInterfaceBuffer.cpp | 6 +- .../serviceinterface/ServiceInterfaceBuffer.h | 86 +------------------ 2 files changed, 5 insertions(+), 87 deletions(-) diff --git a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp index 076ab1d2..890912c2 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp +++ b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp @@ -1,4 +1,4 @@ -#include "fsfw/serviceinterface/ServiceInterfaceBuffer.h" +#include "ServiceInterfaceBuffer.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -72,8 +72,6 @@ void ServiceInterfaceBuffer::putChars(char const* begin, char const* end) { } } -#endif - int ServiceInterfaceBuffer::overflow(int c) { if (not buffered and this->isActive) { if (c != Traits::eof()) { @@ -166,3 +164,5 @@ void ServiceInterfaceBuffer::setAsciiColorPrefix(std::string colorPrefix) { this->colorPrefix = colorPrefix; } #endif + +#endif diff --git a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h index 2ecf88d8..682332c9 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h +++ b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.h @@ -1,9 +1,8 @@ #ifndef FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACEBUFFER_H_ #define FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACEBUFFER_H_ -#include - -#include "../returnvalues/returnvalue.h" +#include "fsfw/FSFW.h" +#include "fsfw/returnvalues/returnvalue.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -11,8 +10,6 @@ #include #include -#ifndef UT699 - /** * @brief This is the underlying stream buffer which implements the * streambuf class and overloads the overflow() and sync() methods @@ -77,85 +74,6 @@ class ServiceInterfaceBuffer : public std::streambuf { bool crAdditionEnabled() const; }; -#endif - -#ifdef UT699 -class ServiceInterfaceBuffer : public std::basic_streambuf > { - friend class ServiceInterfaceStream; - - public: - ServiceInterfaceBuffer(std::string set_message, uint16_t port); - - protected: - bool isActive; - // This is called when buffer becomes full. If - // buffer is not used, then this is called every - // time when characters are put to stream. - virtual int overflow(int c = Traits::eof()); - - // This function is called when stream is flushed, - // for example when std::endl is put to stream. - virtual int sync(void); - - private: - // For additional message information - std::string log_message; - // For EOF detection - typedef std::char_traits Traits; - - // Work in buffer mode. It is also possible to work without buffer. - static size_t const BUF_SIZE = 128; - char buf[BUF_SIZE]; - - // In this function, the characters are parsed. - void putChars(char const* begin, char const* end); -}; -#endif // UT699 - -#ifdef ML505 -#include -#include -#include -#include -#include - -class ServiceInterfaceBuffer : public std::basic_streambuf > { - friend class ServiceInterfaceStream; - - public: - ServiceInterfaceBuffer(std::string set_message, uint16_t port); - - protected: - bool isActive; - // This is called when buffer becomes full. If - // buffer is not used, then this is called every - // time when characters are put to stream. - virtual int overflow(int c = Traits::eof()); - - // This function is called when stream is flushed, - // for example when std::endl is put to stream. - virtual int sync(void); - - private: - // For additional message information - std::string log_message; - // For EOF detection - typedef std::char_traits Traits; - - // Work in buffer mode. It is also possible to work without buffer. - static size_t const BUF_SIZE = 128; - char buf[BUF_SIZE]; - - // In this function, the characters are parsed. - void putChars(char const* begin, char const* end); - - int udpSocket; - sockaddr_in remoteAddress; - socklen_t remoteAddressLength; - void initSocket(); -}; -#endif // ML505 - #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FRAMEWORK_SERVICEINTERFACE_SERVICEINTERFACEBUFFER_H_ */