HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Guid.h
Go to the documentation of this file.
1#pragma once
2#include "HephShared.h"
3#include <cinttypes>
4
7namespace Heph
8{
14 {
16 uint32_t data1;
17
19 uint16_t data2;
20
22 uint16_t data3;
23
25 uint8_t data4[8];
26
28 constexpr Guid() : data1(0), data2(0), data3(0), data4{ 0, 0, 0, 0, 0, 0, 0, 0 } {}
29
30 constexpr bool operator==(const Guid& rhs) const
31 {
32 if (this->data1 == rhs.data1 && this->data2 == rhs.data2 && this->data3 == rhs.data3)
33 {
34 for (size_t i = 0; i < 8; i++)
35 {
36 if (this->data4[i] != rhs.data4[i])
37 {
38 return false;
39 }
40 }
41 return true;
42 }
43 return false;
44 }
45
46 constexpr bool operator!=(const Guid& rhs) const
47 {
48 return !(this->operator==(rhs));
49 }
50
55 static Guid GenerateNew();
56 };
57}
#define HEPH_API
Definition HephShared.h:132
struct for storing globally unique identifiers.
Definition Guid.h:14
uint32_t data1
Definition Guid.h:16
uint16_t data3
Definition Guid.h:22
static Guid GenerateNew()
constexpr Guid()
Definition Guid.h:28
uint8_t data4[8]
Definition Guid.h:25
uint16_t data2
Definition Guid.h:19