European
Southern
Observatory

ESO — Reaching New Heights in Astronomy

Countries taking part in the ESO

VLT Software Documentation

tcsSELF_CMD Class Reference

See man page tcsSELF_CMD(4)
More...

#include <tcsSELF_CMD.h>

Collaboration diagram for tcsSELF_CMD:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tcsSELF_CMD ()
 ~tcsSELF_CMD ()
ccsCOMPL_STAT SetCmdHandler (tcsCMD_HANDLER *handler, const char *description="")
ccsCOMPL_STAT SetReplyHandler (evhCALLBACK &cb)
ccsCOMPL_STAT SetErrorHandler (evhCALLBACK &cb)
ccsCOMPL_STAT Send (const msgCMD cmdName, const char *format,...)
ccsCOMPL_STAT Reset ()
const char * Command () const
vltLOGICAL IsActive ()

Protected Member Functions

evhCB_COMPL_STAT ReplyCB (msgMESSAGE &msg, void *)
evhCB_COMPL_STAT ErrorCB (msgMESSAGE &msg, void *)

Private Attributes

fndSTRING description
tcsCMD_HANDLERcmdHandler
evhCALLBACK * userReplyCB
evhCALLBACK * userErrorCB

Detailed Description

See man page tcsSELF_CMD(4)
Manpage of tcsSELF_CMD

tcsSELF_CMD

Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:08
Index Return to man pages list
 

NAME

tcsSELF_CMD - send command to own process

 

SYNOPSIS


#include <tcsSELF_CMD.h>
tcsSELF_CMD selfCmd();

 

PARENT CLASS


evhCOMMAND

 

DESCRIPTION


In complex modules it is often the case that there are low level commands,
providing some basic functionality and high level commands, executing by
using sequences of low level commands. One way to implement this is to let
high level command handlers send low level commands to the own process.

This class provides an easy way to send a command to the own process and
handle the replies.

The self-command may complete whith either a normal reply or an error
reply. A timeout makes no sense for a self-command, because the low level
command already has one and returns an error reply on expiration.

The class offers two ways how to process the replies to the self-command:
1. The user specifies a callback which shall be invoked.
2. The user provides a command handler thru which the class sends a default
   reply. This is for the case where the only action of the self-command
   reply handler is to send a reply to its (high level command) originator.
   The default reply is tcsOK_MSG for a normal reply to a self-command and
   an tcsERR_SEND_COMMAND for an error reply to a self-command.

 

PUBLIC METHODS


tcsSELF_CMD();
~tcsSELF_CMD();
ccsCOMPL_STAT SetCmdHandler(tcsCMD_HANDLER *handler, const char * description);
    Specify a command handler which shall be used to send default replies
    if no user reply callbacks are installed. On sending an error reply the
    given description is built into the error message to describe what
    failed.

ccsCOMPL_STAT SetReplyHandler(evhCALLBACK &cd);
ccsCOMPL_STAT SetErrorHandler(evhCALLBACK &cd);
    Defines the user installable callbacks to be
    run when the normal or error replies for self
    commands are received.

void Send(const msgCMD cmdName, const char *format, ...);
    Build a parameter buffer from the given format and parameters (like in
    printf) and send it with the given command to the own process.

ccsCOMPL_STAT Reset();
    Resets the command if it is active by de-installing the reply handlers,
    i.e. replies to that command are simply ignored. After that the object
    is ready to send a new command.

vltLOGICAL IsActive();
    Returns ccsTRUE if a command is currently active, i.e. replies are
    pending.
const char *Command() const;
   Access method to get the command name

 

PROTECTED METHODS


evhCB_COMPL_STAT ReplyCB(msgMESSAGE &msg, void *);
evhCB_COMPL_STAT ErrorCB(msgMESSAGE &msg, void *);
    Handlers for normal and error replies to the self-command. If user
    reply callbacks are installed they are invoked by these handlers,
    otherwise a normal or error reply is passed on to the given command
    handler.

 

PRIVATE DATA MEMBERS


fndSTRING         description; // description of purpose for error logging
tcsCMD_HANDLER *cmdHandler;  // command handler to be used for replies
evhCALLBACK      *userReplyCB; // user's reply handler
evhCALLBACK      *userErrorCB; // user's error reply handler

 

SEE ALSO


evhCOMMAND


 

Index

NAME
SYNOPSIS
PARENT CLASS
DESCRIPTION
PUBLIC METHODS
PROTECTED METHODS
PRIVATE DATA MEMBERS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 10:08:47 GMT, April 23, 2012

Definition at line 30 of file tcsSELF_CMD.h.


Constructor & Destructor Documentation

tcsSELF_CMD::tcsSELF_CMD (  ) 
tcsSELF_CMD::~tcsSELF_CMD (  ) 

Definition at line 125 of file tcsSELF_CMD.C.

References DELETE_OBJECT, Reset(), userErrorCB, and userReplyCB.


Member Function Documentation

const char * tcsSELF_CMD::Command (  )  const

Definition at line 226 of file tcsSELF_CMD.C.

Referenced by Send().

evhCB_COMPL_STAT tcsSELF_CMD::ErrorCB ( msgMESSAGE &  msg,
void *   
) [protected]
vltLOGICAL tcsSELF_CMD::IsActive (  ) 

Definition at line 221 of file tcsSELF_CMD.C.

Referenced by Send(), SetCmdHandler(), SetErrorHandler(), and SetReplyHandler().

evhCB_COMPL_STAT tcsSELF_CMD::ReplyCB ( msgMESSAGE &  msg,
void *   
) [protected]

Definition at line 277 of file tcsSELF_CMD.C.

References cmdHandler, tcsCMD_HANDLER_T< StatePolicy >::SendReply(), tcsOK_MSG, and userReplyCB.

Referenced by tcsTCS_RCSID().

ccsCOMPL_STAT tcsSELF_CMD::Reset (  ) 

Definition at line 214 of file tcsSELF_CMD.C.

Referenced by ~tcsSELF_CMD().

ccsCOMPL_STAT tcsSELF_CMD::Send ( const msgCMD  cmdName,
const char *  format,
  ... 
)

Definition at line 233 of file tcsSELF_CMD.C.

References Command(), IsActive(), tcsERR_BUG, tcsERR_BUSY, tcsMOD, and tcsPRINTF_BUFFER_SIZE.

ccsCOMPL_STAT tcsSELF_CMD::SetCmdHandler ( tcsCMD_HANDLER handler,
const char *  description = "" 
)

Definition at line 134 of file tcsSELF_CMD.C.

References cmdHandler, description, IsActive(), tcsERR_BUG, and tcsMOD.

ccsCOMPL_STAT tcsSELF_CMD::SetErrorHandler ( evhCALLBACK &  cb  ) 

Definition at line 183 of file tcsSELF_CMD.C.

References IsActive(), tcsERR_BUG, tcsMOD, and userErrorCB.

ccsCOMPL_STAT tcsSELF_CMD::SetReplyHandler ( evhCALLBACK &  cb  ) 

Definition at line 151 of file tcsSELF_CMD.C.

References IsActive(), tcsERR_BUG, tcsMOD, and userReplyCB.


Member Data Documentation

Definition at line 49 of file tcsSELF_CMD.h.

Referenced by ErrorCB(), ReplyCB(), and SetCmdHandler().

fndSTRING tcsSELF_CMD::description [private]

Definition at line 48 of file tcsSELF_CMD.h.

Referenced by ErrorCB(), and SetCmdHandler().

evhCALLBACK* tcsSELF_CMD::userErrorCB [private]

Definition at line 51 of file tcsSELF_CMD.h.

Referenced by ErrorCB(), SetErrorHandler(), and ~tcsSELF_CMD().

evhCALLBACK* tcsSELF_CMD::userReplyCB [private]

Definition at line 50 of file tcsSELF_CMD.h.

Referenced by ReplyCB(), SetReplyHandler(), and ~tcsSELF_CMD().


The documentation for this class was generated from the following files:
Generated on Mon Apr 23 10:12:45 2012 for INTROOT API by doxygen 1.6.3