/*
********************************************************
Copyright 2000 MBARI.
MBARI Proprietary Information. All rights reserved.
NOTE: This file is automatically generated.
DO NOT MODIFY.
********************************************************
*/

#ifndef __RangeFinderIF_SK_H
#define __RangeFinderIF_SK_H

#include "TaskServer.h"
#include "RangeFinderIF.h"
#include "InstrumentIF_SK.h"

class RangeFinderIF_SK : public InstrumentIF_SK {

  public:

  // Constructor for server with default name
  RangeFinderIF_SK();

  // Constructor for server with specific name
  RangeFinderIF_SK(const char *serverName);

  virtual ~RangeFinderIF_SK();
  
  protected:

  // These methods must be defined in subclass
  virtual void xzAngle(double *radians) = 0;
  virtual void maxRange(double *meters) = 0;
  virtual DeviceIF::Status range(Boolean *echoReceived, double *meters, TimeIF::TimeSpec *sampleTime) = 0;
  virtual DeviceIF::Status enable() = 0;
  virtual DeviceIF::Status disable() = 0;
  
  // Declare callbacks corresponding to each method
  Boolean xzAngleCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean maxRangeCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean rangeCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean enableCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean disableCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  
  // Message structure pointer for each method
  RangeFinderIF::XzAngleMsg *_xzAngleMsg;
  RangeFinderIF::MaxRangeMsg *_maxRangeMsg;
  RangeFinderIF::RangeMsg *_rangeMsg;
  RangeFinderIF::EnableMsg *_enableMsg;
  RangeFinderIF::DisableMsg *_disableMsg;
  
  // Determine max bytes required for message buffer
  virtual size_t maxRequestBytes();

  // Allocate buffer for messages, set pointers, etc
  virtual void allocateBuffers();

  private:

  // Initializer method called by constructors
  int init();

};

#endif

