1    /*
     2     *  ======== StateReader.xdc ========
     3     */
     4    
     5    package xdc.rov;
     6    
     7    import xdc.rov.Program;
     8    
     9    /*!
    10     *  ======== StateReader ========
    11     *  These APIs are all designed so that they will not re-read data that has already been read in.
    12     *
    13     *  The StateReader has three similar APIs for reading instance state:
    14     *    fetchInstState 
    15     *    fetchHandleState
    16     *    getInstDesc
    17     *
    18     *  fetchInstState takes an instance address and its index into the array of
    19     *  static instances (or -1 if dynamic). This is called by fetchAllInstStates,
    20     *  knows the index because it's iterating over the list.
    21     *
    22     *  fetchHandleState just takes an instance address. It looks through the list
    23     *  of instances to determine the index, then calls down to fetchInstState.
    24     *  This API is called by Program.scanHandle.
    25     *
    26     *  getInstDesc takes a decoded instance state structure and the index. Both
    27     *  fetch functions ultimately call down to this API. It is also called
    28     *  directly by Program.scanObject for scanning embedded objects.
    29     */
    30    metaonly module StateReader
    31    {
    32    
    33    instance:
    34    
    35        /*!
    36         *  ======== create ========
    37         */
    38        create(ISymbolTable.Instance symTable, StructureDecoder.Instance strDec);
    39         
    40        /*! 
    41         *  ======== fetchModuleState ========
    42         *  Scans the given module's module state structure. If the structure has 
    43         *  already been scanned, this function returns immediately.
    44         */
    45        Void fetchModuleState(Program.ROVModuleDesc *mod);
    46    
    47        /*! 
    48         *  ======== fetchAllInstStates ========
    49         *  This function makes sure that all of the instance state structures for
    50         *  this module have been scanned in. It does not call any view$init
    51         *  functions.
    52         */
    53        Void fetchAllInstStates(Program.ROVModuleDesc *mod);
    54    
    55        /*! 
    56         *  ======== fetchInstState ========
    57         *  This function scans in a single instance's state, and associates
    58         *  various metadata (used by the view$init functions) with the instance
    59         *  object.
    60         *  Returns the inst object for Program.scanHandle.
    61         */
    62        Program.ROVInstanceDesc *fetchInstState(Program.ROVModuleDesc *mod,
    63            Long instAddr, Int staticIndex);
    64    
    65        /*!
    66         *  ======== fetchHandleState ========
    67         *  The fetchInstState API needs to know whether the given instance
    68         *  is static or dynamic. If we just have a handle to an instance, we first
    69         *  need to determine whether it is static or dynamic.
    70         */
    71        Program.ROVInstanceDesc *fetchHandleState(Program.ROVModuleDesc *mod,
    72            Long instAddr);
    73        
    74        /*!
    75         *  ======== getInstDesc ========
    76         *  Takes a decoded state structure and creates an Program.ROVInstanceDesc
    77         *  for it. Also retrieves the label for the instance.
    78         */
    79        Program.ROVInstanceDesc *getInstDesc(Program.ROVModuleDesc *mod, Any obj,
    80            Int staticIndex);
    81    
    82    }
    83    /*
    84     *  @(#) xdc.rov; 1, 0, 1,0; 2-20-2019 10:22:32; /db/ztree/library/trees/xdc/xdc-F09/src/packages/
    85     */
    86