POGO Java Program


pogo.gene
Class PogoGeneCpp

java.lang.Object
  |
  +--pogo.gene.PogoGene
        |
        +--pogo.gene.PogoGeneCpp

public class PogoGeneCpp
extends PogoGene
implements PogoDefs, TangoDs.TangoConst

This class generates Cpp source file.

Version:
$Revision: 1.22 $
Author:
$Author: verdier $

Fields inherited from class pogo.gene.PogoGene
pogo, sbTrace
 
Fields inherited from interface pogo.gene.PogoDefs
ALREADY_OVERRIDING, ATTR_IMAGE, ATTR_READ, ATTR_READ_WITH_WRITE, ATTR_READ_WRITE, ATTR_SCALAR, ATTR_SPECTRUM, ATTR_WRITE, AttrDataArray, AttrRWtypeArray, AttrTypeArray, authorRes, classDescRes, cppAddAttrib, cppAddCommands, cppExtention, cppFile, cppLang, dataCommands, dataExtention, dataFile, dataStartCmd, dataStartStates, endGeneTag, errDetected, javaAddAttrib, javaAddCommands, javaExtention, javaFile, javaLang, languageRes, NEW_STR, NOT_OVERRIDE, outputFiles, OVERRIDE, pageTitleRes, pogoLang, projectTitleRes, readAttrProto1, readAttrProto2, readAttrProto3, readFile, revisionRes, startGeneTag, STATE, statesDescRes, STATUS, Tango_ALARM, Tango_CLOSE, Tango_CONST_DEV_STRING, Tango_DISABLE, Tango_EXTRACT, Tango_FAULT, Tango_INSERT, Tango_MOVING, Tango_OFF, Tango_ON, Tango_OPEN, Tango_RUNNING, Tango_STANDBY, Tango_TYPE_UNKNOWN, Tango_UNKNOWN, Tango_WARMUP, TangoStatesArray, templateBlock, templateClass, templateClassCmd, templateCmd, templateExecuteCmd, templateFile, writeAttrProto, writeFile
 
Fields inherited from interface TangoDs.TangoConst
Attr_Description, Attr_Name, Attr_State, Attr_Status, Attr_Unknown, Op_BlackBox, Op_Command, Op_Command_inout, Op_Command_list, Op_Get_Attr_Config, Op_Info, Op_Ping, Op_Read_Attr, Op_Set_Attr_Config, Op_Unknown, Op_Write_Attr, Req_Attribute, Req_Operation, Req_Unknown, Tango_AllAttr, Tango_AlrmValueNotSpec, Tango_AssocWritNotSpec, Tango_CmdArgTypeName, Tango_DbErr_DeviceNotDefined, Tango_DbObjName, Tango_DefaultBlackBoxDepth, Tango_DefaultDocUrl, Tango_DefaultWritableProp, Tango_DescNotSet, Tango_DEV_BOOLEAN, Tango_DEV_DOUBLE, Tango_DEV_FLOAT, Tango_DEV_LONG, Tango_DEV_SHORT, Tango_DEV_STATE, Tango_DEV_STRING, Tango_DEV_ULONG, Tango_DEV_USHORT, Tango_DEV_VOID, Tango_DevErr_AttrMandatoryProp, Tango_DevErr_AttrNoAlarm, Tango_DevErr_AttrNotFound, Tango_DevErr_AttrNotWritable, Tango_DevErr_AttrOptProp, Tango_DevErr_AttrValueNotSet, Tango_DevErr_BlackBoxArgument, Tango_DevErr_BlackBoxEmpty, Tango_DevErr_CannotOpenFile, Tango_DevErr_CantInstallSignal, Tango_DevErr_CantRetrieveClassList, Tango_DevErr_ClassNotFound, Tango_DevErr_CmdArgumentTypeNotSupported, Tango_DevErr_CommandNotAllowed, Tango_DevErr_CommandNotFound, Tango_DevErr_DeviceNotFound, Tango_DevErr_IncompatibleAttrDataType, Tango_DevErr_IncompatibleCmdArgumentType, Tango_DevErr_InitMethodNotFound, Tango_DevErr_InitNotPublic, Tango_DevErr_InitThrowsException, Tango_DevErr_JavaRuntimeSecurityException, Tango_DevErr_MemoryAllocation, Tango_DevErr_MethodArgument, Tango_DevErr_MethodNotFound, Tango_DevErr_OverloadingNotSupported, Tango_DevErr_SignalOutOfRange, Tango_DevErr_WAttrOutsideLimit, Tango_DevStateName, Tango_DEVVAR_CHARARRAY, Tango_DEVVAR_DOUBLEARRAY, Tango_DEVVAR_DOUBLESTRINGARRAY, Tango_DEVVAR_FLOATARRAY, Tango_DEVVAR_LONGARRAY, Tango_DEVVAR_LONGSTRINGARRAY, Tango_DEVVAR_SHORTARRAY, Tango_DEVVAR_STRINGARRAY, Tango_DEVVAR_ULONGARRAY, Tango_DEVVAR_USHORTARRAY, Tango_DevVersion, Tango_DSDeviceDomain, Tango_InitialOutput, Tango_MaxServerNameLength, Tango_ResNotDefined, Tango_SysProperty
 
Constructor Summary
PogoGeneCpp(PogoClass pogo)
          Constructor for Pogo Class Cpp files generation.
 
Method Summary
protected  void addAttributesMethod(java.lang.String f_in, java.lang.String f_out)
          Build the attributes methods (read_attr_hardware, read_attr and read_attr_hardware) for server file.
protected  void addCmdClassDefs(java.lang.String f_in, java.lang.String f_out)
          Add in the out File, the definition of the class where the commands are really executed.
protected  void addMethodsToExecuteCmd(java.lang.String f_in, java.lang.String f_out)
          Add the methods where the commands are really executed.
protected  void addPrototypes(java.lang.String f_in, java.lang.String f_out)
          Add in the out File, the prototype for the methods where the commands are really executed.
protected  void buildFactories(java.lang.String f_in, java.lang.String f_out)
          Add the class methods where the commands are really executed.
protected  void createCmdClass(java.lang.String f_in, java.lang.String f_out)
          Create the class methods where the commands are really executed.
 void geneSrc()
          Generate C++ source for tango device Server from Pogo Class definition
protected  java.lang.String getCmdBlockFromTemplate(int num)
          Search the Cmd template block.
protected  java.lang.String insertNewCmdClass(Cmd cmd, PogoString pgs)
          Insert new cmd class in str
protected  void writeIsAllowedMethods(java.lang.String f_in, java.lang.String f_out)
          Write the ::is_allowed methods to target file.
 
Methods inherited from class pogo.gene.PogoGene
addCommentsCmdMethod, buildAttributesMethods, buildReadMeFile, changeExeMethodArgs, checkForExecMethodModif, copyFile, getTrace, mustGenerate, readAttributeTemplate, replacePatternFile, setMethodInComments, setProjectTitle
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

PogoGeneCpp

public PogoGeneCpp(PogoClass pogo)
Constructor for Pogo Class Cpp files generation.
Parameters:
pogo - Pogo Class definition used for generation.
Method Detail

addPrototypes

protected void addPrototypes(java.lang.String f_in,
                             java.lang.String f_out)
                      throws java.io.IOException,
                             PogoException
Add in the out File, the prototype for the methods where the commands are really executed.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file.

addCmdClassDefs

protected void addCmdClassDefs(java.lang.String f_in,
                               java.lang.String f_out)
                        throws java.io.IOException,
                               PogoException
Add in the out File, the definition of the class where the commands are really executed.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

insertNewCmdClass

protected java.lang.String insertNewCmdClass(Cmd cmd,
                                             PogoString pgs)
                                      throws java.io.IOException,
                                             PogoException
Insert new cmd class in str
Parameters:
cmd - Command concerned.
pgs - String where this class must be inserted.
Returns:
String where the class has been inserted.
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

getCmdBlockFromTemplate

protected java.lang.String getCmdBlockFromTemplate(int num)
                                            throws java.io.IOException,
                                                   PogoException
Search the Cmd template block.
Parameters:
Num - Block number
Returns:
The Cmd template block
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

buildFactories

protected void buildFactories(java.lang.String f_in,
                              java.lang.String f_out)
                       throws java.io.IOException,
                              PogoException
Add the class methods where the commands are really executed.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

createCmdClass

protected void createCmdClass(java.lang.String f_in,
                              java.lang.String f_out)
                       throws java.io.IOException,
                              PogoException
Create the class methods where the commands are really executed.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

addMethodsToExecuteCmd

protected void addMethodsToExecuteCmd(java.lang.String f_in,
                                      java.lang.String f_out)
                               throws java.io.IOException,
                                      PogoException
Add the methods where the commands are really executed.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.IOException -  
PogoException - If a synthax error occured on input file

writeIsAllowedMethods

protected void writeIsAllowedMethods(java.lang.String f_in,
                                     java.lang.String f_out)
                              throws java.io.IOException,
                                     PogoException
Write the ::is_allowed methods to target file.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.FileNotFoundException -  
java.lang.SecurityException -  
java.io.IOException -  
PogoException - If a synthax error occured on input file

addAttributesMethod

protected void addAttributesMethod(java.lang.String f_in,
                                   java.lang.String f_out)
                            throws java.io.IOException,
                                   PogoException
Build the attributes methods (read_attr_hardware, read_attr and read_attr_hardware) for server file.
Parameters:
f_in - Input File's name
f_out - Output File's name
Throws:
java.io.FileNotFoundException -  
java.lang.SecurityException -  
java.io.IOException -  
PogoException - If a synthax error occured on input file

geneSrc

public void geneSrc()
             throws java.io.FileNotFoundException,
                    java.lang.SecurityException,
                    java.io.IOException,
                    PogoException
Generate C++ source for tango device Server from Pogo Class definition
Throws:
java.io.FileNotFoundException -  
java.lang.SecurityException -  
java.io.IOException -  
PogoException - If a synthax error occured on input file

POGO Java Program