TEXTUAL-CONVENTION

Frank Fock Frank.Fock____t-online.de
Sat May 17 13:26:14 CEST 2003


Hello Zheng,

Since most textual conventions are only restricting
the corresponding base type, it is in most cases
not recommended to define a base class for that.
However in some cases it might be useful. You can
then use the "leafSuperClass" property to define
a different super class for your leaf.
The implementation of that super class has to be
done by the user then.

Best regards,
Frank

Zheng Qiang wrote:
> Hello Frank,
>  
> We define a textual-convention in our mib -- "ObjectName"
> But the code generated via AgenPro2 cannot make the correct inheritance.
> The leaf is inherited from "MibLeaf", instead of "ObjectName" we expected>  
>   ObjectName ::= TEXTUAL-CONVENTION
>    DISPLAY-HINT
>     "1d-1d-1d"
>    STATUS current
>    DESCRIPTION
>     "...Some desc..."
>    SYNTAX OCTET STRING (SIZE (3))
>  
> I check out the template file, how shall we modify it?
>  
> <h_code.vm>
> ##
> ## genSuperClassName
> ##
> #macro( genSuperClassName $leaf )
> #if ( $agenUtils.isRowStatus($leaf) )
> #if ( $agenUtils.isDefined($leaf.getPrintableOid(), "simulation") )
> SimRowStatus
> #else
> snmpRowStatus
> #end
> #elseif ( $agenUtils.isDisplayString($leaf) )
> SnmpDisplayString
> #elseif ( $agenUtils.isStorageType($leaf) )
> StorageType
> #elseif ( $agenUtils.isDefined($leaf.getPrintableOid(), "simulation") )
> SimMibLeaf
> #elseif ( $agenUtils.isDateAndTime($leaf) )
> DateAndTime
> #else
> #if ($agenUtils.hasProperty($leaf.printableOid, "leafSuperClass"))
> $agenUtils.getProperty($leaf.printableOid, "leafSuperClass")
> #else
> MibLeaf
>  
> Best regards.
>  







More information about the AGENTPP mailing list