NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
INvSIPLDeviceInterfaceProvider.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 #ifndef NVSIPLDEVICEINTERFACEPROVIDERINTERFACE_HPP
13 #define NVSIPLDEVICEINTERFACEPROVIDERINTERFACE_HPP
14 
15 #include <cstring>
16 #include <cstdint>
25 namespace nvsipl
26 {
27 
33 class UUID
34 {
35 public:
37  uint32_t time_low;
39  uint16_t time_mid;
43  uint16_t clock_seq;
45  uint8_t node[6];
46 
64  constexpr UUID(uint32_t const low, uint16_t const mid,
65  uint16_t const high, uint16_t const seq,
66  uint8_t const n0, uint8_t const n1, uint8_t const n2,
67  uint8_t const n3, uint8_t const n4, uint8_t const n5)
68  : time_low(low)
69  , time_mid(mid)
70  , time_hi_and_version(high)
71  , clock_seq(seq)
72  , node{n0,n1,n2,n3,n4,n5}
73  { }
74 
76  UUID() : UUID(0U,0U,0U,0U,0U,0U,0U,0U,0U,0U)
77  { }
78 
80  friend bool operator==(const UUID &l, const UUID &r) noexcept
81  {
82  if (l.time_low != r.time_low){
83  return false;
84  } else if (l.time_mid != r.time_mid){
85  return false;
86  } else if (l.time_hi_and_version != r.time_hi_and_version){
87  return false;
88  } else if (l.clock_seq != r.clock_seq){
89  return false;
90  } else if (l.node[0] != r.node[0]){
91  return false;
92  } else if (l.node[1] != r.node[1]){
93  return false;
94  } else if (l.node[2] != r.node[2]){
95  return false;
96  } else if (l.node[3] != r.node[3]){
97  return false;
98  } else if (l.node[4] != r.node[4]){
99  return false;
100  } else if (l.node[5] != r.node[5]){
101  return false;
102  } else {
103  return true;
104  }
105  };
106 };
107 
108 static_assert(sizeof(UUID) ==
109  sizeof(uint32_t) +
110  sizeof(uint16_t) +
111  sizeof(uint16_t) +
112  sizeof(uint16_t) +
113  sizeof(uint8_t) * 6,
114  "Missing check in == operator as Structure shall not have padding");
115 
118 {
119 public:
121  NonCopyable() = default;
122 
124  NonCopyable(NonCopyable& other) = delete;
125 
127  NonCopyable& operator=(NonCopyable& other) & = delete;
128 
130  NonCopyable(NonCopyable&& other) = delete;
131 
133  NonCopyable& operator=(NonCopyable&& other) & = delete;
134 
135 protected:
137  ~NonCopyable() = default;
138 };
139 
146 class Interface : public NonCopyable
147 {
148 public:
176  virtual const UUID &getInstanceInterfaceID() const noexcept = 0;
177 
178 protected:
180  Interface() = default;
181 
183  Interface(Interface &) = delete;
184 
186  Interface(Interface &&) = delete;
187 
189  Interface& operator=(Interface &) & = delete;
190 
192  Interface& operator=(Interface &&) & = delete;
193 
195  ~Interface() = default;
196 };
197 
202 {
203 public:
243  virtual Interface* GetInterface(const UUID &interfaceId) = 0;
244 
245 protected:
247  IInterfaceProvider() = default;
248 
251 
254 
257 
260 
262  virtual ~IInterfaceProvider() = default;
263 };
264 
267 } // end of namespace nvsipl
268 #endif //NVSIPLDEVICEINTERFACEPROVIDERINTERFACE_HPP
nvsipl::UUID::time_hi_and_version
uint16_t time_hi_and_version
Member variable to store the third opaque field composing the UUID.
Definition: INvSIPLDeviceInterfaceProvider.hpp:41
nvsipl::UUID::time_mid
uint16_t time_mid
Member variable to store the second opaque field composing the UUID.
Definition: INvSIPLDeviceInterfaceProvider.hpp:39
nvsipl::UUID::UUID
UUID()
Construct for a new UUID object with default intialization values.
Definition: INvSIPLDeviceInterfaceProvider.hpp:76
nvsipl::IInterfaceProvider::IInterfaceProvider
IInterfaceProvider()=default
Default Constructor.
nvsipl::Interface::Interface
Interface()=default
Default Constructor.
nvsipl::Interface::~Interface
~Interface()=default
Default destructor for the class.
nvsipl::IInterfaceProvider::operator=
IInterfaceProvider & operator=(IInterfaceProvider &) &=delete
Delete copy assignment operator.
nvsipl::NonCopyable::operator=
NonCopyable & operator=(NonCopyable &other) &=delete
Delete copy assignment operator.
nvsipl::NonCopyable
A class to prevent drivers being copied and duplicating state.
Definition: INvSIPLDeviceInterfaceProvider.hpp:117
nvsipl::Interface::getInstanceInterfaceID
virtual const UUID & getInstanceInterfaceID() const noexcept=0
A call to get the ID from the instance of the class inheriting this interface.
nvsipl::UUID
A universally unique identifier.
Definition: INvSIPLDeviceInterfaceProvider.hpp:33
nvsipl::UUID::time_low
uint32_t time_low
Member variable to store the first opaque field composing the UUID.
Definition: INvSIPLDeviceInterfaceProvider.hpp:37
nvsipl::Interface
Top-level interface class implementable for a particular device.
Definition: INvSIPLDeviceInterfaceProvider.hpp:146
nvsipl::NonCopyable::~NonCopyable
~NonCopyable()=default
Default destructor.
nvsipl::Interface::operator=
Interface & operator=(Interface &) &=delete
Delete copy assignment operator.
nvsipl::IInterfaceProvider
Class providing access to device interfaces.
Definition: INvSIPLDeviceInterfaceProvider.hpp:201
nvsipl::IInterfaceProvider::GetInterface
virtual Interface * GetInterface(const UUID &interfaceId)=0
Get interface provided by this driver matching a provided ID.
nvsipl::UUID::UUID
constexpr UUID(uint32_t const low, uint16_t const mid, uint16_t const high, uint16_t const seq, uint8_t const n0, uint8_t const n1, uint8_t const n2, uint8_t const n3, uint8_t const n4, uint8_t const n5)
Constructs a new UUID object with parameter values.
Definition: INvSIPLDeviceInterfaceProvider.hpp:64
nvsipl
Describes the custom interface for IMX623.
Definition: AR0820_CUST1_CustomInterface.hpp:21
nvsipl::UUID::clock_seq
uint16_t clock_seq
Member variable to store the fourth opaque field composing the UUID.
Definition: INvSIPLDeviceInterfaceProvider.hpp:43
nvsipl::UUID::operator==
friend bool operator==(const UUID &l, const UUID &r) noexcept
comparison operator to compare contents of two SSID structures
Definition: INvSIPLDeviceInterfaceProvider.hpp:80
nvsipl::IInterfaceProvider::~IInterfaceProvider
virtual ~IInterfaceProvider()=default
Default destructor.
nvsipl::UUID::node
uint8_t node[6]
Member variable to store the fifth-tenth opaque field composing the UUID.
Definition: INvSIPLDeviceInterfaceProvider.hpp:45
nvsipl::NonCopyable::NonCopyable
NonCopyable()=default
Default Constructor.