[AGENT++] Asn1 class hierarchy and smival

Apostolos Manolitzas manap at intracom-telecom.com
Mon Mar 27 10:43:40 CEST 2017


On 03/23/2017 05:40 PM, Jochen Katz wrote:
> Hello,
>
>> one question design oriented. Why the smival is included in the abstract
>> interface of SnmpSyntax?
> because Jeff Meyer designed it that way and nobody changed it until now ;-)
>
>> Unless I am missing something,  the smival can
>> be propagated into the child classes, based on the needs without
>> breaking the design which is covered by the abstract interface. The
>> problem rises from the size of to the produced classes/objects which
>> inherit the smival while it's not used.
> Are there any classes that inherit from SnmpSyntax that do not use
> smival to store the value?
Exactly, but in many cases this struct is redundant in terms of size
i.e. the SnmpInt32 it uses only a 4/8btype size instead of 12/24bytes
which is the size of the smival.


>
>> For example
>>
>>  SnmpSyntax::get_syntax() =0
>>
>> provides the syntax of the type, why it should be carried around in
>> smival too?
> The smival is passed to other functions and these no longer have access
> to the SnmpSyntax subclass, but need to know the syntax.
Is it possible to identify those functions, because I was looking for
such cases.


> Regards,
>   Jochen
>
>

Best Regards,

-Apostolos




More information about the AGENTPP mailing list