diff options
| author | Alan Somers <asomers@FreeBSD.org> | 2017-11-28 16:52:38 +0000 |
|---|---|---|
| committer | Alan Somers <asomers@FreeBSD.org> | 2017-11-28 16:52:38 +0000 |
| commit | 91a55a67ccf17067d087efe3cd86c1df60548505 (patch) | |
| tree | 94861a9ecb514bb7b864abe3c7eea0a1be48e591 /lib/libdevdctl | |
| parent | 3aca55ef57b8140b9b85262680c42a50b142fdab (diff) | |
Notes
Diffstat (limited to 'lib/libdevdctl')
| -rw-r--r-- | lib/libdevdctl/guid.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libdevdctl/guid.h b/lib/libdevdctl/guid.h index ede414bec649..02ea6f27dc04 100644 --- a/lib/libdevdctl/guid.h +++ b/lib/libdevdctl/guid.h @@ -62,9 +62,13 @@ class Guid { public: /* Constructors */ + /* Default constructor: an Invalid guid */ Guid(); + /* Construct a guid from a provided integer */ Guid(uint64_t guid); + /* Construct a guid from a string in base 8, 10, or 16 */ Guid(const std::string &guid); + static Guid InvalidGuid(); /* Assignment */ Guid& operator=(const Guid& rhs); @@ -80,8 +84,9 @@ public: operator uint64_t() const; operator bool() const; - static const uint64_t INVALID_GUID = 0; protected: + static const uint64_t INVALID_GUID = 0; + /* The integer value of the GUID. */ uint64_t m_GUID; }; @@ -99,6 +104,12 @@ Guid::Guid(uint64_t guid) { } +inline Guid +Guid::InvalidGuid() +{ + return (Guid(INVALID_GUID)); +} + inline Guid& Guid::operator=(const Guid &rhs) { |
