(file) Return to cxxprovider_t.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           //==============================================================================
 26           //
 27           // cxxprovider.h - template for generating C++ provider header and source.
 28           //
 29           //==============================================================================
 30           
 31           #ifndef _migen_cxxprovider_t_h
 32           #define _migen_cxxprovider_t_h
 33           
 34           //==============================================================================
 35           //
 36           // COMMON_PROVIDER_LOAD_UNLOAD_DECLARATION
 37           //
 38           //==============================================================================
 39           
 40           #define COMMON_PROVIDER_LOAD_UNLOAD_DECLARATION   "\
 41               void Load(\n\
 42                   Context& context);\n\
 43 mike  1.1 \n\
 44               void Unload(\n\
 45                   Context& context);\n\
 46           \n"
 47           
 48           //==============================================================================
 49           //
 50           // COMMON_PROVIDER_CLASS_DECLARATION
 51           //
 52           //==============================================================================
 53           
 54           #define COMMON_PROVIDER_CLASS_DECLARATION   "\
 55           class <ALIAS>_Class_Provider\n\
 56           {\n\
 57           /* @MIGEN.BEGIN@ CAUTION: PLEASE DO NOT EDIT OR DELETE THIS LINE. */\n\
 58           private:\n\
 59               Module* m_Module;\n\
 60           <DATA_MEMBERS>\
 61           \n\
 62           public:\n\
 63               <ALIAS>_Class_Provider(\n\
 64 mike  1.1         Module* module);\n\
 65           \n\
 66               ~<ALIAS>_Class_Provider();\n\
 67           \n"   COMMON_PROVIDER_LOAD_UNLOAD_DECLARATION
 68           
 69           //==============================================================================
 70           //
 71           // COMMON_PROVIDER_CLASS_DECLARATION_END
 72           //
 73           //==============================================================================
 74           
 75           #define COMMON_PROVIDER_CLASS_DECLARATION_END \
 76               "/* @MIGEN.END@ CAUTION: PLEASE DO NOT EDIT OR DELETE THIS LINE. */"
 77           
 78           //==============================================================================
 79           //
 80           // INSTANCE_PROVIDER_CLASS_DECL
 81           //
 82           //==============================================================================
 83           
 84           #define INSTANCE_PROVIDER_CLASS_DECLARATION COMMON_PROVIDER_CLASS_DECLARATION "\
 85 mike  1.1     void EnumerateInstances(\n\
 86                   Context& context,\n\
 87                   const String& nameSpace,\n\
 88                   const PropertySet& propertySet,\n\
 89                   bool keysOnly,\n\
 90                   const MI_Filter* filter);\n\
 91           \n\
 92               void GetInstance(\n\
 93                   Context& context,\n\
 94                   const String& nameSpace,\n\
 95                   const <ALIAS>_Class& instance,\n\
 96                   const PropertySet& propertySet);\n\
 97           \n\
 98               void CreateInstance(\n\
 99                   Context& context,\n\
100                   const String& nameSpace,\n\
101                   const <ALIAS>_Class& newInstance);\n\
102           \n\
103               void ModifyInstance(\n\
104                   Context& context,\n\
105                   const String& nameSpace,\n\
106 mike  1.1         const <ALIAS>_Class& modifiedInstance,\n\
107                   const PropertySet& propertySet);\n\
108           \n\
109               void DeleteInstance(\n\
110                   Context& context,\n\
111                   const String& nameSpace,\n\
112                   const <ALIAS>_Class& instance);\n\
113           \n"
114           
115           //==============================================================================
116           //
117           // CPP: ASSOCIATION_PROVIDER_CLASS_DECLARATION
118           //
119           //==============================================================================
120           
121           #define ASSOCIATION_PROVIDER_CLASS_DECLARATION INSTANCE_PROVIDER_CLASS_DECLARATION "\
122               void AssociatorInstances(\n\
123                   Context& context,\n\
124                   const String& nameSpace,\n\
125                   const MI_Instance* instanceName, \n\
126                   const String& resultClass,\n\
127 mike  1.1         const String& role,\n\
128                   const String& resultRole,\n\
129                   const PropertySet& propertySet,\n\
130                   bool keysOnly,\n\
131                   const MI_Filter* filter);\n\
132           \n\
133               void ReferenceInstances(\n\
134                   Context& context,\n\
135                   const String& nameSpace,\n\
136                   const MI_Instance* instanceName, \n\
137                   const String& role,\n\
138                   const PropertySet& propertySet,\n\
139                   bool keysOnly,\n\
140                   const MI_Filter* filter);\n\
141           \n"
142           
143           #define ASSOCIATION_PROVIDER_CLASS_DECLARATION_ROLES INSTANCE_PROVIDER_CLASS_DECLARATION "\
144               void AssociatorInstances<ROLE1>(\n\
145                   Context& context,\n\
146                   const String& nameSpace,\n\
147                   const <ALIAS1>_Class& instanceName, \n\
148 mike  1.1         const String& resultClass,\n\
149                   const PropertySet& propertySet,\n\
150                   bool keysOnly,\n\
151                   const MI_Filter* filter);\n\
152           \n\
153               void AssociatorInstances<ROLE2>(\n\
154                   Context& context,\n\
155                   const String& nameSpace,\n\
156                   const <ALIAS2>_Class& instanceName, \n\
157                   const String& resultClass,\n\
158                   const PropertySet& propertySet,\n\
159                   bool keysOnly,\n\
160                   const MI_Filter* filter);\n\
161           \n\
162               void ReferenceInstances<ROLE1>(\n\
163                   Context& context,\n\
164                   const String& nameSpace,\n\
165                   const <ALIAS1>_Class& instanceName, \n\
166                   const PropertySet& propertySet,\n\
167                   bool keysOnly,\n\
168                   const MI_Filter* filter);\n\
169 mike  1.1 \n\
170               void ReferenceInstances<ROLE2>(\n\
171                   Context& context,\n\
172                   const String& nameSpace,\n\
173                   const <ALIAS2>_Class& instanceName, \n\
174                   const PropertySet& propertySet,\n\
175                   bool keysOnly,\n\
176                   const MI_Filter* filter);\n\
177           \n"
178           
179           //==============================================================================
180           //
181           // INDICATION_PROVIDER_CLASS_DECLARATION
182           //
183           //==============================================================================
184           
185           #define INDICATION_PROVIDER_CLASS_DECLARATION COMMON_PROVIDER_CLASS_DECLARATION "\
186               void Subscribe(\n\
187                   Context& context,\n\
188                   const String& nameSpace,\n\
189                   const MI_Filter* filter,\n\
190 mike  1.1         const String& bookmark,\n\
191                   MI_Uint64  subscriptionID,\n\
192                   void** subscriptionSelf);\n\
193           \n\
194               void Unsubscribe(\n\
195                   Context& context,\n\
196                   const String& nameSpace,\n\
197                   MI_Uint64  subscriptionID,\n\
198                   void* subscriptionSelf);\n\
199           \n\
200               void EnableIndications();\n\
201           \n\
202               void DisableIndications();\n\
203           \n\
204               void SetIndicationContext(\n\
205                   MI_Context* indicationsContext)\n\
206               {\n\
207                   m_IndicationsContext = indicationsContext;\n\
208               }\n\
209           \n\
210               MI_Result Post(\n\
211 mike  1.1         const Instance& indication,\n\
212                   MI_Uint32 subscriptionIDCount = 0,\n\
213                   const String& bookmark = String())\n\
214               {\n\
215                   if (m_IndicationsContext)\n\
216                   {\n\
217                       Context(m_IndicationsContext).Post(\n\
218                           indication,\n\
219                           subscriptionIDCount,\n\
220                           bookmark);\n\
221                       return MI_RESULT_OK;\n\
222                   }\n\
223                   return MI_RESULT_FAILED;\n\
224               }\n\
225           \n"
226           
227           //==============================================================================
228           //
229           // EXTRINSIC_METHOD_PROVIDER_CLASS_DECLARATION
230           //
231           //==============================================================================
232 mike  1.1 
233           #define EXTRINSIC_METHOD_PROVIDER_CLASS_DECLARATION     "\
234               void Invoke_<METHOD>(\n\
235                   Context& context,\n\
236                   const String& nameSpace,\n\
237                   const <ALIAS>_Class& instanceName,\n\
238                   const <ALIAS>_<METHOD>_Class& in);\n\
239           \n"
240           
241           //==============================================================================
242           //
243           // COMMON_PROVIDER_CLASS_LOAD_UNLOAD_CPP
244           //
245           //==============================================================================
246           
247           #define COMMON_PROVIDER_CLASS_LOAD_UNLOAD_CPP  "\
248           void <ALIAS>_Class_Provider::Load(\n\
249                   Context& context)\n\
250           {\n\
251               context.Post(MI_RESULT_OK);\n\
252           }\n\
253 mike  1.1 \n\
254           void <ALIAS>_Class_Provider::Unload(\n\
255                   Context& context)\n\
256           {\n\
257               context.Post(MI_RESULT_OK);\n\
258           }\n\
259           \n"
260           
261           //==============================================================================
262           //
263           // INSTANCE_PROVIDER_CLASS_STUBS_CPP
264           //
265           //==============================================================================
266           
267           #define INSTANCE_PROVIDER_CLASS_STUBS_CPP  "\
268           <ALIAS>_Class_Provider::<ALIAS>_Class_Provider(\n\
269               Module* module) :\n\
270               m_Module(module)\n\
271           {\n\
272           }\n\
273           \n\
274 mike  1.1 <ALIAS>_Class_Provider::~<ALIAS>_Class_Provider()\n\
275           {\n\
276           }\n\
277           \n\
278           void <ALIAS>_Class_Provider::Load(\n\
279                   Context& context)\n\
280           {\n\
281               context.Post(MI_RESULT_OK);\n\
282           }\n\
283           \n\
284           void <ALIAS>_Class_Provider::Unload(\n\
285                   Context& context)\n\
286           {\n\
287               context.Post(MI_RESULT_OK);\n\
288           }\n\
289           \n\
290           void <ALIAS>_Class_Provider::EnumerateInstances(\n\
291               Context& context,\n\
292               const String& nameSpace,\n\
293               const PropertySet& propertySet,\n\
294               bool keysOnly,\n\
295 mike  1.1     const MI_Filter* filter)\n\
296           {\n\
297               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
298           }\n\
299           \n\
300           void <ALIAS>_Class_Provider::GetInstance(\n\
301               Context& context,\n\
302               const String& nameSpace,\n\
303               const <ALIAS>_Class& instanceName,\n\
304               const PropertySet& propertySet)\n\
305           {\n\
306               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
307           }\n\
308           \n\
309           void <ALIAS>_Class_Provider::CreateInstance(\n\
310               Context& context,\n\
311               const String& nameSpace,\n\
312               const <ALIAS>_Class& newInstance)\n\
313           {\n\
314               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
315           }\n\
316 mike  1.1 \n\
317           void <ALIAS>_Class_Provider::ModifyInstance(\n\
318               Context& context,\n\
319               const String& nameSpace,\n\
320               const <ALIAS>_Class& modifiedInstance,\n\
321               const PropertySet& propertySet)\n\
322           {\n\
323               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
324           }\n\
325           \n\
326           void <ALIAS>_Class_Provider::DeleteInstance(\n\
327               Context& context,\n\
328               const String& nameSpace,\n\
329               const <ALIAS>_Class& instanceName)\n\
330           {\n\
331               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
332           }\n\
333           \n"
334           
335           //==============================================================================
336           //
337 mike  1.1 // CPP: ASSOCIATION_PROVIDER_CLASS_STUBS_CPP
338           //
339           //==============================================================================
340           
341           #define ASSOCIATION_PROVIDER_CLASS_STUBS_CPP INSTANCE_PROVIDER_CLASS_STUBS_CPP "\
342           void <ALIAS>_Class_Provider::AssociatorInstances(\n\
343               Context& context,\n\
344               const String& nameSpace,\n\
345               const MI_Instance* instanceName, \n\
346               const String& resultClass,\n\
347               const String& role,\n\
348               const String& resultRole,\n\
349               const PropertySet& propertySet,\n\
350               bool keysOnly,\n\
351               const MI_Filter* filter)\n\
352           {\n\
353               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
354           }\n\
355           \n\
356           void <ALIAS>_Class_Provider::ReferenceInstances(\n\
357               Context& context,\n\
358 mike  1.1     const String& nameSpace,\n\
359               const MI_Instance* instanceName, \n\
360               const String& role,\n\
361               const PropertySet& propertySet,\n\
362               bool keysOnly,\n\
363               const MI_Filter* filter)\n\
364           {\n\
365               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
366           }\n\
367           \n"
368           
369           #define ASSOCIATION_PROVIDER_CLASS_STUBS_CPP_ROLES INSTANCE_PROVIDER_CLASS_STUBS_CPP "\
370           void <ALIAS>_Class_Provider::AssociatorInstances<ROLE1>(\n\
371               Context& context,\n\
372               const String& nameSpace,\n\
373               const <ALIAS1>_Class& instanceName, \n\
374               const String& resultClass,\n\
375               const PropertySet& propertySet,\n\
376               bool keysOnly,\n\
377               const MI_Filter* filter)\n\
378           {\n\
379 mike  1.1     context.Post(MI_RESULT_NOT_SUPPORTED);\n\
380           }\n\
381           \n\
382           void <ALIAS>_Class_Provider::AssociatorInstances<ROLE2>(\n\
383               Context& context,\n\
384               const String& nameSpace,\n\
385               const <ALIAS2>_Class& instanceName, \n\
386               const String& resultClass,\n\
387               const PropertySet& propertySet,\n\
388               bool keysOnly,\n\
389               const MI_Filter* filter)\n\
390           {\n\
391               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
392           }\n\
393           \n\
394           void <ALIAS>_Class_Provider::ReferenceInstances<ROLE1>(\n\
395               Context& context,\n\
396               const String& nameSpace,\n\
397               const <ALIAS1>_Class& instanceName, \n\
398               const PropertySet& propertySet,\n\
399               bool keysOnly,\n\
400 mike  1.1     const MI_Filter* filter)\n\
401           {\n\
402               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
403           }\n\
404           \n\
405           void <ALIAS>_Class_Provider::ReferenceInstances<ROLE2>(\n\
406               Context& context,\n\
407               const String& nameSpace,\n\
408               const <ALIAS2>_Class& instanceName, \n\
409               const PropertySet& propertySet,\n\
410               bool keysOnly,\n\
411               const MI_Filter* filter)\n\
412           {\n\
413               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
414           }\n\
415           \n"
416           
417           //==============================================================================
418           //
419           // INDICATION_PROVIDER_CLASS_STUBS_CPP
420           //
421 mike  1.1 //==============================================================================
422           
423           #define INDICATION_PROVIDER_CLASS_STUBS_CPP  "\
424           <ALIAS>_Class_Provider::<ALIAS>_Class_Provider(\n\
425               Module* module) :\n\
426               m_Module(module),\n\
427               m_IndicationsContext(0)\n\
428           {\n\
429           }\n\
430           \n\
431           <ALIAS>_Class_Provider::~<ALIAS>_Class_Provider()\n\
432           {\n\
433           }\n\
434           \n\
435           void <ALIAS>_Class_Provider::Load(\n\
436                   Context& context)\n\
437           {\n\
438               context.Post(MI_RESULT_OK);\n\
439           }\n\
440           \n\
441           void <ALIAS>_Class_Provider::Unload(\n\
442 mike  1.1         Context& context)\n\
443           {\n\
444               context.Post(MI_RESULT_OK);\n\
445           }\n\
446           \n\
447           void <ALIAS>_Class_Provider::EnableIndications()\n\
448           {\n\
449           }\n\
450           \n\
451           void <ALIAS>_Class_Provider::DisableIndications()\n\
452           {\n\
453           }\n\
454           \n\
455           void <ALIAS>_Class_Provider::Subscribe(\n\
456               Context& context,\n\
457               const String& nameSpace,\n\
458               const MI_Filter* filter,\n\
459               const String& bookmark,\n\
460               MI_Uint64  subscriptionID,\n\
461               void** subscriptionSelf)\n\
462           {\n\
463 mike  1.1     context.Post(MI_RESULT_NOT_SUPPORTED);\n\
464           }\n\
465           \n\
466           void <ALIAS>_Class_Provider::Unsubscribe(\n\
467               Context& context,\n\
468               const String& nameSpace,\n\
469               MI_Uint64  subscriptionID,\n\
470               void* subscriptionSelf)\n\
471           {\n\
472               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
473           }\n\
474           \n"
475           
476           //==============================================================================
477           //
478           // EXTRINSIC_METHOD_CLASS_STUB_CPP
479           //
480           //==============================================================================
481           
482           #define EXTRINSIC_METHOD_CLASS_STUB_CPP     "\
483           void <ALIAS>_Class_Provider::Invoke_<METHOD>(\n\
484 mike  1.1     Context& context,\n\
485               const String& nameSpace,\n\
486               const <ALIAS>_Class& instanceName,\n\
487               const <ALIAS>_<METHOD>_Class& in)\n\
488           {\n\
489               context.Post(MI_RESULT_NOT_SUPPORTED);\n\
490           }\n\
491           \n"
492           
493           #endif /* _migen_cxxprovider_t_h */

ViewCVS 0.9.2