HDlDevice.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 20.11
  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. };
  57. // forward declarations and types for internal array implementation
  58. template<class T> class HSmartPtr;
  59. template<class T> class HHandleBaseArrayRef;
  60. typedef HHandleBaseArrayRef<HDlDevice> HDlDeviceArrayRef;
  61. typedef HSmartPtr< HDlDeviceArrayRef > HDlDeviceArrayPtr;
  62. // Represents multiple tool instances
  63. class LIntExport HDlDeviceArray : public HHandleBaseArray
  64. {
  65. public:
  66. // Create empty array
  67. HDlDeviceArray();
  68. // Create array from native array of tool instances
  69. HDlDeviceArray(HDlDevice* classes, Hlong length);
  70. // Copy constructor
  71. HDlDeviceArray(const HDlDeviceArray &tool_array);
  72. // Destructor
  73. virtual ~HDlDeviceArray();
  74. // Assignment operator
  75. HDlDeviceArray &operator=(const HDlDeviceArray &tool_array);
  76. // Clears array and all tool instances
  77. virtual void Clear();
  78. // Get array of native tool instances
  79. const HDlDevice* Tools() const;
  80. // Get number of tools
  81. virtual Hlong Length() const;
  82. // Create tool array from tuple of handles
  83. virtual void SetFromTuple(const HTuple& handles);
  84. // Get tuple of handles for tool array
  85. virtual HTuple ConvertToTuple() const;
  86. protected:
  87. // Smart pointer to internal data container
  88. HDlDeviceArrayPtr *mArrayPtr;
  89. };
  90. }
  91. #endif