HComputeDevice.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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_HCOMPUTEDEVICE
  8. #define HCPP_HCOMPUTEDEVICE
  9. namespace HalconCpp
  10. {
  11. // Class representing a compute device handle.
  12. class LIntExport HComputeDevice : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HComputeDevice():HHandle() {}
  17. // Copy constructor
  18. HComputeDevice(const HComputeDevice& source) : HHandle(source) {}
  19. // Copy constructor
  20. HComputeDevice(const HHandle& handle);
  21. bool operator==(const HHandle& obj) const
  22. {
  23. return HHandleBase::operator==(obj);
  24. }
  25. bool operator!=(const HHandle& obj) const
  26. {
  27. return HHandleBase::operator!=(obj);
  28. }
  29. protected:
  30. // Verify matching semantic type ('compute_device')!
  31. virtual void AssertType(Hphandle handle) const;
  32. public:
  33. /*****************************************************************************
  34. * Operator-based class constructors
  35. *****************************************************************************/
  36. // open_compute_device: Open a compute device.
  37. explicit HComputeDevice(Hlong DeviceIdentifier);
  38. /***************************************************************************
  39. * Operators *
  40. ***************************************************************************/
  41. // Query compute device parameters.
  42. HTuple GetComputeDeviceParam(const HString& GenParamName) const;
  43. // Query compute device parameters.
  44. HTuple GetComputeDeviceParam(const char* GenParamName) const;
  45. #ifdef _WIN32
  46. // Query compute device parameters.
  47. HTuple GetComputeDeviceParam(const wchar_t* GenParamName) const;
  48. #endif
  49. // Set parameters of an compute device.
  50. void SetComputeDeviceParam(const HString& GenParamName, const HTuple& GenParamValue) const;
  51. // Set parameters of an compute device.
  52. void SetComputeDeviceParam(const HString& GenParamName, const HString& GenParamValue) const;
  53. // Set parameters of an compute device.
  54. void SetComputeDeviceParam(const char* GenParamName, const char* GenParamValue) const;
  55. #ifdef _WIN32
  56. // Set parameters of an compute device.
  57. void SetComputeDeviceParam(const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  58. #endif
  59. // Close all compute devices.
  60. static void ReleaseAllComputeDevices();
  61. // Close a compute_device.
  62. void ReleaseComputeDevice() const;
  63. // Deactivate all compute devices.
  64. static void DeactivateAllComputeDevices();
  65. // Deactivate a compute device.
  66. void DeactivateComputeDevice() const;
  67. // Activate a compute device.
  68. void ActivateComputeDevice() const;
  69. // Initialize a compute device.
  70. void InitComputeDevice(const HTuple& Operators) const;
  71. // Open a compute device.
  72. void OpenComputeDevice(Hlong DeviceIdentifier);
  73. // Get information on a compute device.
  74. static HTuple GetComputeDeviceInfo(Hlong DeviceIdentifier, const HString& InfoName);
  75. // Get information on a compute device.
  76. static HTuple GetComputeDeviceInfo(Hlong DeviceIdentifier, const char* InfoName);
  77. #ifdef _WIN32
  78. // Get information on a compute device.
  79. static HTuple GetComputeDeviceInfo(Hlong DeviceIdentifier, const wchar_t* InfoName);
  80. #endif
  81. // Get the list of available compute devices.
  82. static HTuple QueryAvailableComputeDevices();
  83. };
  84. // forward declarations and types for internal array implementation
  85. template<class T> class HSmartPtr;
  86. template<class T> class HHandleBaseArrayRef;
  87. typedef HHandleBaseArrayRef<HComputeDevice> HComputeDeviceArrayRef;
  88. typedef HSmartPtr< HComputeDeviceArrayRef > HComputeDeviceArrayPtr;
  89. // Represents multiple tool instances
  90. class LIntExport HComputeDeviceArray : public HHandleBaseArray
  91. {
  92. public:
  93. // Create empty array
  94. HComputeDeviceArray();
  95. // Create array from native array of tool instances
  96. HComputeDeviceArray(HComputeDevice* classes, Hlong length);
  97. // Copy constructor
  98. HComputeDeviceArray(const HComputeDeviceArray &tool_array);
  99. // Destructor
  100. virtual ~HComputeDeviceArray();
  101. // Assignment operator
  102. HComputeDeviceArray &operator=(const HComputeDeviceArray &tool_array);
  103. // Clears array and all tool instances
  104. virtual void Clear();
  105. // Get array of native tool instances
  106. const HComputeDevice* Tools() const;
  107. // Get number of tools
  108. virtual Hlong Length() const;
  109. // Create tool array from tuple of handles
  110. virtual void SetFromTuple(const HTuple& handles);
  111. // Get tuple of handles for tool array
  112. virtual HTuple ConvertToTuple() const;
  113. protected:
  114. // Smart pointer to internal data container
  115. HComputeDeviceArrayPtr *mArrayPtr;
  116. };
  117. }
  118. #endif