(file) Return to gen.h CVS log (file) (dir) Up to [OMI] / omi / gen

  1 mike  1.1 /*
  2           **==============================================================================
  3           **
  4           ** Open Management Infrastructure (OMI)
  5           **
  6           ** Copyright (c) Microsoft Corporation
  7           ** 
  8           ** Licensed under the Apache License, Version 2.0 (the "License"); you may not 
  9           ** use this file except in compliance with the License. You may obtain a copy 
 10           ** of the License at 
 11           **
 12           **     http://www.apache.org/licenses/LICENSE-2.0 
 13           **
 14           ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15           ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
 16           ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
 17           ** MERCHANTABLITY OR NON-INFRINGEMENT. 
 18           **
 19           ** See the Apache 2 License for the specific language governing permissions 
 20           ** and limitations under the License.
 21           **
 22 mike  1.1 **==============================================================================
 23           */
 24           
 25           #ifndef _gen_gen_h
 26           #define _gen_gen_h
 27           
 28           #include <string>
 29           #include <vector>
 30           
 31           struct GeneratorOptions
 32           {
 33               // List of directories to search for included MOF files.
 34               std::vector<std::string> paths;
 35           
 36               // Generate Description qualifiers (in schema.c) if true.
 37               // Set MI_MODULE_FLAG_DESCRIPTIONS bit of MI_Module.flags.
 38               bool descriptions;
 39           
 40               // Generate Values/ValueMap qualifiers (in schema.c) if true.
 41               // Set MI_MODULE_FLAG_VALUES bit of MI_Module.flags.
 42               bool values;
 43 mike  1.1 
 44               // Generate MappingStrings (in schema.c) if true.
 45               // Set MI_MODULE_FLAG_MAPPING_STRINGS bit of MI_Module.flags.
 46               bool mappingStrings;
 47           
 48               // Generate standard qualifier declarations (schema.c).
 49               // Set MI_MODULE_FLAG_STANDARD_QUALIFIERS bit of MI_Module.flags.
 50               bool standardQualifiers;
 51           
 52               // Generate boolean qualifiers (in addition to setting the corresponding
 53               // bit in the flags mask. Set MI_MODULE_FLAG_BOOLEANS bit  of
 54               // MI_Module.flags.
 55               bool booleanQualifiers;
 56           
 57               // Do not generate any qualifier declarations.
 58               bool ignoreAllQualifiers;
 59           
 60               // Set MI_MODULE_FLAG_FILTER_SUPPORT bit of MI_Module.flags.
 61               bool filterSupport;
 62           
 63               // Operate quietly if true (do not print anything to standard output.
 64 mike  1.1     bool quiet;
 65           
 66               // Do not generate any providers if true (only class files and RTTI).
 67               bool noProviders;
 68           
 69               // Include all classes encountered during parsing in generated output.
 70               bool all;
 71           
 72               // Generate C++ output (class files and provider files). Set the
 73               // MI_MODULE_FLAG_CPLUSPLUS bit of MI_Module.flags.
 74               bool cpp;
 75           
 76               // Change the name of the generated schema declaration (in schema.c) to
 77               // this name (the default is schemaDecl).
 78               std::string schema;
 79           
 80               // Place all output files in this directory. If empty, place output files
 81               // in the current directory.
 82               std::string dir;
 83           
 84               // If true generate strings.rc file with English localized strings from
 85 mike  1.1     // MOF files (applies to string and string[] qualifiers).
 86               bool localize;
 87           
 88               // Create a provider registry file with this name (if non-empty).
 89               std::string providerRegistryPath;
 90           
 91               // Generate *_AssociatorInstances and *_ReferenceInstances provider 
 92               // functions if true. Else generate role-oriented functions named as
 93               // follows:
 94               //
 95               //     <ASSOCIATION>_AssociatorInstances<ROLE1>
 96               //     <ASSOCIATION>_AssociatorInstances<ROLE2>
 97               //     <ASSOCIATION>_ReferenceInstances<ROLE1>
 98               //     <ASSOCIATION>_ReferenceInstances<ROLE2>
 99               //
100               // Where ROLE1 and ROLE2 are the role names (reference names) in an
101               // association. For example:
102               //
103               //     [Assocation]
104               //     class Link
105               //     {
106 mike  1.1     //         [Key] Gadget REF Left; /* <ROLE1> */
107               //         [Key] Gadget REF Right; /* <ROLE2> */
108               //     };
109               //
110               // In this example, the generator produces four provider functions with
111               // the following names.
112               //
113               //     Link_AssociatorInstancesLeft
114               //     Link_AssociatorInstancesRight
115               //     Link_ReferenceInstancesLeft
116               //     Link_ReferenceInstancesRight
117               //
118               bool association;
119           
120               // Generate class files (but not providers) for these extra classes.
121               std::vector<std::string> extraClasses;
122           
123               // Name of the module entry point if non-empty (default entry point name is
124               // called MI_Main). This name must not include the parentheses.
125               std::string entryPoint;
126           
127 mike  1.1     // Print warnings if true (otherwise suppress them).
128               bool warnings;
129           
130               // Name of provider for which a GNUmakefile will be generated. Used as
131               // basename of library name (e.g., lib<PROVIDERNAME>.so).
132               std::string providerName;
133           
134               // Do not generate the GetInstance provider stub for these classes
135               // Set MI_PorivderFT.GetInstances to NULL.
136               std::vector<std::string> noGetInstance;
137           
138               // Entire command line (all arguments);
139               // Required to generate make file
140               std::string cmdLine;
141           
142               // Default constructor (sets options to default values).
143               GeneratorOptions();
144           
145           };
146           
147           int GeneratorMain(
148 mike  1.1     const std::string& programName,
149               const std::vector<std::string>& mofFiles,
150               const std::vector<std::string>& classNames,
151               const GeneratorOptions& options);
152           
153           #endif /* _gen_gen_h */

ViewCVS 0.9.2