TOC PREV NEXT INDEX


Object Identifier Value Specification



Object identifier values are somewhat different in that they result in a structure being populated in the C or C++ source file.

    ASN.1 production:   <name> OBJECT IDENTIFIER ::= <value>
 

 
    Generated code:   ASN1OBJID <name> = <value>;
 


For example, consider the following declaration:

oid OBJECT IDENTIFIER ::= { ccitt b(5) 10 }
 

This would result in the following definition in the C or C++ source file:

ASN1OBJID oid = {
 
   3,
 
   { 0, 5, 10 }
 
} ;
 

To populate a variable in a generated structure with this value, the rtSetOID utility function can be used (see the C/C++ Run-Time Library Reference Manual for a full description of this function). In addition, the C++ base type for this construct (ASN1TObjId) contains constructors and assignment operators that allow direct assignment of values in this from to the target variable.

The professional version of the ASN1C compiler will generate code for following remaining value definitions.

NOTE:
SEQUENCE, SET , SEQUENCE Of, SET Of and CHOICE values are available only when the -tables option is selected. The values are initialized in a module value initialization function. The format of this function name is as follows:
 
init_<ModuleName>Value (OSCTXT* pctxt)
 
Where <ModuleName> would be replaced with the name of the module containing the value specifications.
 
The only required argument is an initialized context block structure used to hold dynamic memory allocated in the creation of the value structures.
 
If the value definitions are used in table constraint definitions, then the generated table constraint processing code will handle the initialization of these definitions; otherwise, the initialization function must be called explicitly.
 



Objective Systems, Inc.

55 Dowlin Forge Road
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX