YARP
Yet Another Robot Platform
Type.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_TYPE_H
10 #define YARP_OS_TYPE_H
11 
12 #include <yarp/os/api.h>
13 
14 #include <string>
15 
16 namespace yarp {
17 namespace os {
18 
19 class Property;
20 class Searchable;
21 class Value;
22 
24 {
25 public:
31  Type();
32 
38  Type(const Type& rhs);
39 
45  Type(Type&& rhs) noexcept;
46 
50  virtual ~Type();
51 
58  Type& operator=(const Type& rhs);
59 
66  Type& operator=(Type&& rhs) noexcept;
67 
71  std::string getName() const;
72 
73  std::string getNameOnWire() const;
74 
75  bool hasName() const;
76 
77  bool isValid() const;
78 
79  std::string toString() const;
80 
81  const Searchable& readProperties() const;
82 
83  Property& writeProperties();
84 
85  Type& addProperty(const char* key, const Value& val);
86 
90  static Type byName(const char* name);
91 
92  static Type byName(const char* name, const char* name_on_wire);
93 
94  static Type byNameOnWire(const char* name_on_wire);
95 
96  static Type anon();
97 
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
101 private:
102  class Private;
103  Private* mPriv;
104 #endif // DOXYGEN_SHOULD_SKIP_THIS
105 };
106 
107 } // namespace os
108 } // namespace yarp
109 
110 #endif // YARP_OS_TYPE_H
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:68
yarp::os::Type
Definition: Type.h:23
yarp::os::Time::isValid
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:317
yarp::os::Type::Private
Definition: Type.cpp:17
toString
std::string toString(const T &value)
convert an arbitrary type to string.
Definition: fakeMotionControl.cpp:121
yarp
Definition: environment.h:18
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:46
api.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:34