8 #ifndef META_OCEAN_SYSTEM_USB_CONTEXT_H
9 #define META_OCEAN_SYSTEM_USB_CONTEXT_H
55 explicit Context(
const bool noDeviceDiscovery =
false,
const bool usbDk =
false);
66 inline libusb_context* usbContext()
const;
77 inline bool isValid()
const;
102 libusb_context* usbContext_ =
nullptr;
110 *
this = std::move(context);
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This class wraps a libusb context.
Definition: system/usb/Context.h:39
Lock lock_
The context's lock.
Definition: system/usb/Context.h:105
libusb_context * usbContext_
The actual libusb context.
Definition: system/usb/Context.h:102
Context(Context &&context) noexcept
Move constructor.
Definition: system/usb/Context.h:108
Context & operator=(Context &&context) noexcept
Move operator.
Context(const Context &)=delete
Disabled copy constructor.
Context(const bool noDeviceDiscovery=false, const bool usbDk=false)
Creates a new custom context.
Context & operator=(const Context &)=delete
Disabled copy operator.
libusb_context * usbContext() const
Returns the actual libusb context.
Definition: system/usb/Context.h:113
void release()
Explicitly releases the context.
~Context()
Destructs and releases the context.
bool isValid() const
Returns whether this object wraps a valid context (which is not nullptr).
Definition: system/usb/Context.h:118
std::shared_ptr< Context > SharedContext
Definition of a shared pointer holding a context.
Definition: system/usb/Context.h:32
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15