本文整理汇总了C++中c_iterFree函数的典型用法代码示例。如果您正苦于以下问题:C++ c_iterFree函数的具体用法?C++ c_iterFree怎么用?C++ c_iterFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了c_iterFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cms_clientFree
void
cms_clientFree(
cms_client client)
{
struct soap* soap;
cms_soapThread soapThread;
cms_thread(client)->terminate = TRUE;
os_mutexLock(&client->conditionMutex);
os_condSignal(&client->condition);
os_mutexUnlock(&client->conditionMutex);
cms_threadDeinit(cms_thread(client));
if(client->soapEnvs){
os_mutexLock(&client->soapMutex);
soap = (struct soap*)(c_iterTakeFirst(client->soapEnvs));
while(soap){
soap->error = soap_receiver_fault(soap, "Service is terminating.", NULL);
soap_send_fault(soap);
soap_destroy(soap);
soap_end(soap);
soap_done(soap);
os_free(soap);
soap = (struct soap*)(c_iterTakeFirst(client->soapEnvs));
}
c_iterFree(client->soapEnvs);
client->soapEnvs = NULL;
os_mutexUnlock(&client->soapMutex);
}
if(client->threads){
soapThread = cms_soapThread(c_iterTakeFirst(client->threads));
while(soapThread){
cms_soapThreadFree(soapThread);
(void)u_observableAction(u_observable(client->service->uservice), cms_clientStatisticsThreadRemove, client->service);
soapThread = cms_soapThread(c_iterTakeFirst(client->threads));
}
c_iterFree(client->threads);
client->threads = NULL;
}
os_mutexDestroy(&client->soapMutex);
os_mutexDestroy(&client->threadMutex);
os_mutexDestroy(&client->conditionMutex);
os_condDestroy(&client->condition);
client->initCount = 0;
if(client->service->configuration->verbosity >= 5){
OS_REPORT(OS_INFO, CMS_CONTEXT, 0,
"Client thread stopped for IP: %d.%d.%d.%d",
(int)(client->ip>>24)&0xFF,
(int)(client->ip>>16)&0xFF,
(int)(client->ip>>8)&0xFF,
(int)(client->ip&0xFF));
}
开发者ID:osrf,项目名称:opensplice,代码行数:58,代码来源:cms_client.c
示例2: d_waitsetDeinit
void
d_waitsetDeinit(
d_object object)
{
d_waitset waitset;
d_waitsetEntity we;
d_waitsetHelper helper;
assert(d_objectIsValid(object, D_WAITSET) == TRUE);
if(object){
waitset = d_waitset(object);
waitset->terminate = TRUE;
if(waitset->runToCompletion == TRUE){
if(os_threadIdToInteger(waitset->thread)) {
u_waitsetNotify(waitset->uwaitset, NULL);
os_threadWaitExit(waitset->thread, NULL);
}
} else {
if(waitset->threads){
helper = d_waitsetHelper(c_iterTakeFirst(waitset->threads));
while(helper){
helper->terminate = TRUE;
u_waitsetNotify(helper->userWaitset, NULL);
os_threadWaitExit(helper->tid, NULL);
u_waitsetDetach(helper->userWaitset, u_entity(helper->entity->dispatcher));
u_waitsetFree(helper->userWaitset);
os_free(helper);
helper = d_waitsetHelper(c_iterTakeFirst(waitset->threads));
}
c_iterFree(waitset->threads);
waitset->threads = NULL;
}
}
d_lockLock(d_lock(waitset));
if(waitset->entities) {
we = d_waitsetEntity(c_iterTakeFirst(waitset->entities));
while(we) {
if(waitset->runToCompletion == TRUE){
u_waitsetDetach(waitset->uwaitset, u_entity(we->dispatcher));
}
d_waitsetEntityFree(we);
we = d_waitsetEntity(c_iterTakeFirst(waitset->entities));
}
c_iterFree(waitset->entities);
}
if(waitset->runToCompletion == TRUE){
if(waitset->uwaitset) {
u_waitsetFree(waitset->uwaitset);
}
}
d_lockUnlock(d_lock(waitset));
}
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:58,代码来源:d_waitset.c
示例3: jni_participantFree
jni_result
jni_participantFree(
jni_participant p)
{
jni_result r;
jni_partition partition;
r = JNI_RESULT_OK;
if(p != NULL){
if((p->publishers != NULL) && (c_iterLength(p->publishers) != 0)){
r = JNI_RESULT_PRECONDITION_NOT_MET;
}
else if((p->subscribers != NULL) && (c_iterLength(p->subscribers) != 0)){
r = JNI_RESULT_PRECONDITION_NOT_MET;
}
else if((p->topics != NULL) && (c_iterLength(p->topics) != 0)){
r = JNI_RESULT_PRECONDITION_NOT_MET;
}
else if((p->partitions != NULL) && (c_iterLength(p->partitions) != 0)){
partition = jni_partition(c_iterTakeFirst(p->partitions));
while((partition != NULL) && (r == JNI_RESULT_OK)){
r = jni_partitionFree(partition);
partition = jni_partition(c_iterTakeFirst(p->partitions));
}
}
else{
/*DO NOTHING.*/
}
if(r == JNI_RESULT_OK){
if(p->publishers != NULL){
c_iterFree(p->publishers);
}
if(p->subscribers != NULL){
c_iterFree(p->subscribers);
}
if(p->topics != NULL){
c_iterFree(p->topics);
}
if(p->partitions != NULL){
c_iterFree(p->partitions);
}
if(p->uparticipant != NULL){
r = jni_convertResult(u_participantFree(p->uparticipant));
}
else{
r = JNI_RESULT_OK;
}
os_free(p);
}
}
else{
r = JNI_RESULT_BAD_PARAMETER;
}
return r;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:58,代码来源:jni_participant.c
示例4: jni_getTopicKeyExpression
void
jni_getTopicKeyExpression(
v_entity entity,
c_voidp args)
{
v_kernel vk;
c_iter vtopics;
c_array keyList;
c_char* keyExpr;
c_long nrOfKeys, totalSize, i;
c_string fieldName, actualFieldName;
struct jni_topicArg *arg;
arg = (struct jni_topicArg *)args;
vk = v_objectKernel(entity);
if(vk != NULL){
vtopics = v_resolveTopics(vk, arg->topicName);
if(c_iterLength(vtopics) == 0){
c_iterFree(vtopics);
}
else{
keyList = v_topicMessageKeyList(c_iterTakeFirst(vtopics));
c_iterFree(vtopics);
nrOfKeys = c_arraySize(keyList);
if (nrOfKeys>0) {
totalSize = 0;
for (i=0;i<nrOfKeys;i++) {
fieldName = c_fieldName(keyList[i]);
totalSize += (strlen(fieldName)+1-9/*skip 'userdata.'*/);
}
keyExpr = (c_char *)os_malloc((size_t)(totalSize+1));
keyExpr[0] = 0;
for (i=0;i<nrOfKeys;i++) {
fieldName = c_fieldName(keyList[i]);
actualFieldName = c_skipUntil(fieldName, ".");
actualFieldName++; /*skip '.' */
os_strcat(keyExpr,actualFieldName);
if (i<(nrOfKeys-1)) {
os_strcat(keyExpr,",");
}
}
arg->keyExpr = keyExpr;
} else{
/*No keys, do nothing.*/
}
arg->result = U_RESULT_OK;
}
}
}
开发者ID:diorahman,项目名称:opensplice,代码行数:55,代码来源:jni_participant.c
示例5: v_partitionLookupSubscribers
c_iter
v_partitionLookupSubscribers(
v_partition partition)
{
c_iter participants;
c_iter result;
c_iter entities;
c_iter partitions;
v_participant participant;
v_entity entity;
v_entity partition2;
result = NULL;
participants = v_resolveParticipants(v_objectKernel(partition), "*");
participant = v_participant(c_iterTakeFirst(participants));
while (participant != NULL) {
c_lockRead(&participant->lock);
entities = c_select(participant->entities, 0);
c_lockUnlock(&participant->lock);
entity = v_entity(c_iterTakeFirst(entities));
while (entity != NULL) {
if(v_objectKind(entity) == K_SUBSCRIBER) {
partitions = v_subscriberLookupPartitions(v_subscriber(entity),
v_partitionName(partition));
if (c_iterLength(partitions) > 0) {
result = c_iterInsert(result, entity); /* transfer refcount */
} else {
c_free(entity);
}
partition2 = v_entity(c_iterTakeFirst(partitions));
while (partition2 != NULL) {
c_free(partition2);
partition2 = v_entity(c_iterTakeFirst(partitions));
}
c_iterFree(partitions);
}
/* entity is already free or refcount transferred to result */
entity = v_entity(c_iterTakeFirst(entities));
}
c_iterFree(entities);
c_free(participant);
participant = v_participant(c_iterTakeFirst(participants));
}
c_iterFree(participants);
return result;
}
开发者ID:xrl,项目名称:opensplice,代码行数:50,代码来源:v_partition.c
示例6: deliveryServiceUnSubscribe
static void
deliveryServiceUnSubscribe(
void *o,
void *arg)
{
v_partition p = v_partition(o);
v_deliveryServiceEntry e = v_deliveryServiceEntry(arg);
v_kernel kernel;
v_group g;
c_value params[2];
c_iter list;
assert(C_TYPECHECK(e,v_deliveryServiceEntry));
assert(C_TYPECHECK(p,v_partition));
params[0] = c_objectValue(p);
params[1] = c_objectValue(e->topic);
kernel = v_objectKernel(e);
list = v_groupSetSelect(kernel->groupSet,
"partition = %0 and topic = %1",
params);
while ((g = c_iterTakeFirst(list)) != NULL) {
v_groupRemoveEntry(g,v_entry(e));
c_free(g);
}
c_iterFree(list);
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:27,代码来源:v_deliveryService.c
示例7: _ObjectRegistryFree
void
_ObjectRegistryFree (
_ObjectRegistry registry)
{
gapi_handle handle;
int ptr;
assert(registry);
os_mutexLock(®istry->mutex);
ptr = 0;
while ( registry->trash[ptr] != NULL ) {
gapi__free(registry->trash[ptr]);
registry->trash[ptr] = NULL;
ptr = (ptr + 1)%TRASH_LENGTH;
}
handle = c_iterTakeFirst(registry->active);
while ( handle != NULL ) {
handle->registry = NULL;
gapi__free(handle);
handle = c_iterTakeFirst(registry->active);
}
c_iterFree(registry->active);
os_mutexUnlock(®istry->mutex);
os_mutexDestroy(®istry->mutex);
os_free(registry);
}
开发者ID:diorahman,项目名称:opensplice,代码行数:31,代码来源:gapi_object.c
示例8: v_entryRemoveGroup
void
v_entryRemoveGroup(
v_entry entry,
v_group group)
{
c_query query;
q_expr qExpr;
c_value params[2];
c_iter groups;
v_proxy proxy, proxy2;
v_handle handle;
assert(entry != NULL);
assert(C_TYPECHECK(entry,v_entry));
assert(group != NULL);
assert(C_TYPECHECK(group,v_group));
handle = v_publicHandle(v_public(group));
qExpr = (q_expr)q_parse("source.index = %0 and source.server = %1");
params[0] = c_longValue(handle.index);
params[1] = c_addressValue(handle.server);
query = c_queryNew(entry->groups, qExpr, params);
q_dispose(qExpr);
groups = c_select(query, 0);
c_free(query);
assert(c_iterLength(groups) <= 1);
proxy = v_proxy(c_iterTakeFirst(groups));
proxy2 = c_remove(entry->groups, proxy, NULL, NULL);
c_iterFree(groups);
c_free(proxy);
c_free(proxy2);
}
开发者ID:xrl,项目名称:opensplice,代码行数:33,代码来源:v_entry.c
示例9: v_entryFree
void
v_entryFree(
v_entry entry)
{
c_iter proxies;
v_proxy proxy;
v_group group;
assert(C_TYPECHECK(entry,v_entry));
proxies = c_select(entry->groups, 0);
proxy = c_iterTakeFirst(proxies);
while (proxy != NULL) {
group = v_group(v_proxyClaim(proxy));
if (group) {
v_groupRemoveEntry(group, entry);
v_proxyRelease(proxy);
}
c_free(proxy);
proxy = c_iterTakeFirst(proxies);
}
c_iterFree(proxies);
/* No parent to call Free on */
}
开发者ID:xrl,项目名称:opensplice,代码行数:25,代码来源:v_entry.c
示例10: v_groupStreamUnSubscribe
c_bool
v_groupStreamUnSubscribe(
v_groupStream stream,
v_partition partition)
{
c_iter list;
v_group group;
c_bool result;
assert(C_TYPECHECK(stream, v_groupStream));
assert(C_TYPECHECK(partition, v_partition));
list = ospl_c_select(stream->groups, 0);
group = c_iterTakeFirst(list);
result = FALSE;
while (group != NULL) {
if(strcmp(v_partitionName(partition),
v_partitionName(group->partition)) == 0){
result = v_groupStreamUnSubscribeGroup(stream, group);
}
c_free(group);
group = c_iterTakeFirst(list);
}
c_iterFree(list);
return result;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:28,代码来源:v_groupStream.c
示例11: v_groupStreamSubscribe
c_bool
v_groupStreamSubscribe(
v_groupStream stream,
v_partition partition)
{
c_iter list;
v_kernel kernel;
c_value params[1];
v_group group;
assert(C_TYPECHECK(stream,v_groupStream));
kernel = v_objectKernel(v_entity(partition));
params[0] = c_objectValue(partition);
list = v_groupSetSelect(kernel->groupSet,"partition = %0 ",params);
group = c_iterTakeFirst(list);
while (group != NULL) {
v_groupStreamSubscribeGroup(stream, group);
c_free(group);
group = c_iterTakeFirst(list);
}
c_iterFree(list);
return TRUE;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:26,代码来源:v_groupStream.c
示例12: cmx_readerSnapshotFreeAll
void
cmx_readerSnapshotFreeAll()
{
cmx_readerSnapshot s;
c_char* sample;
os_mutex m;
m = cmx_getReaderSnapshotMutex();
os_mutexLock(&m);
s = cmx_readerSnapshot(c_iterTakeFirst(readerSnapshots));
while(s != NULL){
if(s->samples != NULL){
sample = (c_char*)(c_iterTakeFirst(s->samples));
while(sample != NULL){
os_free(sample);
sample = (c_char*)(c_iterTakeFirst(s->samples));
}
c_iterFree(s->samples);
}
os_free(s);
s = cmx_readerSnapshot(c_iterTakeFirst(readerSnapshots));
}
os_mutexUnlock(&m);
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:26,代码来源:cmx_readerSnapshot.c
示例13: cms_soapThreadRun
static void*
cms_soapThreadRun(
void *thr)
{
cms_soapThread thread;
struct soap* soap;
c_char* result;
thread = cms_soapThread(thr);
os_mutexLock(&thread->soapMutex);
while(cms_thread(thread)->terminate == FALSE){
if(thread->soap != NULL){
soap = thread->soap;
thread->soap = NULL;
cms_thread(thread)->results = NULL;
soap->user = thr;
soap_serve(soap);
soap_destroy(soap);
soap_end(soap);
soap_done(soap);
free(soap);
u_entityAction( u_entity(thread->client->service->uservice),
cms_soapThreadStatisticsRequestHandledAdd,
thread->client->service);
if(cms_thread(thread)->results != NULL){
result = (c_char*)(c_iterTakeFirst(cms_thread(thread)->results));
while(result){
os_free(result);
result = (c_char*)(c_iterTakeFirst(cms_thread(thread)->results));
}
c_iterFree(cms_thread(thread)->results);
cms_thread(thread)->results = NULL;
}
}
if(cms_thread(thread)->terminate == FALSE){
cms_thread(thread)->ready = TRUE;
if(thread->client->service->configuration->verbosity >= 7){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' ready.", cms_thread(thread)->name);
}
os_condWait(&thread->condition, &thread->soapMutex);
if(thread->client->service->configuration->verbosity >= 7){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' condition triggered.", cms_thread(thread)->name);
}
}
}
os_mutexUnlock(&thread->soapMutex);
if(thread->client->service->configuration->verbosity >= 6){
OS_REPORT_1(OS_INFO, CMS_CONTEXT, 0, "soapThread '%s' ends.", cms_thread(thread)->name);
}
return NULL;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:60,代码来源:cms_soapThread.c
示例14: u_readerGetMatchedPublications
u_result
u_readerGetMatchedPublications (
u_reader _this,
v_statusAction action,
c_voidp arg)
{
v_dataReader reader;
v_spliced spliced;
v_kernel kernel;
u_result result;
c_iter participants;
v_participant participant;
result = U_RESULT_PRECONDITION_NOT_MET;
if (_this != NULL) {
result = u_entityReadClaim(u_entity(_this), (v_entity*)(&reader));
if ((result == U_RESULT_OK) && (reader != NULL)) {
kernel = v_objectKernel(reader);
participants = v_resolveParticipants(kernel, V_SPLICED_NAME);
assert(c_iterLength(participants) == 1);
participant = v_participant(c_iterTakeFirst(participants));
spliced = v_spliced(participant);
c_free(participant);
c_iterFree(participants);
result = u_resultFromKernel(
v_splicedGetMatchedPublications(spliced, v_dataReader(reader), action, arg));
u_entityRelease(u_entity(_this));
}
}
return result;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:34,代码来源:u_reader.c
示例15: getKnownServices
static c_iter
getKnownServices(cf_element root)
{
c_iter services;
cf_element domain;
cf_element el;
cf_element cmd;
cf_data data;
c_iter children;
cf_attribute attr;
struct serviceInfo *si;
assert(root);
services = NULL;
if (root
&& (domain = (cf_element)cf_elementChild(root, "Domain")) )
{
children = cf_elementGetChilds(domain);
while ( (el = c_iterTakeFirst(children)) != NULL)
{
if ( strcmp(cf_nodeGetName(cf_node(el)), "Service") == 0
&& (cmd = (cf_element)cf_elementChild(el, "Command"))
&& (data = cf_data(cf_elementChild(cmd, "#text")))
&& (si = os_malloc(sizeof(struct serviceInfo))))
{
si->command = cf_dataValue(data).is.String;
attr = cf_elementAttribute(el, "name");
if (attr)
{
si->name = cf_attributeValue(attr).is.String;
}
else
{
si->name = si->command;
}
if (!si->name || !si->command)
{
/* detected an invalid service configuration, report and skip */
fprintf(stderr,
"Warning: detected invalid 'Service'"
" element (name = %s; command = %s) -> skip\n",
(si->name?si->name:"<null>"),
(si->command?si->command:"<null>"));
os_free(si);
si = NULL;
}
else
{
services = c_iterInsert(services, si);
}
}
}
c_iterFree(children);
}
return services;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:60,代码来源:osplconf2c.c
示例16: jni_lookupTopic
jni_topic
jni_lookupTopic(
jni_participant p,
const char* name)
{
c_iter topics;
jni_topic topic, temp;
int found;
topic = NULL;
if((name != NULL) && (p != NULL)){
topics = c_iterCopy(p->topics);
found = 0;
temp = jni_topic(c_iterTakeFirst(topics));
while( (temp != NULL) && (!found)){
if(strcmp(jni_topicDescription(temp)->name, name) == 0){
topic = temp;
found = 1;
}
temp = jni_topic(c_iterTakeFirst(topics));
}
c_iterFree(topics);
}
return topic;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:28,代码来源:jni_participant.c
示例17: cmc_entitySetFree
cm_result
cmc_entitySetFree(
cmc_entitySet es)
{
cmc_entity e;
cm_result r;
r = CM_RESULT_OK;
if( (es == NULL) || (es->entities == NULL)){
r = CM_RESULT_BAD_PARAMETER;
} else {
e = cmc_entity(c_iterTakeFirst(es->entities));
while(e != NULL){
r = cmc_entityFree(e);
if(r == CM_RESULT_OK){
e = cmc_entity(c_iterTakeFirst(es->entities));
} else{
e = NULL;
}
}
c_iterFree(es->entities);
os_free(es);
}
return r;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:29,代码来源:cmc_entitySet.c
示例18: u_usrClockConfigElementDataString
static const char *
u_usrClockConfigElementDataString (
const cf_element element,
const char *defaultValue)
{
c_iter children;
const char *data = defaultValue;
c_value dataValue;
c_ulong i;
cf_node node;
assert(element != NULL);
children = cf_elementGetChilds (element);
if (children) {
for (i = 0; i < c_iterLength (children); i++) {
node = c_iterObject (children, i);
if (cf_nodeKind (node) == CF_DATA) {
dataValue = cf_dataValue (cf_data(node));
if (dataValue.kind == V_STRING) {
data = dataValue.is.String;
}
}
}
c_iterFree(children);
}
return data;
}
开发者ID:osrf,项目名称:opensplice,代码行数:31,代码来源:u_usrClock.c
示例19: jni_nameServiceResolveURI
const c_char*
jni_nameServiceResolveURI(
c_long domainId)
{
const c_char* result;
c_iter copy;
jni_mapping mapping;
c_bool found;
result = NULL;
if(mappings != NULL){
copy = c_iterCopy(mappings);
found = FALSE;
mapping = jni_mapping(c_iterTakeFirst(copy));
while((mapping != NULL) && (found == FALSE)){
if(mapping->domainId == domainId){
result = mapping->uri;
found = TRUE;
}
mapping = jni_mapping(c_iterTakeFirst(copy));
}
c_iterFree(copy);
}
/* if not found or mapping == NULL then result == NULL */
return result;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:27,代码来源:jni_nameService.c
示例20: jni_nameServiceFree
jni_result
jni_nameServiceFree()
{
u_result r;
jni_mapping mapping;
r = U_RESULT_OK;
if(ns != NULL){
ns->refCount--;
if(ns->refCount == 0){
mapping = jni_mapping(c_iterTakeFirst(mappings));
while(mapping != NULL){
os_free(mapping->uri);
os_free(mapping);
mapping = jni_mapping(c_iterTakeFirst(mappings));
}
c_iterFree(mappings);
os_free(ns);
ns = NULL;
r = u_userDetach();
} else{
r = U_RESULT_OK;
}
} else{
r = U_RESULT_NOT_INITIALISED;
}
return jni_convertResult(r);
}
开发者ID:diorahman,项目名称:opensplice,代码行数:30,代码来源:jni_nameService.c
注:本文中的c_iterFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论