HBarrier.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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_HBARRIER
  8. #define HCPP_HBARRIER
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a barrier synchronization object.
  12. class LIntExport HBarrier : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HBarrier():HHandle() {}
  17. // Copy constructor
  18. HBarrier(const HBarrier& source) : HHandle(source) {}
  19. // Copy constructor
  20. HBarrier(const HHandle& handle);
  21. // Create HBarrier from handle, taking ownership
  22. explicit HBarrier(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 ('barrier')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // create_barrier: Create a barrier synchronization object.
  39. explicit HBarrier(const HTuple& AttribName, const HTuple& AttribValue, Hlong TeamSize);
  40. // create_barrier: Create a barrier synchronization object.
  41. explicit HBarrier(const HString& AttribName, const HString& AttribValue, Hlong TeamSize);
  42. // create_barrier: Create a barrier synchronization object.
  43. explicit HBarrier(const char* AttribName, const char* AttribValue, Hlong TeamSize);
  44. #ifdef _WIN32
  45. // create_barrier: Create a barrier synchronization object.
  46. explicit HBarrier(const wchar_t* AttribName, const wchar_t* AttribValue, Hlong TeamSize);
  47. #endif
  48. /***************************************************************************
  49. * Operators *
  50. ***************************************************************************/
  51. // Destroy a barrier synchronization object.
  52. void ClearBarrier() const;
  53. // Wait on the release of a barrier synchronization object.
  54. void WaitBarrier() const;
  55. // Create a barrier synchronization object.
  56. void CreateBarrier(const HTuple& AttribName, const HTuple& AttribValue, Hlong TeamSize);
  57. // Create a barrier synchronization object.
  58. void CreateBarrier(const HString& AttribName, const HString& AttribValue, Hlong TeamSize);
  59. // Create a barrier synchronization object.
  60. void CreateBarrier(const char* AttribName, const char* AttribValue, Hlong TeamSize);
  61. #ifdef _WIN32
  62. // Create a barrier synchronization object.
  63. void CreateBarrier(const wchar_t* AttribName, const wchar_t* AttribValue, Hlong TeamSize);
  64. #endif
  65. };
  66. // forward declarations and types for internal array implementation
  67. template<class T> class HSmartPtr;
  68. template<class T> class HHandleBaseArrayRef;
  69. typedef HHandleBaseArrayRef<HBarrier> HBarrierArrayRef;
  70. typedef HSmartPtr< HBarrierArrayRef > HBarrierArrayPtr;
  71. // Represents multiple tool instances
  72. class LIntExport HBarrierArray : public HHandleBaseArray
  73. {
  74. public:
  75. // Create empty array
  76. HBarrierArray();
  77. // Create array from native array of tool instances
  78. HBarrierArray(HBarrier* classes, Hlong length);
  79. // Copy constructor
  80. HBarrierArray(const HBarrierArray &tool_array);
  81. // Destructor
  82. virtual ~HBarrierArray();
  83. // Assignment operator
  84. HBarrierArray &operator=(const HBarrierArray &tool_array);
  85. // Clears array and all tool instances
  86. virtual void Clear();
  87. // Get array of native tool instances
  88. const HBarrier* Tools() const;
  89. // Get number of tools
  90. virtual Hlong Length() const;
  91. // Create tool array from tuple of handles
  92. virtual void SetFromTuple(const HTuple& handles);
  93. // Get tuple of handles for tool array
  94. virtual HTuple ConvertToTuple() const;
  95. protected:
  96. // Smart pointer to internal data container
  97. HBarrierArrayPtr *mArrayPtr;
  98. };
  99. }
  100. #endif