/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : TempControl_SK.cc                                             */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*
NOTE: This file is automatically generated.
DO NOT MODIFY.
*/

#include <stdlib.h>
#include "TempControl_SK.h"

TempControl_SK::TempControl_SK()
  :  TaskServer(TempControlServerName)
{
  init();
}


TempControl_SK::TempControl_SK(const char *serverName)
  : TaskServer(serverName)
{
  init();
}


TempControl_SK::~TempControl_SK()
{
}

Boolean TempControl_SK::eatMyCallback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  eatMy(_eatMyMsg->shorts);

  *reply = _eatMyMsg;
  *nReplyBytes = sizeof(TempControl::EatMyMsg);
  return True;
}


Boolean TempControl_SK::setpointCallback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  _setpointMsg->returnVal = 
     setpoint();

  *reply = _setpointMsg;
  *nReplyBytes = sizeof(TempControl::SetpointMsg);
  return True;
}


Boolean TempControl_SK::fooCallback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  _fooMsg->returnVal = 
     foo(_fooMsg->junk);

  *reply = _fooMsg;
  *nReplyBytes = sizeof(TempControl::FooMsg);
  return True;
}


Boolean TempControl_SK::foo01Callback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  _foo01Msg->returnVal = 
     foo(_foo01Msg->junk, _foo01Msg->blah, &_foo01Msg->junkOut);

  *reply = _foo01Msg;
  *nReplyBytes = sizeof(TempControl::Foo01Msg);
  return True;
}


Boolean TempControl_SK::actualCallback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  _actualMsg->returnVal = 
     actual(_actualMsg->index, &_actualMsg->mdata, &_actualMsg->tdata);

  *reply = _actualMsg;
  *nReplyBytes = sizeof(TempControl::ActualMsg);
  return True;
}


Boolean TempControl_SK::func2Callback(Request *request, int nReqBytes,
                          Reply **reply, int *nReplyBytes)
{
  // Invoke method implementation
  func2(_func2Msg->value, &_func2Msg->flag);

  *reply = _func2Msg;
  *nReplyBytes = sizeof(TempControl::Func2Msg);
  return True;
}


int TempControl_SK::init()
{
  // Add callbacks for each method
  addCallback(TempControl::EatMyMsgCode,
             (CallbackPtr )TempControl_SK::eatMyCallback);

  addCallback(TempControl::SetpointMsgCode,
             (CallbackPtr )TempControl_SK::setpointCallback);

  addCallback(TempControl::FooMsgCode,
             (CallbackPtr )TempControl_SK::fooCallback);

  addCallback(TempControl::Foo01MsgCode,
             (CallbackPtr )TempControl_SK::foo01Callback);

  addCallback(TempControl::ActualMsgCode,
             (CallbackPtr )TempControl_SK::actualCallback);

  addCallback(TempControl::Func2MsgCode,
             (CallbackPtr )TempControl_SK::func2Callback);

}


size_t TempControl_SK::maxRequestBytes()
{
  size_t nBytes = 0;
  nBytes = max(nBytes, sizeof(TempControl::EatMyMsg));
  nBytes = max(nBytes, sizeof(TempControl::SetpointMsg));
  nBytes = max(nBytes, sizeof(TempControl::FooMsg));
  nBytes = max(nBytes, sizeof(TempControl::Foo01Msg));
  nBytes = max(nBytes, sizeof(TempControl::ActualMsg));
  nBytes = max(nBytes, sizeof(TempControl::Func2Msg));
  return nBytes;
}


void TempControl_SK::allocateBuffers()
{
  TaskServer::allocateBuffers();

  _eatMyMsg = (TempControl::EatMyMsg *)_requestPtr;
  _setpointMsg = (TempControl::SetpointMsg *)_requestPtr;
  _fooMsg = (TempControl::FooMsg *)_requestPtr;
  _foo01Msg = (TempControl::Foo01Msg *)_requestPtr;
  _actualMsg = (TempControl::ActualMsg *)_requestPtr;
  _func2Msg = (TempControl::Func2Msg *)_requestPtr;
}


