stub_analytics_plugin  1.6
Network Optix Video Analytics SDK
uuid.h
1 #pragma once
2 
3 #include <array>
4 #include <cstring>
5 
6 namespace nx {
7 namespace sdk {
8 
17 class Uuid: public std::array<uint8_t, 16>
18 {
19 public:
20  using base_type = std::array<uint8_t, 16>;
21 
22  static constexpr int kSize = (int) std::tuple_size<base_type>();
23 
24  constexpr Uuid(
25  uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3,
26  uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7,
27  uint8_t b8, uint8_t b9, uint8_t bA, uint8_t bB,
28  uint8_t bC, uint8_t bD, uint8_t bE, uint8_t bF)
29  :
30  base_type({b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, bA, bB, bC, bD, bE, bF})
31  {
32  }
33 
34  explicit Uuid(const uint8_t (&byteArray)[kSize])
35  {
36  memcpy(data(), byteArray, kSize);
37  }
38 
39  constexpr Uuid(): base_type{} {} //< All zeros.
40 
41  bool isNull() const { return *this == Uuid(); }
42 };
43 
44 } // namespace sdk
45 } // namespace nx
Definition: uuid.h:17
Definition: debug.cpp:13