123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- /***********************************************************
- * File generated by the HALCON-Compiler hcomp version 20.11
- * Usage: Interface to C++
- *
- * Software by: MVTec Software GmbH, www.mvtec.com
- ***********************************************************/
- #ifndef HCPP_HIOCHANNEL
- #define HCPP_HIOCHANNEL
- namespace HalconCpp
- {
- // Represents an instance of a channel of an I/O device.
- class LIntExport HIOChannel : public HHandle
- {
- public:
- // Create an uninitialized instance
- HIOChannel():HHandle() {}
- // Copy constructor
- HIOChannel(const HIOChannel& source) : HHandle(source) {}
- // Copy constructor
- HIOChannel(const HHandle& handle);
- // Create HIOChannel from handle, taking ownership
- explicit HIOChannel(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 ('io_channel')!
- virtual void AssertType(Hphandle handle) const;
- public:
- /*****************************************************************************
- * Operator-based class constructors
- *****************************************************************************/
- // open_io_channel: Open and configure I/O channels.
- explicit HIOChannel(const HIODevice& IODeviceHandle, const HString& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- // open_io_channel: Open and configure I/O channels.
- explicit HIOChannel(const HIODevice& IODeviceHandle, const char* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- #ifdef _WIN32
- // open_io_channel: Open and configure I/O channels.
- explicit HIOChannel(const HIODevice& IODeviceHandle, const wchar_t* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- #endif
- /***************************************************************************
- * Operators *
- ***************************************************************************/
- // Perform an action on I/O channels.
- static HTuple ControlIoChannel(const HIOChannelArray& IOChannelHandle, const HString& ParamAction, const HTuple& ParamArgument);
- // Perform an action on I/O channels.
- HTuple ControlIoChannel(const HString& ParamAction, const HTuple& ParamArgument) const;
- // Perform an action on I/O channels.
- HTuple ControlIoChannel(const char* ParamAction, const HTuple& ParamArgument) const;
- #ifdef _WIN32
- // Perform an action on I/O channels.
- HTuple ControlIoChannel(const wchar_t* ParamAction, const HTuple& ParamArgument) const;
- #endif
- // Write a value to the specified I/O channels.
- static HTuple WriteIoChannel(const HIOChannelArray& IOChannelHandle, const HTuple& Value);
- // Write a value to the specified I/O channels.
- HTuple WriteIoChannel(const HTuple& Value) const;
- // Read a value from the specified I/O channels.
- static HTuple ReadIoChannel(const HIOChannelArray& IOChannelHandle, HTuple* Status);
- // Read a value from the specified I/O channels.
- HTuple ReadIoChannel(HTuple* Status) const;
- // Set specific parameters of I/O channels.
- static void SetIoChannelParam(const HIOChannelArray& IOChannelHandle, const HTuple& GenParamName, const HTuple& GenParamValue);
- // Set specific parameters of I/O channels.
- void SetIoChannelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const;
- // Query specific parameters of I/O channels.
- static HTuple GetIoChannelParam(const HIOChannelArray& IOChannelHandle, const HTuple& GenParamName);
- // Query specific parameters of I/O channels.
- HTuple GetIoChannelParam(const HString& GenParamName) const;
- // Query specific parameters of I/O channels.
- HTuple GetIoChannelParam(const char* GenParamName) const;
- #ifdef _WIN32
- // Query specific parameters of I/O channels.
- HTuple GetIoChannelParam(const wchar_t* GenParamName) const;
- #endif
- // Close I/O channels.
- static void CloseIoChannel(const HIOChannelArray& IOChannelHandle);
- // Close I/O channels.
- void CloseIoChannel() const;
- // Open and configure I/O channels.
- static HIOChannelArray OpenIoChannel(const HIODevice& IODeviceHandle, const HTuple& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- // Open and configure I/O channels.
- void OpenIoChannel(const HIODevice& IODeviceHandle, const HString& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- // Open and configure I/O channels.
- void OpenIoChannel(const HIODevice& IODeviceHandle, const char* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- #ifdef _WIN32
- // Open and configure I/O channels.
- void OpenIoChannel(const HIODevice& IODeviceHandle, const wchar_t* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue);
- #endif
- };
- // forward declarations and types for internal array implementation
- template<class T> class HSmartPtr;
- template<class T> class HHandleBaseArrayRef;
- typedef HHandleBaseArrayRef<HIOChannel> HIOChannelArrayRef;
- typedef HSmartPtr< HIOChannelArrayRef > HIOChannelArrayPtr;
- // Represents multiple tool instances
- class LIntExport HIOChannelArray : public HHandleBaseArray
- {
- public:
- // Create empty array
- HIOChannelArray();
- // Create array from native array of tool instances
- HIOChannelArray(HIOChannel* classes, Hlong length);
- // Copy constructor
- HIOChannelArray(const HIOChannelArray &tool_array);
- // Destructor
- virtual ~HIOChannelArray();
- // Assignment operator
- HIOChannelArray &operator=(const HIOChannelArray &tool_array);
- // Clears array and all tool instances
- virtual void Clear();
- // Get array of native tool instances
- const HIOChannel* 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
- HIOChannelArrayPtr *mArrayPtr;
- };
- }
- #endif
|