w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkPortFactory.cpp
Go to the documentation of this file.
1// $Id: RlinkPortFactory.cpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-01 1076 2.0 use unique_ptr
8// 2013-02-23 492 1.2 use RparseUrl
9// 2012-12-26 465 1.1 add cuff: support
10// 2011-03-27 374 1.0 Initial version
11// 2011-01-15 356 0.1 First draft
12// ---------------------------------------------------------------------------
13
19
20#include "RlinkPortFifo.hpp"
21#include "RlinkPortTerm.hpp"
22#include "RlinkPortCuff.hpp"
23
24#include "RlinkPortFactory.hpp"
25
26using namespace std;
27
33// all method definitions in namespace Retro
34namespace Retro {
35
36//------------------------------------------+-----------------------------------
38
40 const std::string& url, RerrMsg& emsg)
41{
42 string scheme = RparseUrl::FindScheme(url);
43
44 if (scheme.length() == 0) {
45 emsg.Init("RlinkPortFactory::New()",
46 string("no scheme specified in url '" + url + "'"));
48 }
49
50 if (scheme == "fifo") {
52 } else if (scheme == "term") {
54 } else if (scheme == "cuff") {
56 }
57
58 emsg.Init("RlinkPortFactory::New()", string("unknown scheme: ") + scheme);
60}
61
62//------------------------------------------+-----------------------------------
64
66 const std::string& url, RerrMsg& emsg)
67{
68 auto upport = New(url, emsg);
69 if (upport) { // New OK ?
70 if (!(upport->Open(url, emsg))) upport.reset(); // Open OK ?
71 }
72 return upport;
73}
74
75} // end namespace Retro
FIXME_docs.
Definition: RerrMsg.hpp:25
void Init(const std::string &meth, const std::string &text)
FIXME_docs.
Definition: RerrMsg.cpp:74
static RlinkPort::port_uptr_t Open(const std::string &url, RerrMsg &emsg)
FIXME_docs.
static RlinkPort::port_uptr_t New(const std::string &url, RerrMsg &emsg)
FIXME_docs.
std::unique_ptr< RlinkPort > port_uptr_t
Definition: RlinkPort.hpp:47
static std::string FindScheme(const std::string &url, const std::string &def="")
FIXME_docs.
Definition: RparseUrl.cpp:238
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47