Gazebo Fuel_tools

API Reference

4.9.1
gz/fuel_tools/CollectionIdentifier.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef GZ_FUEL_TOOLS_COLLECTIONIDENTIFIER_HH_
19 #define GZ_FUEL_TOOLS_COLLECTIONIDENTIFIER_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gz/fuel_tools/Helpers.hh"
25 
26 #ifdef _WIN32
27 // Disable warning C4251 which is triggered by
28 // std::unique_ptr
29 #pragma warning(push)
30 #pragma warning(disable: 4251)
31 #endif
32 
33 namespace ignition
34 {
35  namespace fuel_tools
36  {
38  class CollectionIdentifierPrivate;
39  class ServerConfig;
40 
42  class IGNITION_FUEL_TOOLS_VISIBLE CollectionIdentifier
43  {
45  public: CollectionIdentifier();
46 
49  public: CollectionIdentifier(const CollectionIdentifier &_orig);
50 
52  public: ~CollectionIdentifier();
53 
57  public: CollectionIdentifier
58  &operator=(const CollectionIdentifier &_orig);
59 
63  public: bool operator==(const CollectionIdentifier &_rhs) const;
64 
67  public: std::string Name() const;
68 
72  public: bool SetName(const std::string &_name);
73 
76  public: std::string Owner() const;
77 
81  public: bool SetOwner(const std::string &_name);
82 
85  public: ServerConfig &Server() const;
86 
90  public: bool SetServer(const ServerConfig &_server);
91 
95  public: std::string UniqueName() const;
96 
101  public: std::string AsString(const std::string &_prefix = "") const;
102 
107  public: std::string AsPrettyString(const std::string &_prefix = "") const;
108 
111  };
112  }
113 }
114 
115 #ifdef _MSC_VER
116 #pragma warning(pop)
117 #endif
118 
119 #endif
STL class.
bool SetName(const std::string &_name)
Set the name of the collection.
bool SetServer(const ServerConfig &_server)
Set the server from which this collection comes.
bool SetOwner(const std::string &_name)
Set the owner of the collection.
std::string AsString(const std::string &_prefix="") const
Returns all the collection information as a string. Convenient for debugging.
CollectionIdentifier & operator=(const CollectionIdentifier &_orig)
Assignment operator.
bool operator==(const CollectionIdentifier &_rhs) const
Equality operator.
Describes options needed for a server.
Definition: gz/fuel_tools/ClientConfig.hh:47
ServerConfig & Server() const
Returns server information to retrieve collection from.
std::string Owner() const
Returns owner to attribute collection to.
std::string AsPrettyString(const std::string &_prefix="") const
Returns all the available collection information as a string using colors for better human parsing.
std::string Name() const
Returns the collection name.
Defines how to identify a collection.
Definition: gz/fuel_tools/CollectionIdentifier.hh:42
std::string UniqueName() const
Returns a unique name for the collection.