1 #ifndef XT_API_DEVICE_LIST_HPP
2 #define XT_API_DEVICE_LIST_HPP
6 #include <xt/cpp/Core.hpp>
7 #include <xt/cpp/Error.hpp>
22 XtDeviceList*
const _l;
26 int32_t GetCount()
const;
27 std::string GetId(int32_t index)
const;
28 std::string GetName(std::string
const&
id)
const;
29 DeviceCaps GetCapabilities(std::string
const&
id)
const;
34 { Detail::HandleDestroy(XtDeviceListDestroy, _l); }
40 Detail::HandleError(XtDeviceListGetCount(_l, &count));
48 Detail::HandleError(XtDeviceListGetId(_l, index,
nullptr, &size));
49 std::vector<char> buffer(static_cast<size_t>(size));
50 Detail::HandleError(XtDeviceListGetId(_l, index, buffer.data(), &size));
51 return std::string(buffer.data());
58 Detail::HandleError(XtDeviceListGetName(_l,
id.c_str(),
nullptr, &size));
59 std::vector<char> buffer(static_cast<size_t>(size));
60 Detail::HandleError(XtDeviceListGetName(_l,
id.c_str(), buffer.data(), &size));
61 return std::string(buffer.data());
67 XtDeviceCaps coreCapabilities;
68 Detail::HandleError(XtDeviceListGetCapabilities(_l,
id.c_str(), &coreCapabilities));
69 return static_cast<DeviceCaps>(coreCapabilities);
73 #endif // XT_API_DEVICE_LIST_HPP
~DeviceList()
Definition: XtDeviceList.hpp:33
int32_t GetCount() const
Definition: XtDeviceList.hpp:37
std::string GetName(std::string const &id) const
Definition: XtDeviceList.hpp:55
DeviceCaps
Definition: Enums.hpp:16
std::string GetId(int32_t index) const
Definition: XtDeviceList.hpp:45
Definition: XtDeviceList.hpp:17
Definition: XtService.hpp:23
DeviceCaps GetCapabilities(std::string const &id) const
Definition: XtDeviceList.hpp:65
Definition: Callbacks.hpp:10