149 lines
3.7 KiB
C++
149 lines
3.7 KiB
C++
/***********************************************************
|
|
* File generated by the HALCON-Compiler hcomp version 18.05
|
|
* Usage: Interface to C++
|
|
*
|
|
* Software by: MVTec Software GmbH, www.mvtec.com
|
|
***********************************************************/
|
|
|
|
|
|
#ifndef HCPP_HMUTEX
|
|
#define HCPP_HMUTEX
|
|
|
|
namespace HalconCpp
|
|
{
|
|
|
|
// Represents an instance of a mutex synchronization object.
|
|
class LIntExport HMutex : public HHandle
|
|
{
|
|
|
|
public:
|
|
|
|
// Create an uninitialized instance
|
|
HMutex():HHandle() {}
|
|
|
|
// Copy constructor
|
|
HMutex(const HMutex& source) : HHandle(source) {}
|
|
|
|
// Copy constructor
|
|
HMutex(const HHandle& handle);
|
|
|
|
// Create HMutex from handle, taking ownership
|
|
explicit HMutex(Hlong handle);
|
|
|
|
bool operator==(const HHandle& obj) const
|
|
{
|
|
return HHandleBase::operator==(obj);
|
|
}
|
|
|
|
bool operator!=(const HHandle& obj) const
|
|
{
|
|
return HHandleBase::operator!=(obj);
|
|
}
|
|
|
|
protected:
|
|
|
|
// Verify matching semantic type ('mutex')!
|
|
virtual void AssertType(Hphandle handle) const;
|
|
|
|
public:
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
* Operator-based class constructors
|
|
*****************************************************************************/
|
|
|
|
// create_mutex: Create a mutual exclusion synchronization object.
|
|
explicit HMutex(const HTuple& AttribName, const HTuple& AttribValue);
|
|
|
|
// create_mutex: Create a mutual exclusion synchronization object.
|
|
explicit HMutex(const HString& AttribName, const HString& AttribValue);
|
|
|
|
// create_mutex: Create a mutual exclusion synchronization object.
|
|
explicit HMutex(const char* AttribName, const char* AttribValue);
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
* Operators *
|
|
***************************************************************************/
|
|
|
|
// Clear the mutex synchronization object.
|
|
void ClearMutex() const;
|
|
|
|
// Unlock a mutex synchronization object.
|
|
void UnlockMutex() const;
|
|
|
|
// Lock a mutex synchronization object.
|
|
Hlong TryLockMutex() const;
|
|
|
|
// Lock a mutex synchronization object.
|
|
void LockMutex() const;
|
|
|
|
// Create a mutual exclusion synchronization object.
|
|
void CreateMutex(const HTuple& AttribName, const HTuple& AttribValue);
|
|
|
|
// Create a mutual exclusion synchronization object.
|
|
void CreateMutex(const HString& AttribName, const HString& AttribValue);
|
|
|
|
// Create a mutual exclusion synchronization object.
|
|
void CreateMutex(const char* AttribName, const char* AttribValue);
|
|
|
|
};
|
|
|
|
// forward declarations and types for internal array implementation
|
|
|
|
template<class T> class HSmartPtr;
|
|
template<class T> class HHandleBaseArrayRef;
|
|
|
|
typedef HHandleBaseArrayRef<HMutex> HMutexArrayRef;
|
|
typedef HSmartPtr< HMutexArrayRef > HMutexArrayPtr;
|
|
|
|
|
|
// Represents multiple tool instances
|
|
class LIntExport HMutexArray : public HHandleBaseArray
|
|
{
|
|
|
|
public:
|
|
|
|
// Create empty array
|
|
HMutexArray();
|
|
|
|
// Create array from native array of tool instances
|
|
HMutexArray(HMutex* classes, Hlong length);
|
|
|
|
// Copy constructor
|
|
HMutexArray(const HMutexArray &tool_array);
|
|
|
|
// Destructor
|
|
virtual ~HMutexArray();
|
|
|
|
// Assignment operator
|
|
HMutexArray &operator=(const HMutexArray &tool_array);
|
|
|
|
// Clears array and all tool instances
|
|
virtual void Clear();
|
|
|
|
// Get array of native tool instances
|
|
const HMutex* Tools() const;
|
|
|
|
// Get number of tools
|
|
virtual Hlong Length() const;
|
|
|
|
// Create tool array from tuple of handles
|
|
virtual void SetFromTuple(const HTuple& handles);
|
|
|
|
// Get tuple of handles for tool array
|
|
virtual HTuple ConvertToTuple() const;
|
|
|
|
protected:
|
|
|
|
// Smart pointer to internal data container
|
|
HMutexArrayPtr *mArrayPtr;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|