YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
NameService.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 YARPDB_NAMESERVICE_INC
8#define YARPDB_NAMESERVICE_INC
9
10#include <yarp/name/api.h>
11#include <yarp/os/Bottle.h>
12#include <yarp/os/Contact.h>
13#include <yarp/os/NameStore.h>
14
15namespace yarp::name {
16class NameService;
17} // namespace yarp::name
18
25public:
26 virtual ~NameService() {}
27
28 virtual bool apply(yarp::os::Bottle& cmd,
29 yarp::os::Bottle& reply,
30 yarp::os::Bottle& event,
31 const yarp::os::Contact& remote) = 0;
32
33 virtual void onEvent(yarp::os::Bottle& event) {}
34
35 virtual void lock() {}
36 virtual void unlock() {}
37
38 virtual void goPublic() {}
39
40 yarp::os::Contact query(const std::string& name) override {
41 return yarp::os::Contact();
42 }
43
44 bool announce(const std::string& name, int activity) override {
45 return false;
46 }
47
50 const yarp::os::Contact& remote) override;
51};
52
53
54#endif
Abstract interface for a name server operator.
Definition NameService.h:24
bool announce(const std::string &name, int activity) override
Definition NameService.h:44
virtual void onEvent(yarp::os::Bottle &event)
Definition NameService.h:33
virtual void lock()
Definition NameService.h:35
virtual void goPublic()
Definition NameService.h:38
bool process(yarp::os::PortWriter &in, yarp::os::PortReader &out, const yarp::os::Contact &remote) override
virtual void unlock()
Definition NameService.h:36
virtual bool apply(yarp::os::Bottle &cmd, yarp::os::Bottle &reply, yarp::os::Bottle &event, const yarp::os::Contact &remote)=0
yarp::os::Contact query(const std::string &name) override
Definition NameService.h:40
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
Represents how to reach a part of a YARP network.
Definition Contact.h:33
Abstract interface for a database of port names.
Definition NameStore.h:19
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition PortWriter.h:23
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_name_API
Definition api.h:17