diff options
author | David Robillard <d@drobilla.net> | 2016-09-18 01:51:47 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-09-18 01:51:47 -0400 |
commit | 758543f6dbb56755d3239c0ed68f1083384f0e96 (patch) | |
tree | 082133b95e44d32a84427d028aeca6498b79348d /ingen/SocketWriter.hpp | |
parent | 5fdc95a70e03e41777f4a023f222f537110a70b1 (diff) | |
download | ingen-758543f6dbb56755d3239c0ed68f1083384f0e96.tar.gz ingen-758543f6dbb56755d3239c0ed68f1083384f0e96.tar.bz2 ingen-758543f6dbb56755d3239c0ed68f1083384f0e96.zip |
Factor out text writing from socket writing
Diffstat (limited to 'ingen/SocketWriter.hpp')
-rw-r--r-- | ingen/SocketWriter.hpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/ingen/SocketWriter.hpp b/ingen/SocketWriter.hpp index bb5c332b..871a63f5 100644 --- a/ingen/SocketWriter.hpp +++ b/ingen/SocketWriter.hpp @@ -19,20 +19,14 @@ #include <stdint.h> -#include "ingen/AtomSink.hpp" -#include "ingen/AtomWriter.hpp" -#include "ingen/Interface.hpp" -#include "ingen/types.hpp" -#include "ingen/ingen.h" +#include "ingen/TurtleWriter.hpp" #include "raul/Socket.hpp" -#include "raul/URI.hpp" -#include "sratom/sratom.h" namespace Ingen { /** An Interface that writes Turtle messages to a socket. */ -class INGEN_API SocketWriter : public AtomWriter, public AtomSink +class INGEN_API SocketWriter : public TurtleWriter { public: SocketWriter(URIMap& map, @@ -40,24 +34,12 @@ public: const Raul::URI& uri, SPtr<Raul::Socket> sock); - ~SocketWriter(); - - bool write(const LV2_Atom* msg); + size_t text_sink(const void* buf, size_t len) override; + /** Override of bundle_end to terminate bundles in the stream. */ void bundle_end(); - int fd() { return _socket->fd(); } - Raul::URI uri() const { return _uri; } - SerdWriter* writer() { return _writer; } - protected: - URIMap& _map; - Sratom* _sratom; - SerdNode _base; - SerdURI _base_uri; - SerdEnv* _env; - SerdWriter* _writer; - Raul::URI _uri; SPtr<Raul::Socket> _socket; }; |