version 1.15, 2006/01/30 16:16:39
|
version 1.16, 2006/05/02 20:26:58
|
|
|
| |
// First check that it is an embedded object | // First check that it is an embedded object |
CIMValue nodeVal = nodeProp.getValue(); | CIMValue nodeVal = nodeProp.getValue(); |
if (nodeVal.getType() != CIMTYPE_OBJECT) |
CIMType nodeValType = nodeVal.getType(); |
|
if (nodeValType != CIMTYPE_OBJECT |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
&& nodeValType != CIMTYPE_INSTANCE |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
) |
{ | { |
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"not emb"); | PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"not emb"); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
} | } |
| |
CIMObject nodeObj; // this starts uninitialized | CIMObject nodeObj; // this starts uninitialized |
|
CIMInstance nodeInst; |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
if(nodeValType == CIMTYPE_OBJECT) |
|
{ |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
nodeVal.get(nodeObj); | nodeVal.get(nodeObj); |
if (nodeObj.isUninitialized()) | if (nodeObj.isUninitialized()) |
{ | { |
|
|
nodeProp.getName().getString()); | nodeProp.getName().getString()); |
throw CQLRuntimeException(parms); | throw CQLRuntimeException(parms); |
} | } |
|
nodeInst = CIMInstance(nodeObj); |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
} |
| |
CIMInstance nodeInst(nodeObj); |
else if(nodeValType == CIMTYPE_INSTANCE) |
|
{ |
|
nodeVal.get(nodeInst); |
|
if (nodeInst.isUninitialized()) |
|
{ |
|
// Not allowed to project on an uninitialized object |
|
PEG_TRACE_STRING (TRC_CQL, Tracer::LEVEL4,"is uninitialized"); |
|
PEG_METHOD_EXIT(); |
|
MessageLoaderParms parms("CQL.CQLSelectStatementRep.PROJ_UNINIT", |
|
"The embedded object property $0 is uninitialized.", |
|
nodeProp.getName().getString()); |
|
throw CQLRuntimeException(parms); |
|
} |
|
} |
|
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
// | // |
// Do the projection. | // Do the projection. |
// | // |
|
|
allowMissing); | allowMissing); |
| |
// Put the projected instance back into the property. | // Put the projected instance back into the property. |
|
#ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT |
|
if(nodeValType == CIMTYPE_INSTANCE) |
|
{ |
|
nodeProp.setValue(nodeInst); |
|
} |
|
else |
|
#endif |
|
{ |
CIMObject newNodeObj(nodeInst); | CIMObject newNodeObj(nodeInst); |
CIMValue newNodeVal(newNodeObj); | CIMValue newNodeVal(newNodeObj); |
nodeProp.setValue(newNodeVal); | nodeProp.setValue(newNodeVal); |
|
} |
| |
// Indicate to the caller whether the projected instance | // Indicate to the caller whether the projected instance |
// is still a required property. It is required if it is an endpoint | // is still a required property. It is required if it is an endpoint |