HDlDevice.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 22.05
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HDLDEVICE
  8. #define HCPP_HDLDEVICE
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a Deep Learning capable compute device.
  12. class LIntExport HDlDevice : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDlDevice():HHandle() {}
  17. // Copy constructor
  18. HDlDevice(const HDlDevice& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDlDevice(const HHandle& handle);
  21. // Create HDlDevice from handle, taking ownership
  22. explicit HDlDevice(Hlong handle);
  23. bool operator==(const HHandle& obj) const
  24. {
  25. return HHandleBase::operator==(obj);
  26. }
  27. bool operator!=(const HHandle& obj) const
  28. {
  29. return HHandleBase::operator!=(obj);
  30. }
  31. protected:
  32. // Verify matching semantic type ('dl_device')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /***************************************************************************
  36. * Operators *
  37. ***************************************************************************/
  38. // Return the parameters of a deep-learning-capable hardware device.
  39. HTuple GetDlDeviceParam(const HString& GenParamName) const;
  40. // Return the parameters of a deep-learning-capable hardware device.
  41. HTuple GetDlDeviceParam(const char* GenParamName) const;
  42. #ifdef _WIN32
  43. // Return the parameters of a deep-learning-capable hardware device.
  44. HTuple GetDlDeviceParam(const wchar_t* GenParamName) const;
  45. #endif
  46. // Get list of deep-learning-capable hardware devices.
  47. static HDlDeviceArray QueryAvailableDlDevices(const HTuple& GenParamName, const HTuple& GenParamValue);
  48. // Get list of deep-learning-capable hardware devices.
  49. void QueryAvailableDlDevices(const HString& GenParamName, const HString& GenParamValue);
  50. // Get list of deep-learning-capable hardware devices.
  51. void QueryAvailableDlDevices(const char* GenParamName, const char* GenParamValue);
  52. #ifdef _WIN32
  53. // Get list of deep-learning-capable hardware devices.
  54. void QueryAvailableDlDevices(const wchar_t* GenParamName, const wchar_t* GenParamValue);
  55. #endif
  56. // Set the parameters of a deep-learning-capable hardware device.
  57. void SetDlDeviceParam(const HTuple& GenParamName, const HTuple& GenParamValue) const;
  58. // Set the parameters of a deep-learning-capable hardware device.
  59. void SetDlDeviceParam(const HString& GenParamName, const HString& GenParamValue) const;
  60. // Set the parameters of a deep-learning-capable hardware device.
  61. void SetDlDeviceParam(const char* GenParamName, const char* GenParamValue) const;
  62. #ifdef _WIN32
  63. // Set the parameters of a deep-learning-capable hardware device.
  64. void SetDlDeviceParam(const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  65. #endif
  66. };
  67. // forward declarations and types for internal array implementation
  68. template<class T> class HSmartPtr;
  69. template<class T> class HHandleBaseArrayRef;
  70. typedef HHandleBaseArrayRef<HDlDevice> HDlDeviceArrayRef;
  71. typedef HSmartPtr< HDlDeviceArrayRef > HDlDeviceArrayPtr;
  72. // Represents multiple tool instances
  73. class LIntExport HDlDeviceArray : public HHandleBaseArray
  74. {
  75. public:
  76. // Create empty array
  77. HDlDeviceArray();
  78. // Create array from native array of tool instances
  79. HDlDeviceArray(const HDlDevice* classes, Hlong length);
  80. // Copy constructor
  81. HDlDeviceArray(const HDlDeviceArray &tool_array);
  82. // Destructor
  83. virtual ~HDlDeviceArray();
  84. // Assignment operator
  85. HDlDeviceArray &operator=(const HDlDeviceArray &tool_array);
  86. // Clears array and all tool instances
  87. virtual void Clear();
  88. // Get array of native tool instances
  89. const HDlDevice* Tools() const;
  90. // Get number of tools
  91. virtual Hlong Length() const;
  92. // Create tool array from tuple of handles
  93. virtual void SetFromTuple(const HTuple& handles);
  94. // Get tuple of handles for tool array
  95. virtual HTuple ConvertToTuple() const;
  96. protected:
  97. // Smart pointer to internal data container
  98. HDlDeviceArrayPtr *mArrayPtr;
  99. };
  100. }
  101. #endif