• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CMNewObjectPath函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CMNewObjectPath函数的典型用法代码示例。如果您正苦于以下问题:C++ CMNewObjectPath函数的具体用法?C++ CMNewObjectPath怎么用?C++ CMNewObjectPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CMNewObjectPath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IndCIMXMLHandlerEnumInstanceNames

CMPIStatus IndCIMXMLHandlerEnumInstanceNames(CMPIInstanceMI * mi,
                                             const CMPIContext * ctx,
                                             const CMPIResult * rslt,
                                             const CMPIObjectPath * ref)
{
   CMPIStatus st;
   CMPIEnumeration *enm;
   CMPIContext *ctxLocal;

   _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerEnumInstanceNames");
   if (interOpNameSpace(ref,&st)!=1) _SFCB_RETURN(st);
   ctxLocal = prepareUpcall((CMPIContext *)ctx);

#ifdef HAVE_OPTIMIZED_ENUMERATION
   CMPIString* cn;
   CMPIObjectPath* refLocal;
   cn = CMGetClassName(ref, &st);

   if (strcasecmp(CMGetCharPtr(cn), "cim_listenerdestination") == 0) {
     enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st);
     while(enm && enm->ft->hasNext(enm, &st)) {
       CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref);
     }
     refLocal = CMNewObjectPath(_broker,"root/interop","cim_listenerdestinationcimxml",&st);
     enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, refLocal, &st);
     while(enm && enm->ft->hasNext(enm, &st)) {
       CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref);
     }
     refLocal = CMNewObjectPath(_broker,"root/interop","cim_indicationhandlercimxml",&st);
     enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, refLocal, &st);
     while(enm && enm->ft->hasNext(enm, &st)) {
       CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref);
     }
     CMRelease(refLocal);
   }
   else {
     enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st);
     while(enm && enm->ft->hasNext(enm, &st)) {
       CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref);
     }
   }
#else
   enm = _broker->bft->enumerateInstanceNames(_broker, ctxLocal, ref, &st);

   while(enm && enm->ft->hasNext(enm, &st)) {
       CMReturnObjectPath(rslt, (enm->ft->getNext(enm, &st)).value.ref);
   }
#endif

   CMRelease(ctxLocal);
   if(enm) CMRelease(enm);

   _SFCB_RETURN(st);
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:54,代码来源:indCIMXMLHandler.c


示例2: get_assoc_targetClass_ObjectPath

CMPIObjectPath *
get_assoc_targetClass_ObjectPath(const CMPIBroker * broker,
                                 const CMPIObjectPath * ref,
                                 const char *_RefLeftClass,
                                 const char *_RefRightClass,
                                 CMPIStatus *rc)
{
  CMPIObjectPath *op = NULL;
  const char     *targetName = NULL;

  /*
   * get name of the target class 
   */
  targetName = get_assoc_targetClass_Name(broker,
                                          ref,
                                          _RefLeftClass,
                                          _RefRightClass, rc);

  if (targetName != NULL) {
    /*
     * create new object path of the target class 
     */
    op = CMNewObjectPath(broker,
                         CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL),
                         targetName, rc);
  }
  return op;
}
开发者ID:mchasal,项目名称:SFCB,代码行数:28,代码来源:cmpiTestAssociationProvider.c


示例3: _makeInst_ServiceProcess

CMPIInstance * _makeInst_ServiceProcess( const CMPIBroker * _broker,
					 const CMPIObjectPath * service,
					 CMPIObjectPath * process,
					 CMPIStatus * rc) {
  CMPIObjectPath * op = NULL;
  CMPIInstance   * ci = NULL;

  _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() called"));

  /* create CMPIObjectPath of this association <_ClassName> */
  op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(service,rc)),
			_ClassName, rc );
  if( CMIsNullObject(op) ) { 
    CMSetStatusWithChars( _broker, rc, 
			  CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); 
    goto exit;
  }

  ci = CMNewInstance( _broker, op, rc);
  if( CMIsNullObject(ci) ) { 
    CMSetStatusWithChars( _broker, rc, 
			  CMPI_RC_ERR_FAILED, "Create CMPIInstance failed." ); 
    _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() failed : %s",CMGetCharPtr(rc->msg)));
    goto exit;
  }

  CMSetProperty( ci, _RefLeft, (CMPIValue*)&(service), CMPI_ref ); 
  CMSetProperty( ci, _RefRight, (CMPIValue*)&(process), CMPI_ref );

 exit:
  _OSBASE_TRACE(4,("--- _makeInst_ServiceProcess() exited"));
  return ci; 
}
开发者ID:zaneb,项目名称:sblim-cmpi-service,代码行数:33,代码来源:cmpiOSBase_ServiceProcess.c


示例4: Linux_FanAssociatedSensorProviderAssociators

CMPIStatus Linux_FanAssociatedSensorProviderAssociators(
        CMPIAssociationMI * mi,
        const CMPIContext * ctx,
        const CMPIResult * rslt,
        const CMPIObjectPath * cop,
        const char * assocClass,
        const char * resultClass,
        const char * role,
        const char * resultRole,
        const char ** propertyList)
{
    UNUSED(mi); UNUSED(propertyList);
  CMPIStatus       rc    = {CMPI_RC_OK, NULL};
  CMPIObjectPath * op    = NULL;
  int              refrc = 0;

  _OSBASE_TRACE(1,("--- %s CMPI Associators() called",_ClassName));

  if( assocClass ) {
    op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(cop,&rc)),
			  _ClassName, &rc );
    if( op==NULL ) {
      CMSetStatusWithChars( _broker, &rc,
            CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." );
      _OSBASE_TRACE(2,
              ("--- %s CMPI Associators() failed : %s",CMGetCharPtr(rc.msg)));
      return rc;
    }
  }

  if (  (assocClass == NULL)
     || (CMClassPathIsA(_broker,op,assocClass,&rc) == 1))
  {
  
    if( _assoc_check_parameter_const( _broker,cop,_RefLeft,_RefRight,
				      _RefLeftClass,_RefRightClass,
				      resultClass,role,resultRole, 
				      &rc ) == 0 ) { goto exit; }

    refrc = _assoc_create_refs_1toN(_broker, ctx, rslt, cop, 
				    _ClassName,_RefLeftClass,_RefRightClass,
				    _RefLeft,_RefRight,
				    1, 1, &rc);
    if( refrc != 0 ) {
      if( rc.msg != NULL ) {
	_OSBASE_TRACE(1, ("--- %s CMPI Associators() failed : %s",
                    _ClassName,CMGetCharPtr(rc.msg)));
      }
      else {
	_OSBASE_TRACE(1,("--- %s CMPI Associators() failed",_ClassName));
      }
      return rc;
    }
  }
  
 exit:
  CMReturnDone( rslt );
  _OSBASE_TRACE(1,("--- %s CMPI Associators() exited",_ClassName));  
  CMReturn(CMPI_RC_OK);
}
开发者ID:miminar,项目名称:sblim-cmpi-fan,代码行数:60,代码来源:cmpiLinux_FanAssociatedSensorProvider.c


示例5: get_assoc_targetClass_ObjectPath

CMPIObjectPath *
get_assoc_targetClass_ObjectPath(const CMPIBroker * broker,
                                 const CMPIObjectPath * ref,
                                 const char *_RefLeftClass,
                                 const char *_RefRightClass,
                                 CMPIStatus *rc)
{
  CMPIObjectPath *op = NULL;
  const char     *targetName = NULL;

  /*
   * get name of the target class 
   */
  targetName = get_assoc_targetClass_Name(broker,
                                          ref,
                                          _RefLeftClass,
                                          _RefRightClass, rc);

  if (targetName != NULL) {
    /*
     * create new object path of the target class 
     */
    op = CMNewObjectPath(broker,
                         CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL),
                         targetName, rc);

    if (!op)
      CMSetStatusWithChars(_broker, rc, CMPI_RC_ERR_FAILED,
          "Create CMPIObjectPath failed in cmpiTestAssociationProvider");
  }
  return op;
}
开发者ID:buccella,项目名称:SFCB,代码行数:32,代码来源:cmpiTestAssociationProvider.c


示例6: dqRetry

int
dqRetry(CMPIContext * ctx, RTElement * cur)
{
  _SFCB_ENTER(TRACE_INDPROVIDER, "dqRetry");
  // Delete the instance in the repo
  CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL);
  CMAddKey(op,"IndicationID",&cur->instanceID,CMPI_uint32);
  CBDeleteInstance(_broker,ctx,op);
  CBDeleteInstance(_broker,ctx,cur->ind);
  CMRelease(op);

  // Remove the entry from the queue, closing the hole
  if (cur->next == cur) {
    // queue is empty
    free(cur);
    RQhead = NULL;
  } else {
    // not last
    cur->prev->next = cur->next;
    cur->next->prev = cur->prev;
    CMRelease(cur->ref);
    CMRelease(cur->sub);
    if (cur)
      free(cur);
  }
  _SFCB_RETURN(0);
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:27,代码来源:indCIMXMLHandler.c


示例7: get_assoc_targetClass_Name

const char     *
get_assoc_targetClass_Name(const CMPIBroker * broker,
                           const CMPIObjectPath * ref,
                           const char *_RefLeftClass,
                           const char *_RefRightClass, CMPIStatus *rc)
{
  CMPIString     *sourceClass = NULL;
  CMPIObjectPath *op = NULL;

  /*
   * get name of source class 
   */
  sourceClass = CMGetClassName(ref, rc);

  op = CMNewObjectPath(broker,
                       CMGetCharsPtr(CMGetNameSpace(ref, rc), NULL),
                       _RefLeftClass, rc);

  if (strcmp(CMGetCharsPtr(sourceClass, NULL), "CMPI_TEST_Person") == 0) {
    return "CMPI_TEST_Vehicle";
  } else if (strcmp(CMGetCharsPtr(sourceClass, NULL),
                    "CMPI_TEST_Vehicle") == 0) {
    return "CMPI_TEST_Person";
  } else {
    return NULL;
  }
}
开发者ID:buccella,项目名称:SFCB,代码行数:27,代码来源:cmpiTestAssociationProvider.c


示例8: IndCIMXMLHandlerDeleteInstance

CMPIStatus
IndCIMXMLHandlerDeleteInstance(CMPIInstanceMI * mi,
                               const CMPIContext *ctx,
                               const CMPIResult *rslt,
                               const CMPIObjectPath * cop)
{
  CMPIStatus      st = { CMPI_RC_OK, NULL };
  CMPIArgs       *in,
                 *out = NULL;
  CMPIObjectPath *op;
  CMPIData        rv;

  _SFCB_ENTER(TRACE_INDPROVIDER, "IndCIMXMLHandlerDeleteInstance");

  if (interOpNameSpace(cop, &st) == 0)
    _SFCB_RETURN(st);

  internalProviderGetInstance(cop, &st);
  if (st.rc)
    _SFCB_RETURN(st);

  in = CMNewArgs(_broker, NULL);
  CMAddArg(in, "key", &cop, CMPI_ref);
  op = CMNewObjectPath(_broker, "root/interop",
                       "cim_indicationsubscription", &st);
  rv = CBInvokeMethod(_broker, ctx, op, "_removeHandler", in, out, &st);

  if (st.rc == CMPI_RC_OK) {
    st = InternalProviderDeleteInstance(NULL, ctx, rslt, cop);
  }

  _SFCB_RETURN(st);
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:33,代码来源:indCIMXMLHandler.c


示例9: generateIndication2

static void
generateIndication2(const char *methodname, const CMPIContext *ctx)
{

  CMPIInstance   *inst;
  CMPIObjectPath *cop;
  CMPIDateTime   *dat;
  CMPIArray      *ar;
  CMPIStatus      rc;
  char            buffer[32];

  if (enabled && activated2) {
    cop = CMNewObjectPath(broker, "root/interop2", "Test_Indication", &rc);
    inst = CMNewInstance(broker, cop, &rc);

    sprintf(buffer, "%d", _nextUID++);
    CMSetProperty(inst, "IndicationIdentifier", buffer, CMPI_chars);

    dat = CMNewDateTime(broker, &rc);
    CMSetProperty(inst, "IndicationTime", &dat, CMPI_dateTime);

    CMSetProperty(inst, "MethodName", methodname, CMPI_chars);

    ar = CMNewArray(broker, 0, CMPI_string, &rc);
    CMSetProperty(inst, "CorrelatedIndications", &ar, CMPI_stringA);

    rc = CBDeliverIndication(broker, ctx, "root/interop", inst);
    if (rc.rc != CMPI_RC_OK) {
      fprintf(stderr, "+++ Could not send the indication!\n");
    }
    gen2++;
  }
  fprintf(stderr, "+++ generateIndication2() done %d\n", gen2);
}
开发者ID:buccella,项目名称:SFCB,代码行数:34,代码来源:cmpiTestIndicationProvider.c


示例10: TestCMPIAssociationProviderAssociatorNames

CMPIStatus TestCMPIAssociationProviderAssociatorNames(
    CMPIAssociationMI* mi,
    const CMPIContext* ctx,
    const CMPIResult* rslt,
    const CMPIObjectPath* ref,
    const char* _RefLeftClass,
    const char* _RefRightClass,
    const char* role,
    const char* resultRole)
{
    CMPIObjectPath* op = NULL;
    CMPIObjectPath* rop = NULL;
    CMPIEnumeration* en = NULL;
    CMPIData data ;

    CMPIStatus rc = { CMPI_RC_OK, NULL };

    PROV_LOG_OPEN (_ClassName, _ProviderLocation);
    PROV_LOG ("\n\n********************* %s CMPI AssociatorNames() called",
        _ClassName);

    /* get object path of the target class */
    op = get_assoc_targetClass_ObjectPath(
        _broker,
        ref,
        _RefLeftClass,
        _RefRightClass,
        &rc);

    PROV_LOG (" New Object Path [%s]",
        CMGetCharsPtr (CMGetNameSpace (ref, &rc),NULL));

    /* create new object path of association */
    rop = CMNewObjectPath(
        _broker,
        CMGetCharsPtr(CMGetNameSpace(ref,&rc),NULL),
        _ClassName,
        &rc );

    /* upcall to CIMOM; call enumInstanceNames() of the target class */
    en = CBEnumInstanceNames( _broker, ctx, op, &rc);

    /* as long as object path entries are found in the enumeration */
    while( CMHasNext( en, &rc) )
    {
        /* get the object path */
        data = CMGetNext(en, &rc);

        /* and return the target class object path as result of the
         * associatorNames() call
        */
        CMReturnObjectPath( rslt, data.value.ref );
    }
    PROV_LOG ("\n\n********************* %s CMPI AssociatorNames() exited",
        _ClassName);
    PROV_LOG_CLOSE ();
    return rc;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:58,代码来源:cmpiTestAssociationProvider.c


示例11: _SMI_TRACE

CMPIObjectPath *RegisteredProfileCreateObjectPath(
					const char *ns,
					const char *name,
					CMPIStatus *status)
{
	CMPIObjectPath *cop;
	char buf[256];

	_SMI_TRACE(1,("RegisteredProfileCreateObjectPath() called"));

	if (strcasecmp(name, VolumeManagementName) == 0 ||
		strcasecmp(name, ArrayName) == 0 ||
		strcasecmp(name, ServerName) == 0)
	{
		cop = CMNewObjectPath(
					_BROKER, ns,
					RegisteredProfileName,
					status);
	}
	else
	{
		cop = CMNewObjectPath(
					_BROKER, ns,
					RegisteredSubProfileName,
					status);
	}

	if ((status->rc != CMPI_RC_OK) || CMIsNullObject(cop))
	{
		_SMI_TRACE(1,("RegisteredProfileCreateObjectPath(): CMNewObjectPath() failed - %s", CMGetCharPtr(status->msg)));
		CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Cannot create new objectpath");
		goto exit;
	}

	CMAddKey(cop, InstanceIDName, cmpiutilMakeInstanceID(name, buf, 256), CMPI_chars);
/*	*buf = 0;
	strncat(buf, "SNIA:", 256);
	strncat(buf, name , 256);
	CMAddKey(cop, "InstanceID", buf , CMPI_chars);
*/
exit:
	_SMI_TRACE(1,("RegisteredProfileCreateObjectPath() done"));
	return cop;
}
开发者ID:kkaempf,项目名称:smis-providers,代码行数:44,代码来源:RegisteredProfile.c


示例12: make_ObjectPath

CMPIObjectPath *
make_ObjectPath(const CMPIBroker * broker,
                const char *ns, const char *className)
{
  CMPIObjectPath *objPath = NULL;
  CMPIStatus      rc = { CMPI_RC_OK, NULL };
  objPath = CMNewObjectPath(broker, ns, className, &rc);
  CMAddKey(objPath, "ElementName", (CMPIValue *) className, CMPI_chars);
  return objPath;
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:10,代码来源:cmpiTestMiscProvider.c


示例13: enqRetry

int
enqRetry(RTElement * element, const CMPIContext * ctx, int repo)
{

  _SFCB_ENTER(TRACE_INDPROVIDER, "enqRetry");
  // Put this one on the retry queue
  if (pthread_mutex_lock(&RQlock) != 0) {
    // lock failed
    return 1;
  }
  if (RQhead == NULL) {
    // Queue is empty
    _SFCB_TRACE(1,("--- Adding indication to new retry queue."));
    RQhead = element;
    RQtail = element;
    RQtail->next = element;
    RQtail->prev = element;
  } else {
    _SFCB_TRACE(1,("--- Adding indication to retry queue."));
    element->next = RQtail->next;
    element->next->prev = element;
    RQtail->next = element;
    element->prev = RQtail;
    RQtail = element;
  }
  if (repo==1) {
    // If this needs to be persisted in the repo 
    // (not the initial fill from refillRetryQ)
    _SFCB_TRACE(1,("--- Creating SFCB_IndicationElement instance."));
    CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL);
    // Add the indID as the only key
    CMAddKey(op,"IndicationID",&element->instanceID,CMPI_uint32);
    // Create the instance
    //element->SFCBIndEle=op;
    element->SFCBIndEle=op->ft->clone(op,NULL);
    CMPIInstance * ci=CMNewInstance(_broker,op,NULL);
    // Set all the properties
    CMSetProperty(ci,"IndicationID",&element->instanceID,CMPI_uint32);
    CMSetProperty(ci,"RetryCount",&(RQtail->count),CMPI_uint32);
    CMSetProperty(ci,"LastDelivery",&(RQtail->lasttry),CMPI_sint32);
    CMSetProperty(ci,"ld",&(element->ref),CMPI_ref);
    CMSetProperty(ci,"ind",&element->ind,CMPI_ref);
    CMSetProperty(ci,"sub",&element->sub,CMPI_ref);
    CBCreateInstance(_broker, ctx, op, ci, NULL);
    CMRelease(op);
    CMRelease(ci);
  }

  if (pthread_mutex_unlock(&RQlock) != 0) {
    // lock failed
    return 1;
  }
  _SFCB_RETURN(0);
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:54,代码来源:indCIMXMLHandler.c


示例14: loopOnChildNames

static void loopOnChildNames(ClassRegister *cReg, char *cn, CMPIResult * rslt)
{
   CMPIObjectPath *op;
   UtilList *ul = getChildren(cReg,cn);
   char *child;
   if (ul) for (child = (char *) ul->ft->getFirst(ul); child;  child = (char *) ul->ft->getNext(ul)) {
      op=CMNewObjectPath(_broker,NULL,child,NULL);
      CMReturnObjectPath(rslt,op);
      loopOnChildNames(cReg,child,rslt);
   }
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:11,代码来源:classProviderSf.c


示例15: KBase_ToObjectPath

CMPIObjectPath* KBase_ToObjectPath(
    const KBase* self, 
    CMPIStatus* st)
{
    KPos pos;
    CMPIObjectPath* cop;

    /* Check parameters */

    if (self->magic != KMAGIC)
    {
        KSetStatus(st, ERR_FAILED);
        return NULL;
    }

    /* Create object path */

    KFirst(&pos, self);

    if (!(cop = CMNewObjectPath(self->cb, KChars(self->ns), pos.classname, 
        st)))
    {
        return NULL;
    }

    /* Set keys */

    while (KMore(&pos))
    {
        CMPIData cd;
        const KValue* value = (const KValue*)pos.field;

        if (value->exists && (pos.tag & KTAG_KEY))
        {
            CMPIStatus st;

            cd = _data(value, pos.tag);

            if (value->null)
                st = CMAddKey(cop, pos.name, NULL, cd.type);
            else
                st = CMAddKey(cop, pos.name, &cd.value, cd.type);

            if (!KOkay(st))
            {
                /* ATTN: log this but do not return! */
            }
        }

        KNext(&pos);
    }

    return cop;
}
开发者ID:jubalh,项目名称:konkretcmpi,代码行数:54,代码来源:general.c


示例16: ElementCapabilitiesInitInstances

void
ElementCapabilitiesInitInstances(const CMPIContext *ctx)
{
  CMPIObjectPath *op = NULL,
      *opLeft = NULL,
      *opRight = NULL,
      *left = NULL,
      *right = NULL;
  CMPIValue       val;
  CMPIEnumeration *enm = NULL;
  CMPIInstance   *ci = NULL;
  CMPIContext    *ctxLocal;

  ctxLocal = native_clone_CMPIContext(ctx);
  val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0);
  ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string);

  op = CMNewObjectPath(_broker, "root/interop", "SFCB_ElementCapabilities",
                       NULL);
  ci = CMNewInstance(_broker, op, NULL);

  opLeft =
      CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService",
                      NULL);
  enm = CBEnumInstanceNames(_broker, ctx, opLeft, NULL);
  left = CMGetNext(enm, NULL).value.ref;
  opRight =
      CMNewObjectPath(_broker, "root/interop",
                      "SFCB_IndicationServiceCapabilities", NULL);
  enm = CBEnumInstanceNames(_broker, ctx, opRight, NULL);
  right = CMGetNext(enm, NULL).value.ref;

  CMAddKey(op, "ManagedElement", &left, CMPI_ref);
  CMAddKey(op, "Capabilities", &right, CMPI_ref);
  CMSetProperty(ci, "ManagedElement", &left, CMPI_ref);
  CMSetProperty(ci, "Capabilities", &right, CMPI_ref);
  CBCreateInstance(_broker, ctxLocal, op, ci, NULL);
  CMRelease(ctxLocal);
  return;
}
开发者ID:buccella,项目名称:SFCB,代码行数:40,代码来源:elementCapabilitiesProvider.c


示例17: _SMI_TRACE

CMPIObjectPath *SoftwareIdentityCreateObjectPath(
					const char *ns,
					const char *name,
					CMPIStatus *status)
{
	CMPIObjectPath *cop;
	char buf[256];

	_SMI_TRACE(1,("SoftwareIdentityCreateObjectPath() called"));

	if (strcasecmp(name, SMIArrayName) == 0)
	{
		cop = CMNewObjectPath(
					_BROKER, ns,
					ArraySoftwareName,
					status);
	}
	else if (strcasecmp(name, SMIVolumeManagementName) == 0)
	{
		cop = CMNewObjectPath(
					_BROKER, ns,
					VolumeManagementSoftwareName,
					status);
	}

	if ((status->rc != CMPI_RC_OK) || CMIsNullObject(cop))
	{
		_SMI_TRACE(1,("SoftwareIdentityCreateObjectPath(): CMNewObjectPath() failed - %s", CMGetCharPtr(status->msg)));
		CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Cannot create new objectpath");
		goto exit;
	}

	CMAddKey(cop, InstanceIDName, cmpiutilMakeInstanceID(name, buf, 256), CMPI_chars);

exit:
	_SMI_TRACE(1,("SoftwareIdentityCreateObjectPath() done"));
	return cop;
}
开发者ID:kkaempf,项目名称:smis-providers,代码行数:38,代码来源:SoftwareIdentity.c


示例18: refillRetryQ

int refillRetryQ (const CMPIContext * ctx)
{
  _SFCB_ENTER(TRACE_INDPROVIDER, "refillRetryQ");  
  int qfill=0;
  if (RQhead==NULL) {
    // The queue is empty, check if there are instances to be restored
    CMPIObjectPath * op=CMNewObjectPath(_broker,"root/interop","SFCB_IndicationElement",NULL);
    CMPIEnumeration * enm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
    while(enm && enm->ft->hasNext(enm, NULL)) {
    // get the properties from the repo instance
      CMPIData inst=CMGetNext(enm,NULL);
      CMPIData indID=CMGetProperty(inst.value.inst,"indicationID",NULL);
      CMPIData rcount=CMGetProperty(inst.value.inst,"retryCount",NULL);
      CMPIData last=CMGetProperty(inst.value.inst,"lastDelivery",NULL);
      CMPIData ind=CMGetProperty(inst.value.inst,"ind",NULL);
      CMPIData sub=CMGetProperty(inst.value.inst,"sub",NULL);
      CMPIData ld=CMGetProperty(inst.value.inst,"ld",NULL);
      _SFCB_TRACE(1,("--- Requeueing indication id:%d",indID.value.Int));
      // Rebuild the queue element
      RTElement *element;
      element = (RTElement *) malloc(sizeof(*element));
      element->instanceID=indID.value.Int;
      element->lasttry=last.value.Int;
      element->count=rcount.value.Int;
      element->ind=ind.value.ref->ft->clone(ind.value.ref,NULL);
      element->ref=ld.value.ref->ft->clone(ld.value.ref,NULL);
      element->sub=sub.value.ref->ft->clone(sub.value.ref,NULL);
      CMPIObjectPath * indele=CMGetObjectPath(inst.value.inst,NULL);
      element->SFCBIndEle=indele->ft->clone(indele,NULL);
      // call enq
      enqRetry(element,ctx,0);
      qfill=1;
    }
    // spawn thread if we queued anything
    if ((qfill == 1 ) && (retryRunning == 0)) {
      retryRunning=1;
      _SFCB_TRACE(1,("--- Starting retryExport thread"));
      pthread_attr_init(&tattr);
      pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
      CMPIContext * pctx = native_clone_CMPIContext(ctx);
      pthread_create(&t, &tattr,&retryExport,(void *) pctx);
    }
  }

  _SFCB_RETURN(0); 
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:46,代码来源:indCIMXMLHandler.c


示例19: _makePath_TestClassA

CMPIObjectPath * _makePath_TestClassA(
    const CMPIBroker * _broker,
    const CMPIContext * ctx,
    const CMPIObjectPath * cop)
{
   CMPIObjectPath * op = NULL;
   CMPIValue theKey;
   theKey.uint32 = 2;

   op=CMNewObjectPath(
       _broker,
       CMGetCharsPtr(CMGetNameSpace(cop,NULL), NULL),
       _ClassName,
       NULL);

   CMAddKey(op, "theKey", &theKey, CMPI_uint32);
   return op;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:18,代码来源:cmpiPerf_TestClassA.c


示例20: CMNewObjectPath

CMPIObjectPath *kvp_rasd_create_ref(
    const CMPIBroker *broker,
    const char *name_space,
    xen_utils_session *session,
    xen_vm_record *vm_rec,
    kvp *kvp_rec
)
{
    char inst_id[MAX_INSTANCEID_LEN];
    CMPIObjectPath *result_setting = NULL;

    result_setting = CMNewObjectPath(broker, name_space, "Xen_KVPSettingData", NULL);
    if (result_setting) {
        _CMPICreateNewDeviceInstanceID(inst_id, MAX_INSTANCEID_LEN, kvp_rec->vm_uuid, kvp_rec->key);
        CMAddKey(result_setting, "InstanceID", (CMPIValue *)inst_id, CMPI_chars);
    }
    return result_setting;

}
开发者ID:murisfurder,项目名称:xs-cim,代码行数:19,代码来源:Xen_KVPSettingData.c



注:本文中的CMNewObjectPath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CMOS_READ函数代码示例发布时间:2022-05-30
下一篇:
C++ CMICMDBASE_GETOPTION函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap