Fawkes API  Fawkes Development Version
uuid.h
1 /***************************************************************************
2  * uuid.h - uuid_t wrapper
3  *
4  * Created: Tue 17 Nov 2020 10:09:43 CET 10:09
5  * Copyright 2020 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #pragma once
22 
23 #include <uuid/uuid.h>
24 
25 #include <string>
26 
27 namespace fawkes {
28 class Uuid
29 {
30 public:
31  Uuid() noexcept;
32  ~Uuid() noexcept;
33  Uuid(const Uuid &other) noexcept;
34  Uuid(Uuid &&other) noexcept;
35  explicit Uuid(const char *string);
36  Uuid & operator=(const Uuid &other) noexcept;
37  Uuid & operator=(Uuid &&other) noexcept;
38  std::string get_string() const;
39 
40  friend bool operator<(const Uuid &uuid, const Uuid &other) noexcept;
41  friend bool operator==(const Uuid &uuid, const Uuid &other) noexcept;
42  friend bool operator!=(const Uuid &uuid, const Uuid &other) noexcept;
43 
44 private:
45  uuid_t uuid_;
46 };
47 
48 } // namespace fawkes
A convenience class for universally unique identifiers (UUIDs).
Definition: uuid.h:29
Uuid & operator=(const Uuid &other) noexcept
Assignment operator.
Definition: uuid.cpp:83
~Uuid() noexcept
Destructor, clears up the occupied storage.
Definition: uuid.cpp:40
friend bool operator!=(const Uuid &uuid, const Uuid &other) noexcept
Compare two Uuids.
Definition: uuid.cpp:142
friend bool operator<(const Uuid &uuid, const Uuid &other) noexcept
Compare two Uuids.
Definition: uuid.cpp:120
std::string get_string() const
Get the string representation of the Uuid.
Definition: uuid.cpp:107
friend bool operator==(const Uuid &uuid, const Uuid &other) noexcept
Compare two Uuids.
Definition: uuid.cpp:131
Uuid() noexcept
Generate a new Uuid.
Definition: uuid.cpp:34
Fawkes library namespace.