plptools
Loading...
Searching...
No Matches
rpcsfactory.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (C) 1999 Philip Proudman <philip.proudman@btinternet.com>
5 * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.com>
6 * Copyright (C) 2026 Jason Morley <hello@jbmorley.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22#pragma once
23
24#include "connectionerror.h"
25#include "rpcs.h"
26
27class TCPSocket;
28
33class RPCSFactory final {
34 public:
35
42 RPCSFactory(const std::string &host, int port);
43
48
57 RPCS* create(bool, Enum<ConnectionError> *error = nullptr);
58
59 private:
60 std::string host_;
61 int port_;
62};
Wrapper class featuring range-checking and string representation of enumerated values.
Definition: Enum.h:135
A factory for automatically instantiating the correct protocol variant depending on the connected Psi...
Definition: rpcsfactory.h:33
std::string host_
Definition: rpcsfactory.h:60
RPCS * create(bool, Enum< ConnectionError > *error=nullptr)
Creates a new RPCS instance.
Definition: rpcsfactory.cc:39
~RPCSFactory()
Delete the RPCSFactory, cleaning up any resources.
Definition: rpcsfactory.cc:37
Remote procedure call services via PLP.
Definition: rpcs.h:52
A class for dealing with sockets.
Definition: tcpsocket.h:37
static void error(int line)
Definition: sismain.cpp:44