diff options
Diffstat (limited to 'src/socket')
-rw-r--r-- | src/socket/SocketListener.cpp | 4 | ||||
-rw-r--r-- | src/socket/SocketReader.cpp (renamed from src/socket/SocketInterface.cpp) | 42 | ||||
-rw-r--r-- | src/socket/SocketReader.hpp (renamed from src/socket/SocketInterface.hpp) | 29 | ||||
-rw-r--r-- | src/socket/wscript | 2 |
4 files changed, 42 insertions, 35 deletions
diff --git a/src/socket/SocketListener.cpp b/src/socket/SocketListener.cpp index aeb50c5f..79ad11c4 100644 --- a/src/socket/SocketListener.cpp +++ b/src/socket/SocketListener.cpp @@ -27,7 +27,7 @@ #include "../server/Engine.hpp" #include "../server/EventWriter.hpp" #include "SocketListener.hpp" -#include "SocketInterface.hpp" +#include "SocketReader.hpp" #define LOG(s) s << "[SocketListener] " @@ -94,7 +94,7 @@ SocketListener::_run() // Make an new interface/thread to handle the connection Server::Engine* engine = (Server::Engine*)_world.local_engine().get(); - new SocketInterface(_world, *engine->interface(), conn); + new SocketReader(_world, *engine->interface(), conn); } } diff --git a/src/socket/SocketInterface.cpp b/src/socket/SocketReader.cpp index 8b9aab66..8b3ed7a1 100644 --- a/src/socket/SocketInterface.cpp +++ b/src/socket/SocketReader.cpp @@ -22,27 +22,27 @@ #include "ingen/shared/AtomReader.hpp" #include "sord/sordmm.hpp" #include "sratom/sratom.h" -#include "SocketInterface.hpp" +#include "SocketReader.hpp" -#define LOG(s) s << "[SocketInterface] " +#define LOG(s) s << "[SocketReader] " namespace Ingen { namespace Socket { -SocketInterface::SocketInterface(Ingen::Shared::World& world, - Interface& iface, - int conn) +SocketReader::SocketReader(Ingen::Shared::World& world, + Interface& iface, + int conn) : _world(world) , _iface(iface) , _inserter(NULL) , _msg_node(NULL) , _conn(conn) { - set_name("SocketInterface"); + set_name("SocketReader"); start(); } -SocketInterface::~SocketInterface() +SocketReader::~SocketReader() { stop(); join(); @@ -50,29 +50,29 @@ SocketInterface::~SocketInterface() } SerdStatus -SocketInterface::set_base_uri(SocketInterface* iface, - const SerdNode* uri_node) +SocketReader::set_base_uri(SocketReader* iface, + const SerdNode* uri_node) { return sord_inserter_set_base_uri(iface->_inserter, uri_node); } SerdStatus -SocketInterface::set_prefix(SocketInterface* iface, - const SerdNode* name, - const SerdNode* uri_node) +SocketReader::set_prefix(SocketReader* iface, + const SerdNode* name, + const SerdNode* uri_node) { return sord_inserter_set_prefix(iface->_inserter, name, uri_node); } SerdStatus -SocketInterface::write_statement(SocketInterface* iface, - SerdStatementFlags flags, - const SerdNode* graph, - const SerdNode* subject, - const SerdNode* predicate, - const SerdNode* object, - const SerdNode* object_datatype, - const SerdNode* object_lang) +SocketReader::write_statement(SocketReader* iface, + SerdStatementFlags flags, + const SerdNode* graph, + const SerdNode* subject, + const SerdNode* predicate, + const SerdNode* object, + const SerdNode* object_datatype, + const SerdNode* object_lang) { if (!iface->_msg_node) { iface->_msg_node = sord_node_from_serd_node( @@ -86,7 +86,7 @@ SocketInterface::write_statement(SocketInterface* iface, } void -SocketInterface::_run() +SocketReader::_run() { Sord::World* world = _world.rdf_world(); LV2_URID_Map* map = &_world.lv2_uri_map()->urid_map_feature()->urid_map; diff --git a/src/socket/SocketInterface.hpp b/src/socket/SocketReader.hpp index e084d964..141e6216 100644 --- a/src/socket/SocketInterface.hpp +++ b/src/socket/SocketReader.hpp @@ -14,33 +14,38 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/Interface.hpp" +#ifndef INGEN_SOCKET_SOCKET_READER_HPP +#define INGEN_SOCKET_SOCKET_READER_HPP + #include "raul/Thread.hpp" #include "sord/sord.h" namespace Ingen { -namespace Shared { class World; } +namespace Shared { +class World; +class Interface; +} namespace Socket { -class SocketInterface : public Raul::Thread +class SocketReader : public Raul::Thread { public: - SocketInterface(Shared::World& world, Interface& iface, int conn); - ~SocketInterface(); + SocketReader(Shared::World& world, Interface& iface, int conn); + ~SocketReader(); private: virtual void _run(); - static SerdStatus set_base_uri(SocketInterface* iface, - const SerdNode* uri_node); + static SerdStatus set_base_uri(SocketReader* iface, + const SerdNode* uri_node); - static SerdStatus set_prefix(SocketInterface* iface, - const SerdNode* name, - const SerdNode* uri_node); + static SerdStatus set_prefix(SocketReader* iface, + const SerdNode* name, + const SerdNode* uri_node); - static SerdStatus write_statement(SocketInterface* iface, + static SerdStatus write_statement(SocketReader* iface, SerdStatementFlags flags, const SerdNode* graph, const SerdNode* subject, @@ -59,3 +64,5 @@ private: } // namespace Ingen } // namespace Socket + +#endif // INGEN_SOCKET_SOCKET_READER_HPP diff --git a/src/socket/wscript b/src/socket/wscript index 6985f377..e351e0e4 100644 --- a/src/socket/wscript +++ b/src/socket/wscript @@ -4,7 +4,7 @@ from waflib.extras import autowaf as autowaf def build(bld): if bld.is_defined('HAVE_SOCKET'): obj = bld(features = 'cxx cxxshlib', - source = ['SocketInterface.cpp', + source = ['SocketReader.cpp', 'SocketListener.cpp', 'ingen_socket_server.cpp'], includes = ['.', '../..'], |