plptools
Loading...
Searching...
No Matches
rpcsfactory.cc
Go to the documentation of this file.
1
/*
2
* This file is part of plptools.
3
*
4
* Copyright (C) 2000-2001 Fritz Elfert <felfert@to.com>
5
* Copyright (C) 2026 Jason Morley <hello@jbmorley.co.uk>
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License along
18
* along with this program; if not, see <https://www.gnu.org/licenses/>.
19
*
20
*/
21
#include "config.h"
22
23
#include "
ncpclient.h
"
24
#include "
rpcs.h
"
25
#include "
rpcs16.h
"
26
#include "
rpcs32.h
"
27
#include "
rpcsfactory.h
"
28
#include "
Enum.h
"
29
30
#include <stdlib.h>
31
#include <time.h>
32
33
RPCSFactory::RPCSFactory
(
const
std::string &host,
int
port)
34
: host_(host)
35
, port_(port) {}
36
37
RPCSFactory::~RPCSFactory
() {}
38
39
RPCS
*
RPCSFactory::create
(
bool
reconnect,
Enum<ConnectionError>
*
error
) {
40
return
ncp_client::connect<RPCS, RPCS16, RPCS32>(
host_
,
port_
, reconnect,
error
);
41
}
Enum.h
Enum
Wrapper class featuring range-checking and string representation of enumerated values.
Definition:
Enum.h:135
RPCSFactory::host_
std::string host_
Definition:
rpcsfactory.h:60
RPCSFactory::RPCSFactory
RPCSFactory(const std::string &host, int port)
Constructs a RPCSFactory.
Definition:
rpcsfactory.cc:33
RPCSFactory::port_
int port_
Definition:
rpcsfactory.h:61
RPCSFactory::create
RPCS * create(bool, Enum< ConnectionError > *error=nullptr)
Creates a new RPCS instance.
Definition:
rpcsfactory.cc:39
RPCSFactory::~RPCSFactory
~RPCSFactory()
Delete the RPCSFactory, cleaning up any resources.
Definition:
rpcsfactory.cc:37
RPCS
Remote procedure call services via PLP.
Definition:
rpcs.h:52
ncpclient.h
rpcs16.h
rpcs32.h
rpcs.h
rpcsfactory.h
error
static void error(int line)
Definition:
sismain.cpp:44
lib
rpcsfactory.cc
Generated by
1.9.5