Skip to content
Snippets Groups Projects
Commit 26ddd753 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add (OStream << Socket) binary operator

It writes "hostname:port_number" to the output stream
parent d2b158f8
No related branches found
No related tags found
1 merge request!126Begin socket handling: core functionalities are available
#include <language/modules/SocketModule.hpp> #include <language/modules/SocketModule.hpp>
#include <language/utils/BinaryOperatorProcessorBuilder.hpp>
#include <language/utils/BuiltinFunctionEmbedder.hpp> #include <language/utils/BuiltinFunctionEmbedder.hpp>
#include <language/utils/OStream.hpp>
#include <language/utils/OperatorRepository.hpp>
#include <utils/Socket.hpp> #include <utils/Socket.hpp>
SocketModule::SocketModule() SocketModule::SocketModule()
...@@ -279,4 +282,10 @@ SocketModule::SocketModule() ...@@ -279,4 +282,10 @@ SocketModule::SocketModule()
void void
SocketModule::registerOperators() const SocketModule::registerOperators() const
{} {
OperatorRepository& repository = OperatorRepository::instance();
repository.addBinaryOperator<language::shift_left_op>(
std::make_shared<BinaryOperatorProcessorBuilder<language::shift_left_op, std::shared_ptr<const OStream>,
std::shared_ptr<const OStream>, std::shared_ptr<const Socket>>>());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment