plptools
Loading...
Searching...
No Matches
deviceendpoint.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (c) 2026 Jason Morley <hello@jbmorley.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
18 *
19 */
20#pragma once
21
22#include "config.h"
23
24#include <memory>
25#include <string>
26
27#include "connectionerror.h"
28#include "Enum.h"
29#include "device.h"
30
31class rclip;
32class RFSV;
33class RPCS;
34
36public:
37
38 static std::unique_ptr<DeviceEndpoint> connect(const std::string host, int port, Enum<ConnectionError> *error);
39
49 std::string id() const;
50
51 bool hasPersistentId() const;
52
62 Enum<RFSV::errs> getName(std::string &name) const;
63
71 Enum<RFSV::errs> setName(const std::string &name);
72
73 const std::unique_ptr<RFSV> rfsv_;
74 const std::unique_ptr<RPCS> rpcs_;
75 const std::unique_ptr<rclip> clip_;
76
77private:
78
79 DeviceEndpoint(const std::string &id,
80 bool hasPersistentConfiguration,
81 std::unique_ptr<RFSV> rfsv,
82 std::unique_ptr<RPCS> rpcs,
83 std::unique_ptr<rclip> clip);
84
85 const std::string id_;
87};
const std::unique_ptr< RFSV > rfsv_
const std::unique_ptr< RPCS > rpcs_
bool hasPersistentConfiguration_
std::string id() const
Device identifier.
const std::string id_
bool hasPersistentId() const
Enum< RFSV::errs > setName(const std::string &name)
Set the device name.
static std::unique_ptr< DeviceEndpoint > connect(const std::string host, int port, Enum< ConnectionError > *error)
const std::unique_ptr< rclip > clip_
Enum< RFSV::errs > getName(std::string &name) const
Get the device name.
Wrapper class featuring range-checking and string representation of enumerated values.
Definition: Enum.h:135
Access remote file services of a Psion.
Definition: rfsv.h:79
Remote procedure call services via PLP.
Definition: rpcs.h:52
Remote ClipBoard services via PLP.
Definition: rclip.h:44
static void error(int line)
Definition: sismain.cpp:44