1    /* 
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * */
    12    /*
    13     *  ======== ViewInfo ========
    14     */
    15    package xdc.rov
    16    
    17    /*!
    18     *  ======== ViewInfo ========
    19     *  Describes the ROV views supported by a particular module.
    20     */
    21    @Facet metaonly module ViewInfo
    22    {
    23        /*
    24         *  ======== Arg ========
    25         *  Descriptor for a user-supplied argument passed to an ROV view
    26         */
    27        metaonly struct Arg {
    28            String name;         /*! the name displayed to the user */
    29            String type;         /*! the type of this argument:
    30                                  *      "string", "number", "boolean"
    31                                  */
    32            String defaultValue; /*! the default value of this argument */
    33        }
    34    
    35        /*
    36         *  ======== Args ========
    37         *  Descriptor for a set of user-supplied arguments to an ROV view
    38         *
    39         *  This structure describes a set of user-supplied arguments for a
    40         *  module view.
    41         *
    42         *  These arguments are module-specific but multiple view descriptors
    43         *  within a module can reference a common `Args` strucure.  These
    44         *  arguments allow the user to affect the output of a specific view
    45         *  and enable the view implementor to keep the set of distinct views
    46         *  to a minimum.
    47         */
    48        metaonly struct Args {
    49            String description; /*! the description shown to the user */
    50            Arg args[length];   /*! the argument in positional order */
    51        }
    52        
    53        /*!
    54         *  ======== ViewType ========
    55         *  ROV view type
    56         *
    57         *  @p(dlist)
    58         *      - INSTANCE
    59         *          basic instance information (one row per instance).  The view
    60         *          init function is passed three arguments: (1) an instance of 
    61         *          the view structure, (2) the instance state structure of the
    62         *          instance to view, and (3) a string containing user-supplied
    63         *          arguments.
    64         *
    65         *      - INSTANCE_DATA
    66         *          instance-specific data tables (many rows per instance).  The
    67         *          view init function is passed three arguments: (1) an instance
    68         *          of the
    69         *          {@link xdc.rov.Program#InstDataView Program.InstDataView}
    70         *          structure, (2) an instance state structure for the
    71         *          instance to view, and (3) a string containing user-supplied
    72         *          arguments.
    73         *
    74         *      - MODULE
    75         *          basic module information (one row per module).  The view
    76         *          init function is passed three arguments: (1) an instance of 
    77         *          the view structure, (2) the module state structure of the
    78         *          module to view, and (3) a string containing user-supplied
    79         *          arguments.
    80         *
    81         *      - MODULE_DATA
    82         *          module-specific data tables (many rows per module).  The
    83         *          view init function is passed two arguments: (1) a
    84         *          {@link xdc.rov.Program#ModDataView Program.ModDataView}
    85         *          structure, and (2) a string containing user-supplied
    86         *          arguments.
    87         *
    88         *      - RAW
    89         *         This is a reserved view type used by ROV to display raw data.
    90         *
    91         *      - TREE_TABLE
    92         *         The view init function is passed one argument: a string
    93         *         containing user-supplied arguments. It is expected
    94         *         to return a new initialized
    95         *         {@link xdc.rov.Program#TreeNode xdc.rov.Program.TreeNode}
    96         *         array or `null` in the event that there is nothing to
    97         *         display.
    98         *
    99         *         This view type is used to describe the `Diags` masks
   100         *         for all modules, for example; see
   101         *         {@link xdc.runtime.Diags#rovViewInfo Diags.rovViewInfo}'
   102         *
   103         *      - TREE
   104         *         The view init function is passed one argument: a string
   105         *         containing user-supplied arguments.  It is expected
   106         *         to return a new initialized JavaScript hash table of hash
   107         *         tables or `null` in the event that there is nothing to display.
   108         *
   109         *         This view type provides a simple two-level tree of name-value
   110         *         pairs.
   111         *  @p
   112         */
   113        metaonly enum ViewType {
   114            INSTANCE,
   115            MODULE,
   116            INSTANCE_DATA,
   117            MODULE_DATA,
   118            RAW,
   119            TREE_TABLE,
   120            TREE
   121        }
   122        
   123        /*!
   124         *  ======== View ========
   125         *  ROV View descriptor
   126         *
   127         *  @field(type)          the view type which control the type of arguments
   128         *                        passed to the `viewInitFxn`
   129         *  @field(viewInitFxn)   the name of a function that converts raw target
   130         *                        data into a human readable "view structure".
   131         *                        This name is the name of a metaonly function
   132         *                        defined in the module's `.xs` file.
   133         *  @field(structName)    the name of the view structure populated by
   134         *                        the `viewInitFxn`.  This name is a name defined
   135         *                        the module's `.xdc` file.
   136         *  @field(argsName)      the name of an `Args` descriptor that defines the
   137         *                        user-supplied arguments for this view.
   138         *                        `argsName` is used to index into `argsMap`.
   139         */
   140        metaonly struct View {
   141            ViewType type;
   142            String   viewInitFxn;
   143            String   structName;
   144            String   argsName;
   145        }
   146    
   147    instance:
   148        
   149        /*!
   150         *  ======== viewMap ========
   151         *  Specifies all of the ROV views for the module
   152         *
   153         *  Maps module-specific view names to an appropriate View descriptor.
   154         */
   155        metaonly config View viewMap[string];
   156    
   157        /*!
   158         *  ======== showRawTab ========
   159         *  Control whether or not the "raw view" is available
   160         */
   161        metaonly config Bool showRawTab = true;
   162    
   163        /*!
   164         *  ======== argsMap ========
   165         *  Specifies argument structures for all of a module's views
   166         *
   167         *  Maps module-specific argument sets to an appropriate Args descriptor.
   168         */
   169        metaonly config Args argsMap[string];
   170    }
   171    /*
   172     *  @(#) xdc.rov; 1, 0, 1,0; 8-8-2017 17:30:40; /db/ztree/library/trees/xdc/xdc-D20/src/packages/
   173     */
   174