version 1.1.2.7, 2007/09/29 20:36:30
|
version 1.1.2.8, 2007/10/01 00:49:29
|
|
|
} | } |
| |
void cimmofSourceConsumer::_writeProperty( | void cimmofSourceConsumer::_writeProperty( |
|
const CIMNamespaceName& nameSpace, |
const CIMName& cn, | const CIMName& cn, |
const CIMConstProperty& cp) | const CIMConstProperty& cp) |
{ | { |
|
String ns = _makeIdent(nameSpace.getString()); |
CIMName pn = cp.getName(); | CIMName pn = cp.getName(); |
CIMType ct = cp.getType(); | CIMType ct = cp.getType(); |
CIMValue cv = cp.getValue(); | CIMValue cv = cp.getValue(); |
|
|
_outn(" -1,"); | _outn(" -1,"); |
} | } |
| |
// SourceReference.refClass: |
// SourceReference.ref: |
| |
if (ct == CIMTYPE_REFERENCE) | if (ct == CIMTYPE_REFERENCE) |
{ | { |
const CIMName& rcn = cp.getReferenceClassName(); | const CIMName& rcn = cp.getReferenceClassName(); |
_outn(" /* refClass */"); |
_outn(" /* refId */"); |
_outn(" &_%s,", *Str(rcn)); |
_outn(" &__%s_%s,", *Str(ns), *Str(rcn)); |
} | } |
| |
// SourceQualifierDecl.value: | // SourceQualifierDecl.value: |
|
|
} | } |
| |
void cimmofSourceConsumer::_writeParameter( | void cimmofSourceConsumer::_writeParameter( |
|
const CIMNamespaceName& nameSpace, |
const CIMName& cn, | const CIMName& cn, |
const CIMName& mn, | const CIMName& mn, |
const CIMConstParameter& cp) | const CIMConstParameter& cp) |
{ | { |
|
String ns = _makeIdent(nameSpace.getString()); |
CIMName pn = cp.getName(); | CIMName pn = cp.getName(); |
CIMType ct = cp.getType(); | CIMType ct = cp.getType(); |
| |
|
|
_outn(" -1,"); | _outn(" -1,"); |
} | } |
| |
// SourceProperty.refClass: |
// SourceProperty.ref: |
| |
if (ct == CIMTYPE_REFERENCE) | if (ct == CIMTYPE_REFERENCE) |
{ | { |
const CIMName& rcn = cp.getReferenceClassName(); | const CIMName& rcn = cp.getReferenceClassName(); |
_outn(" /* refClass */"); |
_outn(" /* ref */"); |
_outn(" &_%s,", *Str(rcn)); |
_outn(" &__%s_%s,", *Str(ns), *Str(rcn)); |
} | } |
| |
// SourceQualifierDecl.value: | // SourceQualifierDecl.value: |
|
|
} | } |
| |
void cimmofSourceConsumer::_writeMethod( | void cimmofSourceConsumer::_writeMethod( |
|
const CIMNamespaceName& nameSpace, |
const CIMName& cn, | const CIMName& cn, |
const CIMConstMethod& cm) | const CIMConstMethod& cm) |
{ | { |
|
|
for (Uint32 i = 0; i < cm.getParameterCount(); i++) | for (Uint32 i = 0; i < cm.getParameterCount(); i++) |
{ | { |
CIMConstParameter cp = cm.getParameter(i); | CIMConstParameter cp = cm.getParameter(i); |
_writeParameter(cn, mn, cp); |
_writeParameter(nameSpace, cn, mn, cp); |
parameterNames.append(cp.getName()); | parameterNames.append(cp.getName()); |
} | } |
| |
|
|
} | } |
| |
void cimmofSourceConsumer::_writeClass( | void cimmofSourceConsumer::_writeClass( |
|
const CIMNamespaceName& nameSpace, |
const CIMClass& cc) | const CIMClass& cc) |
{ | { |
|
String ns = _makeIdent(nameSpace.getString()); |
CIMName cn = cc.getClassName(); | CIMName cn = cc.getClassName(); |
| |
// Write comment: | // Write comment: |
|
|
for (Uint32 i = 0; i < cc.getPropertyCount(); i++) | for (Uint32 i = 0; i < cc.getPropertyCount(); i++) |
{ | { |
CIMConstProperty cp = cc.getProperty(i); | CIMConstProperty cp = cc.getProperty(i); |
_writeProperty(cc.getClassName(), cp); |
_writeProperty(nameSpace, cc.getClassName(), cp); |
featureNames.append(cp.getName()); | featureNames.append(cp.getName()); |
} | } |
| |
|
|
for (Uint32 i = 0; i < cc.getMethodCount(); i++) | for (Uint32 i = 0; i < cc.getMethodCount(); i++) |
{ | { |
CIMConstMethod cm = cc.getMethod(i); | CIMConstMethod cm = cc.getMethod(i); |
_writeMethod(cc.getClassName(), cm); |
_writeMethod(nameSpace, cc.getClassName(), cm); |
featureNames.append(cm.getName()); | featureNames.append(cm.getName()); |
} | } |
| |
|
|
| |
// Class header: | // Class header: |
| |
String path = "_" + cn.getString(); |
String path = "__" + ns + "_" + cn.getString(); |
| |
_writeQualifierArray(path, _Qualifiers(cc)); | _writeQualifierArray(path, _Qualifiers(cc)); |
| |
_outn("static SourceClass"); |
_outn("SourceClass"); |
_outn("%s =", *Str(path)); | _outn("%s =", *Str(path)); |
_outn("{"); | _outn("{"); |
| |
|
|
// SourceClass.super: | // SourceClass.super: |
| |
const CIMName& scn = cc.getSuperClassName(); | const CIMName& scn = cc.getSuperClassName(); |
|
|
_outn(" /* super */"); | _outn(" /* super */"); |
| |
if (scn.isNull()) | if (scn.isNull()) |
_outn(" 0,"); | _outn(" 0,"); |
else | else |
_outn(" &_%s,", *Str(scn)); |
_outn(" &__%s_%s,", *Str(ns), *Str(scn)); |
| |
// SourceClass.features: | // SourceClass.features: |
| |
|
|
_writeQualifierDecl(_qualifiers[i]); | _writeQualifierDecl(_qualifiers[i]); |
} | } |
| |
|
// Forward declare all classes: |
|
|
|
_box(_os, "Forward class declarations"); |
|
|
|
_nl(); |
|
|
|
for (Uint32 i = 0; i < _classes.size(); i++) |
|
{ |
|
CIMName cn = _classes[i].getClassName(); |
|
_outn("extern SourceClass __%s_%s;", *Str(ns), *Str(cn)); |
|
} |
|
|
|
_nl(); |
|
|
// Write classes: | // Write classes: |
| |
for (Uint32 i = 0; i < _classes.size(); i++) | for (Uint32 i = 0; i < _classes.size(); i++) |
_writeClass(_classes[i]); |
_writeClass(nameSpace, _classes[i]); |
| |
// Write qualifiers list: | // Write qualifiers list: |
| |
|
|
| |
for (Uint32 i = 0; i < _classes.size(); i++) | for (Uint32 i = 0; i < _classes.size(); i++) |
{ | { |
_outn("&_%s,", *Str(_classes[i].getClassName())); |
CIMName cn = _classes[i].getClassName(); |
|
_outn("&__%s_%s,", *Str(ns), *Str(cn)); |
} | } |
| |
_outn("0,"); | _outn("0,"); |