| Kea 3.0.2-git

stdout_control_socket.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
9
10#ifndef STDOUT_CONTROL_SOCKET_H
11#define STDOUT_CONTROL_SOCKET_H
12
13#include <netconf/control_socket.h>
14
15#include <iostream>
16
17 namespace isc {
18 namespace netconf {
19
25 class StdoutControlSocket : public ControlSocketBase {
26 public:
32 StdoutControlSocket(CfgControlSocketPtr ctrl_sock);
33
35 virtual ~StdoutControlSocket() = default;
36
44 data::ConstElementPtr configGet(const std::string& service) override final;
45
53 data::ConstElementPtr configTest(data::ElementPtr config,
54 const std::string& service) override final;
55
63 data::ConstElementPtr configSet(data::ElementPtr config,
64 const std::string& service) override final;
65
66 protected:
71 StdoutControlSocket(CfgControlSocketPtr ctrl_sock, std::ostream& output);
72
74 std::ostream& output_;
75}; // StdoutControlSocket
76
78 using StdoutControlSocketPtr = std::shared_ptr<StdoutControlSocket>;
79
84 template <> ControlSocketBasePtr
85 createControlSocket<CfgControlSocket::Type::STDOUT>(CfgControlSocketPtr ctrl_sock);
86
87} // namespace netconf
88} // namespace isc
89
90#endif // STDOUT_CONTROL_SOCKET_H
isc::netconf::ControlSocketBase::ControlSocketBase
ControlSocketBase(CfgControlSocketPtr ctrl_sock)
Constructor.
Definition control_socket.h:39
isc::netconf::StdoutControlSocket::configGet
data::ConstElementPtr configGet(const std::string &service) override final
Get configuration.
Definition stdout_control_socket.cc:39
isc::netconf::StdoutControlSocket::configSet
data::ConstElementPtr configSet(data::ElementPtr config, const std::string &service) override final
Set configuration.
Definition stdout_control_socket.cc:50
isc::netconf::StdoutControlSocket::StdoutControlSocket
StdoutControlSocket(CfgControlSocketPtr ctrl_sock)
Constructor.
Definition stdout_control_socket.cc:29
isc::netconf::StdoutControlSocket::~StdoutControlSocket
virtual ~StdoutControlSocket()=default
Destructor (does nothing).
isc::netconf::StdoutControlSocket::configTest
data::ConstElementPtr configTest(data::ElementPtr config, const std::string &service) override final
Test configuration.
Definition stdout_control_socket.cc:44
isc::netconf::StdoutControlSocket::output_
std::ostream & output_
The output stream (std::cout outside tests).
Definition stdout_control_socket.h:74
control_socket.h
Contains declarations for control socket communication.
isc::config
Definition command_interpreter.cc:23
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::netconf
Definition control_socket.cc:20
isc::netconf::ControlSocketBasePtr
std::shared_ptr< ControlSocketBase > ControlSocketBasePtr
Type definition for the pointer to the ControlSocketBase.
Definition control_socket.h:106
isc::netconf::createControlSocket< CfgControlSocket::Type::STDOUT >
ControlSocketBasePtr createControlSocket< CfgControlSocket::Type::STDOUT >(CfgControlSocketPtr ctrl_sock)
Factory template specialization for stdout control sockets.
Definition stdout_control_socket.cc:25
isc::netconf::CfgControlSocketPtr
std::shared_ptr< CfgControlSocket > CfgControlSocketPtr
Defines a pointer for CfgControlSocket instances.
Definition netconf_config.h:143
isc::netconf::StdoutControlSocketPtr
std::shared_ptr< StdoutControlSocket > StdoutControlSocketPtr
Type definition for the pointer to the StdoutControlSocket.
Definition stdout_control_socket.h:78
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148