trkwsSELF_CMD

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

NAME

trkwsSELF_CMD - send command to own process

 

SYNOPSIS


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

 

PARENT CLASS


evhSIMPLE_TASK (just to get eccsERROR_CLASS and fndOBJECT)

 

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 one way how to process the replies to the self-command:
1. The user specifies a callback which shall be invoked.

 

PUBLIC METHODS


trkwsSELF_CMD();
~trkwsSELF_CMD();

void Send(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.

void 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.

 

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


evhCOMMAND        command;     // command which sent internally
fndSTRING         description; // description of purpose for error logging
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:11:26 GMT, April 23, 2012