/***********************************************************
 * File generated by the HALCON-Compiler hcomp version 13.0
 * Usage: Interface to C++
 *
 * Software by: MVTec Software GmbH, www.mvtec.com
 ***********************************************************/


#ifndef HCPP_HMESSAGEQUEUE
#define HCPP_HMESSAGEQUEUE

namespace HalconCpp
{

// Represents an instance of a message queue for inter-thread communication.
class LIntExport HMessageQueue : public HToolBase
{

public:

  // Copy constructor
  HMessageQueue(const HMessageQueue& source) : HToolBase(source) {}

  // Create HMessageQueue from handle, taking ownership
  explicit HMessageQueue(Hlong handle);

  // Set new handle, taking ownership
  void SetHandle(Hlong handle);



/*****************************************************************************
 * Operator-based class constructors
 *****************************************************************************/

  // create_message_queue: Create a new empty message queue.
  explicit HMessageQueue();




  /***************************************************************************
   * Operators                                                               *
   ***************************************************************************/

  // Query message queue parameters or information about the queue.
  HTuple GetMessageQueueParam(const HTuple& GenParamName) const;

  // Query message queue parameters or information about the queue.
  HTuple GetMessageQueueParam(const HString& GenParamName) const;

  // Query message queue parameters or information about the queue.
  HTuple GetMessageQueueParam(const char* GenParamName) const;

  // Set message queue parameters or invoke commands on the queue.
  void SetMessageQueueParam(const HTuple& GenParamName, const HTuple& GenParamValue) const;

  // Set message queue parameters or invoke commands on the queue.
  void SetMessageQueueParam(const HString& GenParamName, const HTuple& GenParamValue) const;

  // Set message queue parameters or invoke commands on the queue.
  void SetMessageQueueParam(const char* GenParamName, const HTuple& GenParamValue) const;

  // Receive one or more messages from the message queue.
  HMessageArray DequeueMessage(const HTuple& GenParamName, const HTuple& GenParamValue) const;

  // Receive one or more messages from the message queue.
  HMessage DequeueMessage(const HString& GenParamName, const HTuple& GenParamValue) const;

  // Receive one or more messages from the message queue.
  HMessage DequeueMessage(const char* GenParamName, const HTuple& GenParamValue) const;

  // Enqueue one or more messages to the message queue.
  void EnqueueMessage(const HMessageArray& MessageHandle, const HTuple& GenParamName, const HTuple& GenParamValue) const;

  // Enqueue one or more messages to the message queue.
  void EnqueueMessage(const HMessage& MessageHandle, const HTuple& GenParamName, const HTuple& GenParamValue) const;

  // Create a new empty message queue.
  void CreateMessageQueue();

};

// forward declarations and types for internal array implementation

template<class T> class HSmartPtr;
template<class T> class HToolArrayRef;

typedef HToolArrayRef<HMessageQueue> HMessageQueueArrayRef;
typedef HSmartPtr< HMessageQueueArrayRef > HMessageQueueArrayPtr;


// Represents multiple tool instances
class LIntExport HMessageQueueArray : public HToolArray
{

public:

  // Create empty array
  HMessageQueueArray();

  // Create array from native array of tool instances
  HMessageQueueArray(HMessageQueue* classes, Hlong length);

  // Copy constructor
  HMessageQueueArray(const HMessageQueueArray &tool_array);

  // Destructor
  virtual ~HMessageQueueArray();

  // Assignment operator
  HMessageQueueArray &operator=(const HMessageQueueArray &tool_array);

  // Clears array and all tool instances
  virtual void Clear();

  // Get array of native tool instances
  const HMessageQueue* 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
   HMessageQueueArrayPtr *mArrayPtr;
};

}

#endif
