当前位置: 首页>>代码示例>>C++>>正文


C++ c_getBase函数代码示例

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


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

示例1: v_listenerNew

v_listener
v_listenerNew(
    v_participant p,
    c_bool combine)
{
    v_listener _this;
    v_kernel kernel;

    assert(C_TYPECHECK(p,v_participant));

    kernel = v_objectKernel(p);
    _this = v_listener(v_objectNew(kernel,K_LISTENER));
    if (_this != NULL) {
        v_publicInit(v_public(_this));
        (void)c_mutexInit(c_getBase(_this), &_this->mutex);
        c_condInit(c_getBase(_this), &_this->cv, &_this->mutex);
        _this->participant = p;
        _this->eventList = NULL;
        _this->lastEvent = NULL;
        v_participantAdd(p, v_object(_this));
        _this->terminate = FALSE;
        _this->waitCount = 0;
        _this->combine = combine;
    }

    return _this;
}
开发者ID:osrf,项目名称:opensplice,代码行数:27,代码来源:v_listener.c

示例2: idl_genXMLmeta

char *
idl_genXMLmeta (
    c_type type)
{
    sd_serializer metaSer;
    sd_serializedData serData;
    char *metaDescription = NULL;
    c_iter replaceInfo;
    c_iter replaceInfoStac;

    replaceInfo = idl_catsDefConvertAll(idl_catsDefDefGet());
    replaceInfoStac = idl_stacDefConvertAll(idl_stacDefDefGet());
    metaSer = sd_serializerXMLTypeinfoNew (c_getBase(c_object(type)), TRUE);
    if (metaSer)
    {
        serData = sd_serializerSerialize (metaSer, c_object(type));
        if (serData)
        {
	    metaDescription = sd_serializerToString (metaSer, serData);
	}
        sd_serializerFree (metaSer);
    }
    idl_catsDefRestoreAll(idl_catsDefDefGet(), replaceInfo);
    idl_stacDefRestoreAll(idl_stacDefDefGet(), replaceInfoStac);
    return metaDescription;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:26,代码来源:idl_genMetaHelper.c

示例3: v_cacheNew

v_cache
v_cacheNew (
    v_kernel kernel,
    c_type type,
    v_cacheKind kind)
{
    c_base base = NULL;
    c_type cache_t;
    v_cache cache = NULL;

    assert(C_TYPECHECK(cache,v_cache));
    assert(C_TYPECHECK(type,c_type));

    if (type) {
        base = c_getBase(type);
        if (base) {
            cache_t = c_keep(v_kernelType(kernel,K_CACHE));
            cache = c_new(cache_t);
            c_free(cache_t);
            if (cache) {
                cache->kind = kind;
                cache->itemType = c_keep(type);
                v_cacheNodeInit(v_cacheNode(cache));
            }
        }
    }
    return cache;
}
开发者ID:xrl,项目名称:opensplice,代码行数:28,代码来源:v_cache.c

示例4: v_subscriberUnSubscribe

void
v_subscriberUnSubscribe(
    v_subscriber s,
    const c_char *partitionExpr)
{
    v_partition d;
    v_dataReaderConnectionChanges arg;
    v_partitionPolicy old;

    assert(s != NULL);
    assert(C_TYPECHECK(s,v_subscriber));

    arg.addedPartitions = NULL;

    c_lockWrite(&s->lock);

    arg.removedPartitions = v_partitionAdminRemove(s->partitions, partitionExpr);
    old = s->qos->partition;
    s->qos->partition = v_partitionPolicyRemove(old, partitionExpr,
                                                c_getBase(c_object(s)));
    c_free(old);
    c_setWalk(s->readers, qosChangedAction, &arg);

    d = v_partition(c_iterTakeFirst(arg.removedPartitions));
    while (d != NULL) {
        c_free(d);
        d = v_partition(c_iterTakeFirst(arg.removedPartitions));
    }
    c_iterFree(arg.removedPartitions);

    c_lockUnlock(&s->lock);
}
开发者ID:S73417H,项目名称:opensplice,代码行数:32,代码来源:v_subscriber.c

示例5: v_messageEOTExtConvertFromExtType

v_message
v_messageEOTExtConvertFromExtType (
    v_messageEOTExt xmsg_eot)
{
    c_type msgType = c_resolve(c_getBase((c_object)xmsg_eot), "kernelModuleI::v_messageEOT");
    return v_messageExtConvertFromExtType (msgType, (v_messageExt) xmsg_eot);
}
开发者ID:osrf,项目名称:opensplice,代码行数:7,代码来源:v_messageExt.c

示例6: v_historicalDataRequestNew

v_historicalDataRequest
v_historicalDataRequestNew(
    v_kernel kernel,
    c_char* filter,
    c_char* params[],
    c_ulong nofParams,
    c_time minSourceTime,
    c_time maxSourceTime,
    struct v_resourcePolicy *resourceLimits)
{
    v_historicalDataRequest request;
    c_ulong i;
    c_type type;
    c_base base;

    request = c_new(v_kernelType(kernel,K_HISTORICALDATAREQUEST));

    if (request) {
        if(filter){
            base            = c_getBase(kernel);
            request->filter = c_stringNew(base, filter);

            if(params){
                type                  = c_string_t(base);
                request->filterParams = c_arrayNew(type, nofParams);

                for(i=0; i<nofParams; i++){
                    request->filterParams[i] = c_stringNew(base, params[i]);
                }
            } else {
                request->filterParams = NULL;
            }
        } else {
            request->filter       = NULL;
            request->filterParams = NULL;
        }
        if ((minSourceTime.seconds     == C_TIME_INVALID.seconds) &&
            (minSourceTime.nanoseconds == C_TIME_INVALID.nanoseconds)) {
            request->minSourceTimestamp = C_TIME_ZERO;
        } else {
            request->minSourceTimestamp  = minSourceTime;
        }
        if ((maxSourceTime.seconds     == C_TIME_INVALID.seconds) &&
            (maxSourceTime.nanoseconds == C_TIME_INVALID.nanoseconds)) {
            request->maxSourceTimestamp = C_TIME_INFINITE;
        } else {
            request->maxSourceTimestamp  = maxSourceTime;
        }
        request->resourceLimits.max_samples              = resourceLimits->max_samples;
        request->resourceLimits.max_instances            = resourceLimits->max_instances;
        request->resourceLimits.max_samples_per_instance = resourceLimits->max_samples_per_instance;
    } else {
        OS_REPORT(OS_ERROR,
                  "v_historicalDataRequestNew",0,
                  "Failed to allocate request.");
        assert(FALSE);
    }

    return request;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:60,代码来源:v_historicalDataRequest.c

示例7: cmx_participantRegisterType

const c_char*
cmx_participantRegisterType(
    const c_char* participant,
    const c_char* type)
{
    sd_serializer serializer;
    sd_serializedData meta_data;
    cmx_entityKernelArg kernelArg;
    c_type topicType;
    cmx_entity ce;
    const c_char* result;
    const c_char* msg;

    ce = cmx_entityClaim(participant);
    if(ce != NULL){
        kernelArg = cmx_entityKernelArg(os_malloc(C_SIZEOF(cmx_entityKernelArg)));
        if (u_observableAction(u_observable(ce->uentity),
                               cmx_entityKernelAction,
                               (c_voidp)kernelArg) == U_RESULT_OK)
        {
            serializer = sd_serializerXMLMetadataNew(c_getBase(c_object(kernelArg->kernel)));

            if(serializer != NULL){
                meta_data = sd_serializerFromString(serializer, type);

                if (meta_data != NULL) {
                    topicType = c_type(sd_serializerDeserialize(serializer, meta_data));

                    if (topicType == NULL) {
                        msg = sd_serializerLastValidationMessage(serializer);
                        OS_REPORT(OS_ERROR,
                                  CM_XML_CONTEXT, 0,
                                  "Data type could not be registered, "
                                  "because it is not valid: %s",
                                  msg);
                        result = CMX_RESULT_FAILED;
                    } else {
                        result = CMX_RESULT_OK;
                    }
                    sd_serializedDataFree(meta_data);
                } else {
                    OS_REPORT(OS_ERROR, CM_XML_CONTEXT, 0, "Construction of serialized data failed.");
                    result = CMX_RESULT_FAILED;
                }
                sd_serializerFree(serializer);
            } else {
                OS_REPORT(OS_ERROR, CM_XML_CONTEXT, 0, "Serializer could not be initialized");
                result = CMX_RESULT_FAILED;
            }
        } else {
            OS_REPORT(OS_ERROR, CM_XML_CONTEXT, 0, "Kernel object could not be retrieved");
            result = CMX_RESULT_FAILED;
        }
        os_free(kernelArg);
        cmx_entityRelease(ce);
    } else {
        result = CMX_RESULT_FAILED;
    }
    return result;
}
开发者ID:osrf,项目名称:opensplice,代码行数:60,代码来源:cmx_participant.c

示例8: v_persistentSnapshotRequestNew

v_persistentSnapshotRequest
v_persistentSnapshotRequestNew(
    v_kernel kernel,
    const c_char* partition_expression,
    const c_char* topic_expression,
    const c_char* uri)
{
    v_persistentSnapshotRequest request;
    c_base base;

    request = c_new(v_kernelType(kernel,K_PERSISTENTSNAPSHOTREQUEST));
    if(request)
    {
        base = c_getBase(kernel);
        if(partition_expression)
        {
            request->partitionExpr = c_stringNew(base, partition_expression);
        }
        if(topic_expression)
        {
            request->topicExpr = c_stringNew(base, topic_expression);
        }
        if(uri)
        {
            request->uri = c_stringNew(base, uri);
        }
    } else {
        OS_REPORT(OS_ERROR,
                  "v_kernel::v_persistentSnapshotRequest",0,
                  "Failed to create v_persistentSnapshotRequest object.");
        assert(FALSE);
    }

    return request;
}
开发者ID:diorahman,项目名称:opensplice,代码行数:35,代码来源:v_kernel.c

示例9: v_networkQueueStatisticsNew

v_networkQueueStatistics v_networkQueueStatisticsNew(v_kernel k, const c_char *name)
{
    v_networkQueueStatistics nqs;
    c_string channelName;

    assert(k != NULL);
    assert(C_TYPECHECK(k, v_kernel));

    if (networkQueueStatisticsType == NULL) {
        networkQueueStatisticsType = c_resolve(c_getBase(k), "kernelModule::v_networkQueueStatistics");
    }
    nqs = v_networkQueueStatistics(v_new(k, networkQueueStatisticsType));
    channelName = c_stringNew(c_getBase(c_object(k)),name);
    v_networkQueueStatisticsInit(nqs,channelName);
    return nqs;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:16,代码来源:v_networkQueueStatistics.c

示例10: d_publisherNewGroupWriterCopy

c_bool
d_publisherNewGroupWriterCopy(
    c_type type,
    void *data,
    void *to)
{
    c_bool result;
    d_newGroup msgFrom    = (d_newGroup)data;
    d_newGroup msgTo      = (d_newGroup)to;
    c_base base           = c_getBase(type);

    result = d_publisherMessageWriterCopy(&msgFrom->parentMsg, &msgTo->parentMsg);

    if(msgFrom->partition){
        msgTo->partition = c_stringNew(base, msgFrom->partition);
    } else {
        msgTo->partition = NULL;
    }
    if(msgFrom->topic){
        msgTo->topic = c_stringNew(base, msgFrom->topic);
    } else {
        msgTo->topic = NULL;
    }
    msgTo->completeness   = msgFrom->completeness;
    msgTo->durabilityKind = msgFrom->durabilityKind;
    msgTo->quality        = msgFrom->quality;
    msgTo->alignerCount   = msgFrom->alignerCount;

    return result;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:30,代码来源:d_publisher.c

示例11: d_publisherDeleteDataWriterCopy

c_bool
d_publisherDeleteDataWriterCopy(
    c_type type,
    void *data,
    void *to)
{
    c_bool result;
    d_deleteData msgFrom = d_deleteData(data);
    d_deleteData msgTo   = d_deleteData(to);
    c_base base          = c_getBase(type);

    result = d_publisherMessageWriterCopy(&msgFrom->parentMsg, &msgTo->parentMsg);

    msgTo->actionTime.seconds       = msgFrom->actionTime.seconds;
    msgTo->actionTime.nanoseconds   = msgFrom->actionTime.nanoseconds;

    if(msgFrom->partitionExpr) {
        msgTo->partitionExpr = c_stringNew(base, msgFrom->partitionExpr);
    } else {
        msgTo->partitionExpr = NULL;
    }
    if(msgFrom->topicExpr) {
        msgTo->topicExpr = c_stringNew(base, msgFrom->topicExpr);
    } else {
        msgTo->topicExpr = NULL;
    }
    return result;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:28,代码来源:d_publisher.c

示例12: v_groupCacheNew

v_cache
v_groupCacheNew (
    v_kernel kernel,
    v_cacheKind kind)
{
    c_base base;
    c_type type;
    v_cache cache;

    assert(C_TYPECHECK(kernel,v_kernel));

    base = c_getBase(kernel);
    type = c_keep(v_kernelType(kernel,K_GROUPCACHEITEM));
    cache = v_cacheNew(kernel,type,kind);
    c_free(type);

    if (!cache) {
        OS_REPORT(OS_ERROR,
                  "v_groupCacheNew",0,
                  "Failed to allocate group cache.");
    }

    assert(C_TYPECHECK(cache, v_cache));

    return cache;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:26,代码来源:v_groupCache.c

示例13: d_publisherGroupsRequestWriterCopy

c_bool
d_publisherGroupsRequestWriterCopy(
    c_type type,
    void *data,
    void *to)
{
    c_bool result;
    d_groupsRequest msgFrom = (d_groupsRequest)data;
    d_groupsRequest msgTo   = (d_groupsRequest)to;
    c_base base             = c_getBase(type);

    result = d_publisherMessageWriterCopy(&d_groupsRequest(data)->parentMsg, &d_groupsRequest(to)->parentMsg);

    if(msgFrom->partition){
        msgTo->partition = c_stringNew(base, msgFrom->partition);
    } else {
        msgTo->partition = NULL;
    }
    if(msgFrom->topic){
        msgTo->topic = c_stringNew(base, msgFrom->topic);
    } else {
        msgTo->topic = NULL;
    }

    return result;
}
开发者ID:S73417H,项目名称:opensplice,代码行数:26,代码来源:d_publisher.c

示例14: v_participantCandMCommandSetDisposeAllData

v_result v_participantCandMCommandSetDisposeAllData(v_participant participant,
                                                    v_message msg,
                                                    char *topicExpr,
                                                    char *partitionExpr)
{
    v_kernel kernel;
    v_topic topic;
    c_base base;
    v_controlAndMonitoringCommand *command;
    struct v_commandDisposeAllData *disposeCmd;

    assert(participant != NULL);
    assert(C_TYPECHECK(participant,v_participant));
    assert(msg != NULL );
    assert(C_TYPECHECK(msg,v_message));

    kernel = v_objectKernel(participant);
    topic = v_builtinTopicLookup(kernel->builtin, V_C_AND_M_COMMAND_ID);
    command = v_builtinControlAndMonitoringCommandData(kernel->builtin, msg);
    command->u._d = V_COMMAND_DISPOSE_ALL_DATA;
    base = c_getBase(c_object(topic));

    disposeCmd = &command->u._u.dispose_all_data_info;
    disposeCmd->topicExpr = c_stringNew(base, topicExpr);
    disposeCmd->partitionExpr = c_stringNew(base, partitionExpr);

    return ( ( disposeCmd->topicExpr != NULL
               && disposeCmd->partitionExpr != NULL )
             ? V_RESULT_OK
             : V_RESULT_OUT_OF_MEMORY );
}
开发者ID:xrl,项目名称:opensplice,代码行数:31,代码来源:v_participant.c

示例15: cmx_writerDataTypeAction

void
cmx_writerDataTypeAction(
    v_entity entity,
    c_voidp args)
{
    sd_serializer ser;
    sd_serializedData data;
    c_type type;
    struct cmx_writerTypeArg *arg;
    arg = (struct cmx_writerTypeArg *)args;
    
    type = NULL;
    
    switch(v_object(entity)->kind){
    case K_WRITER:
        type = v_topicDataType(v_writer(entity)->topic);      
    break;
    default:
        OS_REPORT(OS_ERROR, CM_XML_CONTEXT, 0, "Trying to resolve dataType of writer that is not a writer.\n");
        assert(FALSE);
    break;
    }
    
    if(type != NULL){
        ser = sd_serializerXMLMetadataNew(c_getBase(type));
        data = sd_serializerSerialize(ser, type);
        arg->result = sd_serializerToString(ser, data);
        sd_serializedDataFree(data);
        sd_serializerFree(ser);
    }
}
开发者ID:diorahman,项目名称:opensplice,代码行数:31,代码来源:cmx_writer.c


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