예제 #1
0
CMPIValue
makeFromEmbeddedObject(XtokValue value, char *ns)
{
  XtokProperty   *p = NULL;
  CMPIValue       val;
  memset(&val, 0, sizeof(CMPIValue));
  CMPIObjectPath *path;
  CMPIStatus rc = {CMPI_RC_OK, NULL};

  if (value.type == typeValue_Instance) {
    CMPIInstance   *inst;
    XtokInstance   *xtokInstance = value.instance;
    path = TrackedCMPIObjectPath(ns, xtokInstance->className, NULL);
    inst = TrackedCMPIInstance(path, NULL);

    for (p = xtokInstance->properties.first; p; p = p->next) {
      if (p->val.val.value) {
        val = str2CMPIValue(p->valueType, p->val.val, &p->val.ref, NULL, &rc);
        CMSetProperty(inst, p->name, &val, p->valueType);
      }
    }
    val.inst = inst;
  } else if (value.type == typeValue_Class) {
    // not yet supported
  }
  return val;
}
예제 #2
0
static CMPIInstance *__beft_newInstance(const CMPIBroker * broker,
                                        const CMPIObjectPath * cop, CMPIStatus * rc)
{
   _SFCB_ENTER(TRACE_ENCCALLS,"newInstance");
   CMPIInstance *inst=TrackedCMPIInstance(cop, rc);
   _SFCB_RETURN(inst);
}