#ifndef _IVIEWMONITOR_H
#define _IVIEWMONITOR_H
#include <unistd.h>
#include "ErrorHandler.h"
#include "Iview.h"

class DmControlSource;

class IviewMonitor : public ErrorHandler
{
  public:
  IviewMonitor();
  ~IviewMonitor();
  
  // Determine if specified device/axes has been acquired by an IviewControl
  MBool hasControl(IviewDevice device, 
		   unsigned short axisMask,
		   int *id,                // id of controlling IviewControl
		   pid_t *pid              // pid of controlling IviewControl 
		   );

  // Return pid of client which owns specified IviewControl
  pid_t clientPid(unsigned int controlId,    // id of controlling IviewControl
		  MBool *inUse               // True if currently used
		  );

  // Return client info for specified control
  int clientInfo(unsigned int controlId,
		 MBool *inUse,
		 int *clientHostAddr,
		 pid_t *clientPid,
		 unsigned short *axisMask,
		 unsigned short *deviceMask);

  DmControlSource *controlSource[MaxControlSources];
};



#endif
