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

C++ CMRelease函数代码示例

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

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



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

示例1: 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


示例2: TestInstanceProviderCreateInstance

/**
    Create Instance from inst, using object-path op as reference.
*/
CMPIStatus TestInstanceProviderCreateInstance (
    CMPIInstanceMI * mi,
    const CMPIContext * ctx,
    const CMPIResult * rslt,
    const CMPIObjectPath * cop,
    const CMPIInstance * ci)
{
    CMPIStatus rc = { CMPI_RC_OK, NULL };
    CMPIInstance * inst;
    CMPIValue value_inst;
    CMPIData key1,key2, retInst;
    CMPIObjectPath *obp;
    unsigned int j = 0;
    if(ci)
    {
        /* clone the instance to be added to the array */
        inst = CMClone(ci, &rc);
        key1 = CMGetProperty(inst, "Identifier", &rc);
        for (j=0; j < numOfInst ; j++)
        {
            /* check for validity of Instance, that its not deleted */
            if (valid[j] == 1)
            {
                /* get element(instance) from array */
                retInst = CMGetArrayElementAt(clone_arr_ptr, j, &rc);
                /* get object-path of instance */
                obp = CMGetObjectPath(retInst.value.inst, &rc);
                /* get key from this object-path */
                key2 = CMGetKey(obp, "Identifier", &rc);
                /*compare key values.
                  If they match throw exception as two instance with same key
                  properties cannot exists. */
                if(key1.value.uint8 == key2.value.uint8)
                {
		  CMRelease(inst);
                    CMReturn (CMPI_RC_ERR_ALREADY_EXISTS);
                }
            }
        }
        value_inst.inst = inst;
        /* If instance doesnot exists in array add it */
        rc = CMSetArrayElementAt(
            clone_arr_ptr,
            numOfInst,
            &value_inst,
            CMPI_instance);
        valid[numOfInst]=1;
        numOfInst++;
        /* return object-path of instance */
        CMReturnObjectPath(rslt, cop);
        CMReturnDone(rslt);
    }
    else
    {
        CMReturn (CMPI_RC_ERR_NOT_SUPPORTED);
    }
    CMRelease(inst);
    CMReturn (CMPI_RC_OK);
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:62,代码来源:cmpiTestInstanceProvider.c


示例3: main

int main()
{
    CMCIClient *cc;
    CMPIObjectPath * objectpath;
    CMPIEnumeration * enumeration;
    CMPIStatus status;
    char 	*cim_host, *cim_host_passwd, *cim_host_userid;

    /* Setup a connection to the CIMOM */
    cim_host = getenv("CIM_HOST");
    if (cim_host == NULL)
	cim_host = "localhost";
    cim_host_userid = getenv("CIM_HOST_USERID");
    if (cim_host_userid == NULL)
	cim_host_userid = "root";
    cim_host_passwd = getenv("CIM_HOST_PASSWD");
    if (cim_host_passwd == NULL)
	cim_host_passwd = "password";
    cc = cmciConnect(cim_host, NULL, "5988",
			       cim_host_userid, cim_host_passwd, NULL);

    /* Test references() */
    printf("\n----------------------------------------------------------\n");
    printf("--> Testing references() ...\n");

    objectpath = newCMPIObjectPath("root/cimv2", "Linux_ComputerSystem", NULL);

    printf( "--> Adding keys to object path\n" );
    CMAddKey(objectpath, "CreationClassName", "Linux_ComputerSystem", CMPI_chars);
    CMAddKey(objectpath, "Name", "localhost.localdomain", CMPI_chars);

    printf( "--> Enumerating Instances\n" );
    enumeration = cc->ft->references(cc, objectpath, NULL, NULL, 0, NULL, &status);

    printf( "--> Print the results \n" );
    printf( "--> references() rc=%d, msg=%s\n", 
            status.rc, (status.msg)? (char *)status.msg->hdl : NULL);

    if (!status.rc) {        
        printf("--> result(s):\n");

        while (enumeration->ft->hasNext(enumeration, NULL)) 
        {
            CMPIData data = enumeration->ft->getNext(enumeration, NULL);
            showInstance(data.value.inst);
        }
    }

    if (enumeration) CMRelease(enumeration);
    if (objectpath) CMRelease(objectpath);
    if (status.msg) CMRelease(status.msg);
    if (cc) CMRelease(cc);
  
    return 0;
}
开发者ID:buccella,项目名称:SFCC,代码行数:55,代码来源:test_rf.c


示例4: 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


示例5: 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


示例6: main

int main()
{
    CMCIClient *cc;
    CMPIObjectPath * objectpath;
    CMPIEnumeration * enumeration;
    CMPIStatus status;
    char 	*cim_host, *cim_host_passwd, *cim_host_userid,
                *cim_host_cert, *cim_client_cert, *cim_client_key;

    /* Setup a connection to the CIMOM */
    cim_host = getenv("CIM_HOST");
    if (cim_host == NULL)
	cim_host = "localhost";
    cim_host_userid = getenv("CIM_HOST_USERID");
    if (cim_host_userid == NULL)
	cim_host_userid = "root";
    cim_host_passwd = getenv("CIM_HOST_PASSWD");
    if (cim_host_passwd == NULL)
	cim_host_passwd = "password";
    cim_host_cert = getenv("CIM_HOST_CERT");
    cim_client_cert = getenv("CIM_CLIENT_CERT");
    cim_client_key = getenv("CIM_CLIENT_KEY");
    cc = cmciConnect2(cim_host, "https", "5989",
		      cim_host_userid, cim_host_passwd, 
		      CMCI_VERIFY_PEER, cim_host_cert, 
		      cim_client_cert, cim_client_key,
		      NULL);
   
    /* Test enumClassNames() */
    printf("\n----------------------------------------------------------\n");
    printf("Testing enumClassNames() ...\n");   
    objectpath = newCMPIObjectPath("root/cimv2", NULL, NULL);
    enumeration = cc->ft->enumClassNames(cc, objectpath, 0, &status);

    /* Print the results */
    printf( "enumClassNames() rc=%d, msg=%s\n", status.rc, 
            (status.msg)? (char *)status.msg->hdl : NULL);

    if (!status.rc) {
        printf("result(s):\n");
        while (enumeration->ft->hasNext(enumeration, NULL)) {
            CMPIData data = enumeration->ft->getNext(enumeration, NULL);
            showObjectPath(data.value.ref);
        }
    }

    if (enumeration) CMRelease(enumeration);
    if (objectpath) CMRelease(objectpath);
    if (status.msg) CMRelease(status.msg);
    if (cc) CMRelease(cc);
    
    return 0;
}
开发者ID:buccella,项目名称:SFCC,代码行数:53,代码来源:test_ecn_ssl.c


示例7: sfcb_native_release_CMPIValue

void
sfcb_native_release_CMPIValue(CMPIType type, CMPIValue * val)
{
  switch (type) {

  case CMPI_instance:
    CMRelease(val->inst);
    break;

  case CMPI_class:
    CMRelease(val->inst);
    break;

  case CMPI_qualifierDecl:
    CMRelease((CMPIQualifierDecl *) val->dataPtr.ptr);
    break;

  case CMPI_ref:
    CMRelease(val->ref);
    break;

  case CMPI_args:
    CMRelease(val->args);
    break;

  case CMPI_filter:
    CMRelease(val->filter);
    break;

  case CMPI_enumeration:
    CMRelease(val->Enum);
    break;

  case CMPI_string:
    CMRelease(val->string);
    break;

  case CMPI_chars:
    free(val->chars);
    break;

  case CMPI_dateTime:
    CMRelease(val->dateTime);
    break;

  default:
    if (type & CMPI_ARRAY) {
      CMRelease(val->array);
    }
  }
}
开发者ID:mchasal,项目名称:SFCB,代码行数:51,代码来源:value.c


示例8: ClassProviderCleanup

static CMPIStatus
ClassProviderCleanup(CMPIClassMI * mi, const CMPIContext *ctx)
{
  HashTableIterator *hit,
                 *hitHt,
                 *hitIt;
  char           *key;
  ClassRegister  *cReg;
  ClassRecord    *crec;
  UtilList       *ul;

  for (hit = nsHt->ft->getFirst(nsHt, (void **) &key, (void **) &cReg);
       key && hit && cReg;
       hit =
       nsHt->ft->getNext(nsHt, hit, (void **) &key, (void **) &cReg)) {
    gzclose(cReg->f);
    free(cReg->vr);
    free(cReg->fn);

    ClassBase      *cb = (ClassBase *) (cReg + 1);
    for (hitIt =
         cb->it->ft->getFirst(cb->it, (void **) &key, (void **) &ul);
         key && hitIt && ul;
         hitIt =
         cb->it->ft->getNext(cb->it, hitIt, (void **) &key,
                             (void **) &ul)) {
      if (ul)
        CMRelease(ul);
    }
    CMRelease(cb->it);

    for (hitHt =
         cb->ht->ft->getFirst(cb->ht, (void **) &key, (void **) &crec);
         key && hitHt && crec;
         hitHt =
         cb->ht->ft->getNext(cb->ht, hitHt, (void **) &key,
                             (void **) &crec)) {
      free(key);
      if (crec->parent)
        free(crec->parent);
      free(crec);
    }
    CMRelease(cb->ht);
    free(cReg);
  }
  CMRelease(nsHt);
  CMReturn(CMPI_RC_OK);
}
开发者ID:mchasal,项目名称:SFCB,代码行数:48,代码来源:classProviderSf.c


示例9: _testErrorPaths

static int
_testErrorPaths()
{
  CMPIArgs       *args_ptr = NULL;
  CMPIStatus      rc = { CMPI_RC_OK, NULL };
  CMPIValue       value;
  char           *str = NULL;
  value.inst = NULL;
  args_ptr = CMNewArgs(_broker, &rc);
  rc = CMAddArg(args_ptr,
                "EmptyInstance", (CMPIValue *) & value, CMPI_instance);
  value.ref = NULL;
  rc = CMAddArg(args_ptr, "EmptyRef", (CMPIValue *) & value, CMPI_ref);
  value.dateTime = NULL;
  rc = CMAddArg(args_ptr,
                "EmptyDatetime", (CMPIValue *) & value, CMPI_dateTime);
  rc = CMAddArg(args_ptr, "EmptyChars", (CMPIValue *) str, CMPI_chars);
  rc = CMAddArg(args_ptr, "EmptyCharsPtrA", NULL, CMPI_charsptrA);

  value.chars = NULL;
  rc = CMAddArg(args_ptr, "EmptyCharsPtr", &value, CMPI_charsptr);

  value.args = NULL;
  rc = CMAddArg(args_ptr, "EmptyArgs", (CMPIValue *) & value, CMPI_args);

  rc = CMRelease(args_ptr);
  return 1;
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:28,代码来源:cmpiTestMiscProvider.c


示例10: releaseClass

void
releaseClass(CMPIConstClass * cls, char *from, int id)
{
  printf("### RELEASE %s %p %s %d\n", cls->ft->getCharClassName(cls), cls,
         from, id);
  CMRelease(cls);
}
开发者ID:mchasal,项目名称:SFCB,代码行数:7,代码来源:classProviderSf.c


示例11: each_property

/**
 * call-seq:
 *   instance.each_property do |name, value|
 *      ...
 *   end
 *
 * enumerates properties yielding the property name and
 * its value
 *
 */
static VALUE each_property(VALUE self)
{
  CIMCInstance *ptr;
  CIMCStatus status;
  int k=0;
  int num_props=0;
  CIMCString *property_name = NULL;
  CIMCData data;
  Data_Get_Struct(self, CIMCInstance, ptr);

  num_props = ptr->ft->getPropertyCount(ptr, &status);
  if (!status.rc) {
    for (; k < num_props; ++k) {
      data = ptr->ft->getPropertyAt(ptr, k, &property_name, &status);
      if (!status.rc) {
        rb_yield_values(2, (property_name ? rb_str_intern(rb_str_new2(property_name->ft->getCharPtr(property_name, NULL))) : Qnil), sfcc_cimdata_to_value(data));
      }
      else {
        sfcc_rb_raise_if_error(status, "Can't retrieve property #%d", k);
      } 
      if (property_name) CMRelease(property_name);
    }
  }
  else {
    sfcc_rb_raise_if_error(status, "Can't retrieve property count");
  }
  return Qnil;
}
开发者ID:steakknife,项目名称:ruby-sfcc,代码行数:38,代码来源:cim_instance.c


示例12: args2xml

int
args2xml(CMPIArgs * args, UtilStringBuffer * sb)
{
  int             i,
                  m;

  _SFCB_ENTER(TRACE_CIMXMLPROC, "args2xml");

  if (args == NULL)
    _SFCB_RETURN(0);

  m = CMGetArgCount(args, NULL);
  if (m == 0)
    _SFCB_RETURN(0);

  for (i = 0; i < m; i++) {
    CMPIString     *name;
    CMPIData        data;
    data = CMGetArgAt(args, i, &name, NULL);

    DATA2XML(&data, args, name, NULL, "<PARAMVALUE NAME=\"",
             "</PARAMVALUE>\n", sb, NULL, 1, 1);

    if ((data.type & (CMPI_ENC | CMPI_ARRAY)) && data.value.inst) {
      // don't get confused using generic release 
      data.value.inst->ft->release(data.value.inst);
    }
    CMRelease(name);
  }

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


示例13: cmpiPerf_TestClassProviderEnumInstanceNames

CMPIStatus cmpiPerf_TestClassProviderEnumInstanceNames(
    CMPIInstanceMI * mi,
    const CMPIContext * ctx,
    const CMPIResult * rslt,
    const CMPIObjectPath * ref)
{
    CMPIObjectPath  * op = NULL;
    CMPIStatus        rc = {CMPI_RC_OK, NULL};
    unsigned int   index = 0;
    unsigned int numInst = 1;

    //
    // While the instance itself is hard code, the number of instances
    // is determined from an environment variable
    //
    numInst = getNumberOfInstances();

    for (index=0; index < numInst; index++)
    {
        op = _makePath_TestClass( _broker, ctx, ref, index );

        if (op == NULL)
        {
            return rc;
        }

        CMReturnObjectPath( rslt, op );
        CMRelease( op );
    }

    CMReturnDone( rslt );
    return rc;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:33,代码来源:cmpiPerf_TestClassProvider.c


示例14: mergeParents

static CMPIStatus
mergeParents(ClassRegister * cr, ClClass * cl, char *p,
             CMPIConstClass * cc, ReadCtl * rctl)
{
  CMPIStatus      st = { CMPI_RC_OK, NULL };
  CMPIConstClass *pcc = NULL;
  unsigned char   originId = 0;
  char           *np = NULL;
  ReadCtl         ctl;

  if (cc) {
    if (p)
      originId = ClClassAddGrandParent(cl, p);
    cpyClass(cl, cc, originId);
  }
  if (p) {
    ctl = *rctl;
    pcc = getClass(cr, p, &ctl);
    if (pcc == NULL) {
      st.rc = CMPI_RC_ERR_INVALID_SUPERCLASS;
      return st;
    }
    np = (char *) pcc->ft->getCharSuperClassName(pcc);
    st = mergeParents(cr, cl, np, pcc, rctl);
    if (ctl != cached)
      CMRelease(pcc);
  }
  return st;
}
开发者ID:mchasal,项目名称:SFCB,代码行数:29,代码来源:classProviderSf.c


示例15: main

int main()
{
    CMCIClient *cc;
    CMPIObjectPath * objectpath;
    CMPIEnumeration * enumeration;
    CMPIStatus status;
    char 	*cim_host, *cim_host_passwd, *cim_host_userid;

    /* Setup a connection to the CIMOM */
    cim_host = getenv("CIM_HOST");
    if (cim_host == NULL)
	cim_host = "localhost";
    cim_host_userid = getenv("CIM_HOST_USERID");
    if (cim_host_userid == NULL)
	cim_host_userid = "root";
    cim_host_passwd = getenv("CIM_HOST_PASSWD");
    if (cim_host_passwd == NULL)
	cim_host_passwd = "password";
    cc = cmciConnect(cim_host, NULL, "5988",
			       cim_host_userid, cim_host_passwd, NULL);

    /* Test enumClasses() */
    printf("\n----------------------------------------------------------\n");
    printf("Testing enumClasses() ...\n");
    objectpath = newCMPIObjectPath("root/cimv2", NULL, NULL);
    enumeration = cc->ft->enumClasses(cc, objectpath, 
       CMPI_FLAG_DeepInheritance|CMPI_FLAG_IncludeQualifiers, &status);

    /* Print the results */
    printf( "enumClasses() rc=%d, msg=%s\n", 
            status.rc, (status.msg)? (char *)status.msg->hdl : NULL);

    if (!status.rc) {
         printf("result(s):\n");
         while (enumeration->ft->hasNext(enumeration, NULL)) {
            CMPIData data = enumeration->ft->getNext(enumeration, NULL);
            showClass(data.value.cls);
        }
    }

    if (enumeration) CMRelease(enumeration);
    if (objectpath) CMRelease(objectpath);
    if (status.msg) CMRelease(status.msg);
    if (cc) CMRelease(cc);
    
    return 0;
}
开发者ID:buccella,项目名称:SFCC,代码行数:47,代码来源:test_ec.c


示例16: InstProvCleanup

CMPIStatus InstProvCleanup (
    CMPIInstanceMI * mi,
    const CMPIContext * ctx,
    CMPIBoolean  term)
{
    CMRelease(clone_arr_ptr);
    CMReturn (CMPI_RC_OK);
}
开发者ID:deleisha,项目名称:neopegasus,代码行数:8,代码来源:cmpiInstanceProvider.c


示例17: TestInstanceProviderModifyInstance

/**
    Replace an existing Instance from inst, using object-path op as reference.
*/
CMPIStatus TestInstanceProviderModifyInstance  (
    CMPIInstanceMI * mi,
    const CMPIContext * ctx,
    const CMPIResult * rslt,
    const CMPIObjectPath * cop,
    const CMPIInstance * ci,
    const char **properties)
{
    CMPIStatus rc = { CMPI_RC_OK, NULL };
    CMPIInstance * inst;
    CMPIValue val1, val2;
    CMPIData key1, key2, retData1, retInst;
    CMPIObjectPath *obp;
    unsigned int j = 0, flag = 0;
    if(ci)
    {
        inst = CMClone(ci, &rc);
        /* get key from the object-path */
        key1 = CMGetKey(cop, "Identifier", &rc);
        val1.uint8 = key1.value.uint8;
        /* get the value of Message property */
        retData1 = CMGetProperty(inst, "Message", &rc);
        val2.string = retData1.value.string;
        for (j=0; j < numOfInst; j++)
        {
            /* check for validity of Instance, that its not deleted */
            if (valid[j] == 1)
            {
                /* get element(instance) from array */
                retInst = CMGetArrayElementAt(clone_arr_ptr, j, &rc);
                /* get object-path of instance */
                obp = CMGetObjectPath(retInst.value.inst, &rc);
                /* get key from this object-path */
                key2 = CMGetKey(obp, "Identifier", &rc);
                /*compare key values.
                  If they match then set the properties received from client */
                if(key1.value.uint8 == key2.value.uint8)
                {
                    CMSetProperty(
                        retInst.value.inst,
                        "Message",
                        &val2,
                        CMPI_string);
                    flag = 1;
                }
            }
        }
        CMRelease(inst);
        /*If match fails, throw exception, as instance to be mmodified is not
          found */
        if(!flag)
        {
            CMReturn (CMPI_RC_ERR_NOT_FOUND);
        }
    }
    CMReturnDone (rslt);
    CMReturn (CMPI_RC_OK);
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:61,代码来源:cmpiTestInstanceProvider.c


示例18: _testCMPIEnumeration

static int
_testCMPIEnumeration(const CMPIContext *ctx)
{
  CMPIStatus      rc = { CMPI_RC_OK, NULL };
  CMPIEnumeration *enum_ptr = NULL;
  CMPIData        data;
  unsigned int    initCount = 0;
  CMPIObjectPath *objPath = NULL;
  CMPIArray      *arr_ptr = NULL;
  CMPICount       returnedArraySize;
  void           *eptr;
  objPath = make_ObjectPath(_broker, _Namespace, _PersonClass);
  enum_ptr = CBEnumInstances(_broker, ctx, objPath, NULL, &rc);
  if (enum_ptr == NULL) {
    return 1;
  }

  arr_ptr = CMToArray(enum_ptr, &rc);
  if (arr_ptr == NULL) {
    return 1;
  }

  returnedArraySize = CMGetArrayCount(arr_ptr, &rc);
  while (CMHasNext(enum_ptr, &rc)) {
    data = CMGetNext(enum_ptr, &rc);
    if (data.type != CMPI_instance) {
      return 1;
    }
    initCount++;
  }

  eptr = enum_ptr->hdl;
  enum_ptr->hdl = NULL;

  CMToArray(enum_ptr, &rc);
  if (rc.rc != CMPI_RC_ERR_INVALID_HANDLE) {
    return 1;
  }

  CMGetNext(enum_ptr, &rc);
  if (rc.rc != CMPI_RC_ERR_INVALID_HANDLE) {
    return 1;
  }

  CMHasNext(enum_ptr, &rc);
  if (rc.rc != CMPI_RC_ERR_INVALID_HANDLE) {
    return 1;
  }
  enum_ptr->hdl = eptr;
  rc = CMRelease(enum_ptr);
  if (rc.rc != CMPI_RC_OK) {
    return 1;
  }

  return 0;
}
开发者ID:pravinmahajan,项目名称:sblim-sfcb,代码行数:56,代码来源:cmpiTestMiscProvider.c


示例19: TestInstanceProviderCleanup

CMPIStatus TestInstanceProviderCleanup (
    CMPIInstanceMI * mi,
    const CMPIContext * ctx,
    CMPIBoolean  term)
{
    CMRelease(clone_arr_ptr);
    deleteThreads ();
    _broker->xft->destroyMutex (threadCntMutex);
    CMReturn (CMPI_RC_OK);
}
开发者ID:zaneb,项目名称:sblim-sfcb,代码行数:10,代码来源:cmpiTestInstanceProvider.c


示例20: __launch_proxy_daemon

/*!
  The function prepares a context for the MB listen thread and launches it.
 */
static void __launch_proxy_daemon()
{
    CMPIContext *ctx = CBPrepareAttachThread(__init_broker, __init_context);
    if (!(__init_context && __init_broker))
    {
        CMRelease(ctx);
        ctx = NULL;
    }
    CMPI_BrokerExt_Ftab->newThread((void*(*)(void*))__start_proxy_daemon,ctx,1);
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:13,代码来源:tcpcomm_proxy.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CMSG_ALIGN函数代码示例发布时间:2022-05-30
下一篇:
C++ CMPASSERT函数代码示例发布时间: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