YARP
Yet Another Robot Platform
SubscriberOnSql.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_SERVERSQL_IMPL_SUBSCRIBERONSQL_H
8#define YARP_SERVERSQL_IMPL_SUBSCRIBERONSQL_H
9
11
12#include <mutex>
13
14
15namespace yarp::serversql::impl {
16
21{
22public:
24 {
25 implementation = nullptr;
26 }
27
29 {
30 if (implementation != nullptr) {
31 close();
32 }
33 }
34
35 bool open(const std::string& filename, bool fresh = false);
36
37 bool close();
38
39 bool addSubscription(const std::string& src,
40 const std::string& dest,
41 const std::string& mode) override;
42
43 bool removeSubscription(const std::string& src,
44 const std::string& dest) override;
45
46 bool listSubscriptions(const std::string& port,
47 yarp::os::Bottle& reply) override;
48
49 bool welcome(const std::string& port, int activity) override;
50
51 bool hookup(const std::string& port);
52
53 bool breakdown(const std::string& port);
54
55 bool setTopic(const std::string& port,
56 const std::string& structure, bool active) override;
57
58 bool listTopics(yarp::os::Bottle& topics) override;
59
60 bool transitiveWelcome(const std::string& topic,
61 const std::string& src,
62 const std::string& dest,
63 const std::string& srcFull,
64 const std::string& destFull);
65
66 bool checkSubscription(const std::string& src,
67 const std::string& dest,
68 const std::string& srcFull,
69 const std::string& destFull,
70 const std::string& mode);
71
72 bool breakSubscription(const std::string& dropper,
73 const std::string& src,
74 const std::string& dest,
75 const std::string& srcFull,
76 const std::string& destFull,
77 const std::string& mode);
78
79 bool setType(const std::string& family,
80 const std::string& structure,
81 const std::string& value) override;
82
83 std::string getType(const std::string& family,
84 const std::string& structure) override;
85
86private:
87 void *implementation {nullptr};
88 std::mutex mutex;
89};
90
91} // namespace yarp::serversql::impl
92
93
94#endif // YARP_SERVERSQL_IMPL_SUBSCRIBERONSQL_H
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:64
Interface for maintaining persistent connections using SQL.
bool checkSubscription(const std::string &src, const std::string &dest, const std::string &srcFull, const std::string &destFull, const std::string &mode)
bool removeSubscription(const std::string &src, const std::string &dest) override
bool open(const std::string &filename, bool fresh=false)
bool transitiveWelcome(const std::string &topic, const std::string &src, const std::string &dest, const std::string &srcFull, const std::string &destFull)
bool hookup(const std::string &port)
bool welcome(const std::string &port, int activity) override
bool breakSubscription(const std::string &dropper, const std::string &src, const std::string &dest, const std::string &srcFull, const std::string &destFull, const std::string &mode)
bool addSubscription(const std::string &src, const std::string &dest, const std::string &mode) override
bool listSubscriptions(const std::string &port, yarp::os::Bottle &reply) override
std::string getType(const std::string &family, const std::string &structure) override
bool breakdown(const std::string &port)
bool setTopic(const std::string &port, const std::string &structure, bool active) override
bool listTopics(yarp::os::Bottle &topics) override
bool setType(const std::string &family, const std::string &structure, const std::string &value) override
Abstract interface for maintaining persistent connections.
Definition: Subscriber.h:26