class TemplCommand : public Command

This class is a class representing a command in the template command model without input or output parameter

Inheritance:


Public

Constructors
TemplCommand()
Constructs a newly allocated Command object
TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)())
Constructs a newly allocated TemplCommand object for a command with a name and an execution method
TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)())
Constructs a newly allocated TemplCommand object for a command with a name and an execution method
TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &))
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method
TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &))
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method
TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), const char *in_desc, const char *out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters
TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), string &in_desc, string &out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters
TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc, const char *out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters
TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc, string &out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters
Destructor
~TemplCommand()
The device desctructor
Miscellaneous methods
void set_type(const type_info &data_type, Tango::CmdArgType &type)
Choose the correct TANGO data type constant according to data type The TANGO constant is determined using the type_info object passed as first argument of the method
CORBA::Any* execute(DeviceImpl *dev, const CORBA::Any &in_any)
Invoke the command execution method given at object creation time
bool is_allowed(DeviceImpl *dev, const CORBA::Any &in_any)
Invoke the command allowed method given at object creation time

Protected

Class data members
bool (DeviceImpl::*allowed_ptr)(const CORBA::Any &)
The command allowed method object reference

Documentation

This class is a class representing a command in the template command model without input or output parameter
Constructors
Miscellaneous constructors

TemplCommand()
Constructs a newly allocated Command object. The default constructor

TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)())
Constructs a newly allocated TemplCommand object for a command with a name and an execution method. This constructor set the command input and output type to Tango::DEV_VOID. The input and output parameter description are set to the default String "Uninitialised".
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method

TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)())
Constructs a newly allocated TemplCommand object for a command with a name and an execution method. This constructor set the command input and output type to Tango::DEV_VOID. The input and output parameter description are set to the default String "Uninitialised".
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method

TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &))
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method. This constructor set the command input and output type to Tango::DEV_VOID The input and output parameter description are set to the default String "Uninitialised".
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
state_method - Pointer to the command allowed method

TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &))
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method. This constructor set the command input and output type to Tango::DEV_VOID The input and output parameter description are set to the default String "Uninitialised".
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
state_method - Pointer to the command allowed method

TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), const char *in_desc, const char *out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
in_desc - The command input parameter description
out_desc - The command output parameter description

TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), string &in_desc, string &out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
in_desc - The command input parameter description
out_desc - The command output parameter description

TemplCommand(const char *cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), const char *in_desc, const char *out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters. This constructor set the command input and output type to Tango::DEV_VOID
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
state_method - Pointer to the command allowed method
in_desc - The command input parameter description
out_desc - The command output parameter description

TemplCommand(string &cmd_name, void (DeviceImpl::*exe_method)(), bool (DeviceImpl::*state_method)(const CORBA::Any &), string &in_desc, string &out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters. This constructor set the command input and output type to Tango::DEV_VOID
Parameters:
cmd_name - The command name
exe_method - Pointer to the command execution method
state_method - Pointer to the command allowed method
in_desc - The command input parameter description
out_desc - The command output parameter description

Destructor
Only one desctructor is defined for this class

~TemplCommand()
The device desctructor

Miscellaneous methods

void set_type(const type_info &data_type, Tango::CmdArgType &type)
Choose the correct TANGO data type constant according to data type The TANGO constant is determined using the type_info object passed as first argument of the method. This data is compared to each defined Tango type.
Throws:
DevFailed If the type is not a Tango data type Click here to read DevFailed exception specification
Parameters:
data_type - The type to be analysed
type - A reference where Tango data type constant must be stored

CORBA::Any* execute(DeviceImpl *dev, const CORBA::Any &in_any)
Invoke the command execution method given at object creation time. This method is automatically called by the TANGO core classes when the associated command is requested by a client.
Throws:
DevFailed If the execution method failed Click here to read DevFailed exception specification
Returns:
The CORBA Any object returned to the client. For command created with this TemplCommand class, this any object does not contain data.
Parameters:
dev - The device on which the command must be executed
in_any - The incoming data still packed in a CORBA Any object. For command created with this TemplCommand class, this Any object does not contain usefull data

bool is_allowed(DeviceImpl *dev, const CORBA::Any &in_any)
Invoke the command allowed method given at object creation time. This method is automtically called by the TANGO core classes when the associated command is requested by a client to check if the command is allowed in the actual device state. If the user give a command allowed method at object creation time, this method will be invoked.
Returns:
A boolean set to true is the command is allowed. Otherwise, the return value is false. This return value is always set to true if the user does not supply a method to be excuted. If a method has been supplied, the return value is the value returned by the user supplied mehod.
Parameters:
dev - The device on which the command must be executed
in_any - The incoming data still packed in a CORBA Any object. For command created with this TemplCommand class, this Any object does not contain data

Class data members

bool (DeviceImpl::*allowed_ptr)(const CORBA::Any &)
The command allowed method object reference


Direct child classes:
TemplCommandOut
TemplCommandInOut
TemplCommandIn
Author:
$Author: taurel $
Version:
$Revision: 1.3 $

alphabetic index hierarchy of classes


generated by doc++