This is the abstract class to overload to create new backend tools. More...
#include <cbackend.h>
Public Member Functions | |
virtual char * | GetToolName (void)=0 |
map of switch to its description | |
virtual char * | GetToolDescription (void)=0 |
Access method for tool description use in vrq help. | |
virtual int | AcceptAllPlusArgs (void) |
Override this method if the plugin accepts arbitrary plusargs: ie +argName[=argValue] or +argName[+argValue]. | |
virtual list< string > & | GetSwitches (void) |
Access method for list of switches. | |
virtual const char * | GetSwitchDescription (const char *sw) |
Method to get the help text for a switch using the switch name as a key. | |
virtual void | RegisterSwitch (const char *switchName, const char *description) |
Method shortcut to register tool switches with vrq's help system. | |
virtual int | ResolveModules ()=0 |
Method to control if plugin requires all module definitions to be searched for and found. | |
virtual int | ResolveInstance (CModule *module, CInstance *inst)=0 |
Method to control the resolution of individual module instances. | |
virtual int | HideTool () |
Method to control if plugin should be hidden, in this case it will not appear in the help but will it still be possible to invoke it. | |
virtual int | IgnoreVrqComments () |
Method to control how parser handles vrq comment based pragmas: ie // vrq translate_on/off Note: the default behavior is to not ignore vrq comment based pragmas. | |
virtual void | Activate ()=0 |
Method to initialize the plugin. | |
virtual void | Process (list< CElement > &inputList, list< CElement > &outputList)=0 |
Method to implement plugin function. | |
Protected Attributes | |
list< string > | switches |
map< string, string > | switchDescription |
list of plugin command line switches |
This is the abstract class to overload to create new backend tools.
Each tool should create a subclass of this and either add it to the toolList in main.cc or compile it as a standalone DLL and place it in a plugin directory.
This class and its methods will fully integrate the plugin in to vrq. Note not all methods are abstract. For methods where reasonable defaults make sense, a default implementation is defined. If a different behavior is desired the subclass should override the default virtual method.
Note: Plugins should directly store information about the switches they support in the protected instance variables: switches and switchDescription.
virtual int CBackend::AcceptAllPlusArgs | ( | void | ) | [inline, virtual] |
Override this method if the plugin accepts arbitrary plusargs: ie +argName[=argValue] or +argName[+argValue].
virtual void CBackend::Activate | ( | ) | [pure virtual] |
Method to initialize the plugin.
This method will be called once before tool is invoked.
virtual const char* CBackend::GetSwitchDescription | ( | const char * | sw | ) | [inline, virtual] |
Method to get the help text for a switch using the switch name as a key.
Generally this method need not be overriden.
sw | pointer to switch. |
virtual list<string>& CBackend::GetSwitches | ( | void | ) | [inline, virtual] |
Access method for list of switches.
Generally this method need not be overridden.
virtual char* CBackend::GetToolDescription | ( | void | ) | [pure virtual] |
Access method for tool description use in vrq help.
virtual char* CBackend::GetToolName | ( | void | ) | [pure virtual] |
map of switch to its description
Access method for tool name
virtual int CBackend::HideTool | ( | ) | [inline, virtual] |
Method to control if plugin should be hidden, in this case it will not appear in the help but will it still be possible to invoke it.
This is useful for development of plugins that care currently unstable. Note: the default behavior is to make the plugin visible.
virtual int CBackend::IgnoreVrqComments | ( | ) | [inline, virtual] |
Method to control how parser handles vrq comment based pragmas: ie // vrq translate_on/off Note: the default behavior is to not ignore vrq comment based pragmas.
virtual void CBackend::Process | ( | list< CElement > & | inputList, | |
list< CElement > & | outputList | |||
) | [pure virtual] |
Method to implement plugin function.
Input list is processed and output list is generated. Dimensions of input list must be > 0. Dimensions of output list must be >= 0. Input and output list dimensions need not match. This method may terminate processing early by throwing an exception that is a subclass of CBackendException. Note throwing an exeception and exiting normally is equivilent to throwing a CBackendExit.
inputList | a list of compilation units to process. | |
outputList | a list of compilation units processed. |
virtual void CBackend::RegisterSwitch | ( | const char * | switchName, | |
const char * | description | |||
) | [inline, virtual] |
Method shortcut to register tool switches with vrq's help system.
switchName | switch string | |
description | switch description used for help text. |
Method to control the resolution of individual module instances.
module | to the module that contains the instance. | |
inst | pointer to the instance to be resolved. |
virtual int CBackend::ResolveModules | ( | ) | [pure virtual] |
Method to control if plugin requires all module definitions to be searched for and found.
returns true if tool requires all module definitions to be resolved.
map<string,string> CBackend::switchDescription [protected] |
list of plugin command line switches
list<string> CBackend::switches [protected] |