void v_participantInit( v_participant p, const c_char *name, v_participantQos qos, v_statistics s, c_bool enable) { v_kernel kernel; c_base base; v_message builtinMsg; c_type writerProxyType; assert(C_TYPECHECK(p,v_participant)); assert(C_TYPECHECK(qos, v_participantQos)); kernel = v_objectKernel(p); base = c_getBase(p); v_observerInit(v_observer(p),name,s,enable); p->entities = c_setNew(c_resolve(base,"kernelModule::v_entity")); p->qos = c_keep(qos); /* Currently default LIVELINESS policy is used: kind=AUTOMATIC, * duration=INFINITE This setting implies no lease registration. */ p->lease = NULL; p->leaseManager = v_leaseManagerNew(kernel); p->resendQuit = FALSE; c_mutexInit(&p->resendMutex, SHARED_MUTEX); c_condInit(&p->resendCond, &p->resendMutex, SHARED_COND); writerProxyType = v_kernelType(kernel,K_PROXY); p->resendWriters = c_tableNew(writerProxyType, "source.index,source.serial"); p->builtinSubscriber = NULL; if (!v_observableAddObserver(v_observable(kernel),v_observer(p), NULL)) { if (name != NULL) { OS_REPORT_1(OS_WARNING,"Kernel Participant",0, "%s: Cannot observe Kernel events",name); } else { OS_REPORT(OS_WARNING,"Kernel Participant",0, "Cannot observe Kernel events"); } } c_mutexInit(&p->newGroupListMutex,SHARED_MUTEX); p->newGroupList = c_listNew(c_resolve(base, "kernelModule::v_group")); v_observerSetEventMask(v_observer(p), V_EVENT_NEW_GROUP); c_lockInit(&p->lock,SHARED_LOCK); c_mutexInit(&p->builtinLock,SHARED_MUTEX); /* Here the Builtin Topic of the participant is published. * This call mabe a noop in case builtin is disabled on kernel level. */ builtinMsg = v_builtinCreateParticipantInfo(kernel->builtin,p); v_writeBuiltinTopic(kernel, V_PARTICIPANTINFO_ID, builtinMsg); c_free(builtinMsg); }
c_bool d_publisherSampleChainWriterCopy( c_type type, void *data, void *to) { d_sampleChain msgFrom = d_sampleChain(data); d_sampleChain msgTo = d_sampleChain(to); c_base base = c_getBase(type); static c_type type0 = NULL; static c_type type1 = NULL; unsigned int valueSize; d_publisherMessageWriterCopy(&msgFrom->parentMsg, &msgTo->parentMsg); msgTo->partition = c_stringNew(base, msgFrom->partition); msgTo->topic = c_stringNew(base, msgFrom->topic); msgTo->durabilityKind = msgFrom->durabilityKind; msgTo->msgBody._d = msgFrom->msgBody._d; msgTo->addresseesCount = msgFrom->addresseesCount; assert(msgTo->addresseesCount > 0); if (type1 == NULL) { type1 = c_resolve(base, "durabilityModule2::d_networkAddress_s"); } assert(type1 != NULL); msgTo->addressees = c_arrayNew(type1, msgTo->addresseesCount); assert(msgTo->addressees); memcpy(msgTo->addressees, msgFrom->addressees, msgTo->addresseesCount*C_SIZEOF(d_networkAddress)); msgTo->source.systemId = msgFrom->source.systemId; msgTo->source.localId = msgFrom->source.localId; msgTo->source.lifecycleId = msgFrom->source.lifecycleId; switch(msgTo->msgBody._d) { case BEAD: if (type0 == NULL) { type0 = c_resolve(base, "c_octet"); } assert(type0 != NULL); valueSize = msgFrom->msgBody._u.bead.size; msgTo->msgBody._u.bead.size = valueSize; msgTo->msgBody._u.bead.value = c_arrayNew(type0, valueSize); memcpy(msgTo->msgBody._u.bead.value, msgFrom->msgBody._u.bead.value, valueSize); break; case LINK: msgTo->msgBody._u.link.nrSamples = msgFrom->msgBody._u.link.nrSamples; msgTo->msgBody._u.link.completeness = msgFrom->msgBody._u.link.completeness; break; default: OS_REPORT_1(OS_ERROR, "d_publisherSampleChainWriterCopy", 0, "Illegal message body discriminant value (%d) detected.", msgTo->msgBody._d); assert(FALSE); } return TRUE; }
d_storeMMFKernel d_storeMMFKernelNew ( c_base base, const c_char *name) { d_storeMMFKernel kernel, found; c_type type; c_bool success; /* load meta-data */ success = loadkernelModule(base); assert(success); success = loaddurabilityModule2(base); assert(success); /* create storeKernel */ type = c_resolve(base,"durabilityModule2::d_storeMMFKernel"); kernel = (d_storeMMFKernel)c_new(type); c_free(type); if(kernel) { /* Init storeKernel members */ /* groups is a table of d_groupInfo with topic+partition as key */ type = c_resolve(base,"durabilityModule2::d_groupInfo"); assert(type); kernel->groups = c_tableNew(type, "partition,topic.name"); kernel->backup = c_tableNew(type, "partition,topic.name"); c_free(type); type = c_resolve(base,"durabilityModule2::d_topicInfo"); assert(type); kernel->topics = c_tableNew(type, "name"); c_free(type); type = c_resolve(base,"durabilityModule2::d_nameSpaceInfo"); assert(type); kernel->nameSpaces = c_tableNew(type, "name"); c_free(type); /* bind storeKernel */ found = ospl_c_bind(kernel, name); assert(found == kernel); } else { OS_REPORT(OS_ERROR, "d_storeMMFKernelNew",0, "Failed to allocate kernel."); found = NULL; } return found; }
v_deadLineInstanceList v_deadLineInstanceListNew( c_base base, v_leaseManager leaseManager, v_duration leaseDuration, v_leaseActionId actionId, v_public o) { v_deadLineInstanceList list; c_type type; assert(C_TYPECHECK(leaseManager,v_leaseManager)); assert(C_TYPECHECK(o,v_public)); type = c_resolve(base, "kernelModule::v_deadLineInstanceList"); assert(type); list = c_new(type); c_free(type); if (list) { v_objectKind(list) = K_DEADLINEINSTANCE; v_instanceInit(v_instance(list)); list->leaseManager = c_keep(leaseManager); list->leaseDuration = leaseDuration; list->deadlineLease = NULL; list->actionObject = o; /* no keep, since actionObject is onwer of v_deadLineInstanceList */ list->actionId = actionId; } else { OS_REPORT(OS_ERROR, "v_deadLineInstanceListNew",0, "Failed to allocate v_deadLineInstanceList."); } return list; }
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); }
static c_type messageTypeNew( c_base base, const c_char *typeName) { c_metaObject o; c_type baseType,dataType,type, foundType; c_char *name; c_long length, sres; if (base == NULL) { return NULL; } dataType = c_resolve(base,typeName); if (dataType == NULL) { return NULL; } baseType = c_resolve(base, "kernelModule::v_message"); assert(baseType != NULL); type = c_type(c_metaDefine(c_metaObject(base),M_CLASS)); c_class(type)->extends = c_keep(c_class(baseType)); o = c_metaDeclare(c_metaObject(type), USERDATA_FIELD_NAME, M_ATTRIBUTE); c_property(o)->type = dataType; c_free(o); c_metaObject(type)->definedIn = c_keep(base); c_metaFinalize(c_metaObject(type)); #define MESSAGE_FORMAT "v_message<%s>" #define MESSAGE_NAME "v_message<>" length = sizeof(MESSAGE_NAME) + strlen(typeName); name = os_malloc(length); sres = snprintf(name,length,MESSAGE_FORMAT,typeName); assert(sres == (length-1)); #undef MESSAGE_FORMAT #undef MESSAGE_NAME foundType = c_type(c_metaBind(c_metaObject(base),name,c_metaObject(type))); os_free(name); c_free(type); return foundType; }
c_type in_messageQosType ( c_base base) { if (_v_messageQos_t == NULL) { _v_messageQos_t = c_resolve(base,"kernelModule::v_messageQos"); } return _v_messageQos_t; }
c_type c_field_t ( c_base _this) { if (_this->baseCache.fieldCache.c_field_t == NULL) { _this->baseCache.fieldCache.c_field_t = c_resolve(_this,"c_field"); } return _this->baseCache.fieldCache.c_field_t; }
v_networkReader v_networkReaderNew( v_subscriber subscriber, const c_char *name, v_readerQos qos, c_bool ignoreReliabilityQoS) { /* Note: currently, no qos-es are supported. Everything is redirected * to the defaultQueue */ v_kernel kernel; v_networkReader reader; v_readerQos q; v_statistics s; c_type queueType; c_long i; assert(C_TYPECHECK(subscriber,v_subscriber)); /* Creation */ kernel = v_objectKernel(subscriber); q = v_readerQosNew(kernel,qos); if (q != NULL) { reader = v_networkReader(v_objectNew(kernel,K_NETWORKREADER)); s = v_statistics(v_networkReaderStatisticsNew(kernel)); /* Initialization of parent */ v_readerInit(v_reader(reader), name, subscriber, q, s, TRUE); c_free(q); /* ref now in v_reader(queue)->qos */ /* This function only ever called once per network instance so no * need to store queueType as static variable. Look up as needed (once) */ queueType = c_resolve(c_getBase(subscriber),"kernelModule::v_networkQueue"); /* Initialization of self */ reader->queues = NULL; reader->queues = c_arrayNew(queueType, NW_MAX_NOF_QUEUES); reader->nofQueues = 0; reader->defaultQueue = NULL; reader->remoteActivity = FALSE; reader->ignoreReliabilityQoS = ignoreReliabilityQoS; reader->queueCache = c_arrayNew(queueType, 2*NW_MAX_QUEUE_CACHE_PRIO); for( i= 0; i < 2*NW_MAX_QUEUE_CACHE_PRIO; i++) { reader->queueCache[i] = NULL; } c_free(queueType); /* Add to subscriber */ v_subscriberAddReader(subscriber,v_reader(reader)); } else { OS_REPORT(OS_ERROR, "v_networkReaderNew", 0, "NetworkReader not created: inconsistent qos"); reader = NULL; } return reader; }
v_messageEOTExt v_messageEOTExtCopyToExtType ( const struct v_messageEOT_s *vmsg) { c_type xmsgType = c_resolve(c_getBase((c_object)vmsg), "kernelModule::v_messageEOTExt"); v_messageEOTExt xmsg; xmsg = c_new (xmsgType); c_free(xmsgType); v_messageEOTExtConvertToExtNoAllocTime (xmsg, vmsg); return xmsg; }
d_storeResult d_groupInfoBackup( d_groupInfo _this, const d_store store, d_groupInfo* backup) { c_base base; c_type groupInfoType, instanceType; c_string keyExpr; d_storeResult result; assert(_this); assert(backup); base = c_getBase(_this->kernel); groupInfoType = c_resolve(base,"durabilityModule2::d_groupInfo"); *backup = d_groupInfo(c_new(groupInfoType)); c_free(groupInfoType); if (*backup) { (*backup)->kernel = _this->kernel; /* Unmanaged pointer */ (*backup)->topic = c_keep(_this->topic); (*backup)->partition = c_keep(_this->partition); (*backup)->quality = _this->quality; (*backup)->completeness = _this->completeness; instanceType = d_topicInfoGetInstanceType(_this->topic); keyExpr = d_topicInfoGetInstanceKeyExpr(_this->topic); (*backup)->instances = _this->instances; /*Here's the trick */ _this->instances = c_tableNew(instanceType, keyExpr); c_free(keyExpr); c_free(instanceType); if(_this->instances){ result = D_STORE_RESULT_OK; } else { _this->instances = (*backup)->instances; (*backup)->instances = NULL; c_free(*backup); *backup = NULL; result = D_STORE_RESULT_OUT_OF_RESOURCES; } } else { assert(FALSE); result = D_STORE_RESULT_OUT_OF_RESOURCES; } return result; }
c_scope c_scopeNew( c_base base) { c_scope o; o = c_scope(c_new(c_resolve(base,"c_scope"))); if (o) { c_scopeInit(o); } return o; }
void v_cfElementInit ( v_cfElement element, v_configuration config, const c_char *tagName) { c_type attrType; c_type nodeType; const c_char *keyList; assert(C_TYPECHECK(element, v_cfElement)); assert(tagName != NULL); v_cfNodeInit(v_cfNode(element), config, V_CFELEMENT, tagName); attrType = c_resolve(c_getBase(element), "kernelModule::v_cfAttribute"); nodeType = c_resolve(c_getBase(element), "kernelModule::v_cfNode"); keyList = "name"; element->attributes = c_tableNew(attrType, keyList); element->children = c_setNew(nodeType); }
c_bool d_publisherSampleRequestWriterCopy( c_type type, void *data, void *to) { c_bool result; c_ulong i; static c_type type3; d_sampleRequest msgFrom = d_sampleRequest(data); d_sampleRequest msgTo = d_sampleRequest(to); c_base base = c_getBase(type); result = d_publisherMessageWriterCopy(&msgFrom->parentMsg, &msgTo->parentMsg); msgTo->partition = c_stringNew(base, msgFrom->partition); msgTo->topic = c_stringNew(base, msgFrom->topic); msgTo->durabilityKind = msgFrom->durabilityKind; msgTo->requestTime = msgFrom->requestTime; msgTo->withTimeRange = msgFrom->withTimeRange; msgTo->beginTime = msgFrom->beginTime; msgTo->endTime = msgFrom->endTime; msgTo->source.systemId = msgFrom->source.systemId; msgTo->source.localId = msgFrom->source.localId; msgTo->source.lifecycleId = msgFrom->source.lifecycleId; if(msgFrom->filter){ msgTo->filter = c_stringNew(base, msgFrom->filter); } else { msgTo->filter = NULL; } if(msgFrom->filterParams){ if (type3 == NULL) { type3 = c_resolve(base, "c_string"); } assert(type3 != NULL); msgTo->filterParamsCount = msgFrom->filterParamsCount; msgTo->filterParams = c_arrayNew(type3, msgFrom->filterParamsCount); for(i=0; i<msgFrom->filterParamsCount; i++){ msgTo->filterParams[i] = c_stringNew(base, msgFrom->filterParams[i]); } } msgTo->maxSamples = msgFrom->maxSamples; msgTo->maxInstances = msgFrom->maxInstances; msgTo->maxSamplesPerInstance = msgFrom->maxSamplesPerInstance; return result; }
v_handleServer v_handleServerNew ( c_base base) { v_handleServer server; c_type type; assert(base != NULL); type = c_resolve(base,"kernelModule::v_handleServer"); server = c_new(type); c_free(type); if (server) { type = c_resolve(base,"kernelModule::v_handleInfoList"); server->handleInfos = c_arrayNew(type,NROFCOL); #ifdef DDS_1958_CANNOT_CALL_REGISTERED_FUNC_PTR_FROM_DIFF_PROCESS server->lowMemWarningCount = 0; #endif c_free(type); if (server->handleInfos) { server->firstFree = NOHANDLE; server->lastIndex = NOHANDLE; server->suspended = FALSE; c_mutexInit(&server->mutex,SHARED_MUTEX); c_baseOnOutOfMemory(base, disableHandleServer,server); c_baseOnLowOnMemory(base, issueLowMemoryWarning, server); } else { c_free(server); server = NULL; OS_REPORT(OS_ERROR,"v_handleServerNew",0, "Failed to allocate handle info records"); } } else { OS_REPORT(OS_ERROR,"v_handleServerNew",0, "Failed to allocate handle server"); } return server; }
/************************************************************** * constructor/destructor **************************************************************/ v_cfNode v_cfNodeNew( v_configuration config, v_cfKind kind) { v_cfNode node; c_type type; assert(C_TYPECHECK(config, v_configuration)); switch (kind) { case V_CFELEMENT: type = c_resolve(c_getBase(config), "kernelModule::v_cfElement"); break; case V_CFATTRIBUTE: type = c_resolve(c_getBase(config), "kernelModule::v_cfAttribute"); break; case V_CFDATA: type = c_resolve(c_getBase(config), "kernelModule::v_cfData"); break; case V_CFNODE: default: OS_REPORT_1(OS_ERROR,"v_cfNodeNew failed",0,"Illegal kind (%d) specified",kind); assert(FALSE); type = NULL; break; } if (type != NULL) { node = c_new(type); } else { node = NULL; } /* init is done by specific class itself, this is just a convenience function! */ return node; }
d_groupInfo d_groupInfoNew ( const d_storeMMFKernel kernel, const d_topicInfo topic, const d_group dgroup) { d_groupInfo group; c_base base; c_char* partition; c_type instanceType, groupInfoType; c_char *keyExpr; if(kernel && topic && dgroup){ base = c_getBase(kernel); groupInfoType = c_resolve(base,"durabilityModule2::d_groupInfo"); group = d_groupInfo(c_new(groupInfoType)); c_free(groupInfoType); if (group) { group->kernel = kernel; /* Unmanaged pointer */ group->topic = c_keep(topic); partition = d_groupGetPartition(dgroup); group->partition = c_stringNew(base, partition); os_free(partition); group->quality = d_groupGetQuality(dgroup); group->completeness = d_groupGetCompleteness(dgroup); instanceType = d_topicInfoGetInstanceType(topic); keyExpr = d_topicInfoGetInstanceKeyExpr(topic); group->instances = c_tableNew(instanceType, keyExpr); c_free(keyExpr); c_free(instanceType); } else { OS_REPORT(OS_ERROR, "d_groupInfoNew",0, "Failed to allocate d_groupInfo."); assert(FALSE); group = NULL; } } else { OS_REPORT(OS_ERROR, "d_groupInfoNew",0, "Illegal constructor parameter."); group = NULL; } return group; }
/************************************************************** * Protected functions **************************************************************/ void v_collectionInit( v_collection c, const c_char *name, v_statistics s, c_bool enable) { c_base base; assert(C_TYPECHECK(c,v_collection)); v_observerInit(v_observer(c), name, s, enable); base = c_getBase(c_object(c)); c->queries = c_setNew(c_resolve(base,"kernelModule::v_query")); }
v_durabilityStatistics v_durabilityStatisticsNew(v_kernel k) { v_durabilityStatistics ds; c_type durabilityStatisticsType; assert(k != NULL); assert(C_TYPECHECK(k, v_kernel)); /* not necessary to cache this type since it is looked up only once per process */ durabilityStatisticsType = c_resolve(c_getBase(k), "kernelModuleI::v_durabilityStatistics"); ds = v_durabilityStatistics(v_new(k, durabilityStatisticsType)); v_durabilityStatisticsInit(ds); return ds; }
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; }
void v_networkingStatisticsInit( v_networkingStatistics _this, v_kernel k) { assert(_this != NULL); assert(C_TYPECHECK(_this, v_networkingStatistics)); v_statisticsInit(v_statistics(_this)); _this->numberOfErrors = 0; _this->channelsCount = 0; _this->channels = c_arrayNew(c_resolve(c_getBase(c_object(k)), "kernelModule::v_networkChannelStatistics"),64); }
void createField( v_entity entity, c_voidp argument ) { c_type type; c_metaObject userData; struct createFieldArg * arg = (struct createFieldArg *)argument; type = c_resolve(c_getBase(entity), arg->typeName); assert(type != NULL); userData = c_metaResolve(c_metaObject(type), arg->fieldName); c_free(type); arg->fieldOffset = c_property(userData)->offset; c_free(userData); }
static c_type createInstanceType( c_type messageType, d_topicInfo topicInfo) { c_type instanceType, baseType, foundType; c_metaObject o; c_char *name; c_long length,sres; c_base base; base = c_getBase(messageType); baseType = c_resolve(base,"durabilityModule2::d_instanceTemplate"); assert(baseType != NULL); instanceType = c_type(c_metaDefine(c_metaObject(base),M_CLASS)); c_class(instanceType)->extends = c_class(baseType); foundType = createTopicKeyType(messageType, topicInfo->keyExpr); if ( foundType != NULL) { o = c_metaDeclare(c_metaObject(instanceType),"key",M_ATTRIBUTE); c_property(o)->type = foundType; c_free(o); } c_metaObject(instanceType)->definedIn = c_keep(base); c_metaFinalize(c_metaObject(instanceType)); #define INSTANCE_NAME "d_instance<d_sample<>>" #define INSTANCE_FORMAT "d_instance<d_sample<%s>>" length = sizeof(INSTANCE_NAME) + strlen(topicInfo->name); name = os_malloc(length); sres = snprintf(name,length,INSTANCE_FORMAT,topicInfo->name); assert(sres == (length-1)); #undef INSTANCE_NAME #undef INSTANCE_FORMAT foundType = c_type(c_metaBind(c_metaObject(base), name, c_metaObject(instanceType))); os_free(name); c_free(instanceType); return foundType; }
static c_type createSampleType( c_type messageType, const c_char* topicName) { c_base base; c_type sampleType, baseType, foundType, found; c_metaObject o; c_char *name; c_long length,sres; base = c_getBase(messageType); baseType = c_resolve(base, "durabilityModule2::d_sample"); assert(baseType != NULL); sampleType = c_type(c_metaDefine(c_metaObject(base),M_CLASS)); c_class(sampleType)->extends = c_class(baseType); o = c_metaDefine(c_metaObject(sampleType),M_ATTRIBUTE); c_property(o)->type = c_keep(messageType); found = c_type(c_metaBind(c_metaObject(sampleType),"message",o)); c_free(o); c_free(found); c_metaObject(sampleType)->definedIn = c_keep(base); c_metaFinalize(c_metaObject(sampleType)); #define SAMPLE_NAME "d_sample<>" #define SAMPLE_FORMAT "d_sample<%s>" /* Create a name and bind type to name */ /* The sizeof contains \0 */ length = sizeof(SAMPLE_NAME) + strlen(topicName); name = os_malloc(length); sres = snprintf(name,length,SAMPLE_FORMAT,topicName); assert(sres == (length-1)); #undef SAMPLE_NAME #undef SAMPLE_FORMAT foundType = c_type(c_metaBind(c_metaObject(base), name, c_metaObject(sampleType))); os_free(name); c_free(sampleType); return foundType; }
v_networkingStatistics v_networkingStatisticsNew( v_kernel k) { v_networkingStatistics _this; c_type networkingStatisticsType; assert(k != NULL); assert(C_TYPECHECK(k, v_kernel)); /* not necessary to cache this type since it is looked up only once per process */ networkingStatisticsType = c_resolve(c_getBase(k), "kernelModule::v_networkingStatistics"); _this = v_networkingStatistics(v_new(k, networkingStatisticsType)); v_networkingStatisticsInit(_this,k); return _this; }
void v_rnrStorageStatisticsInit( v_rnrStorageStatistics _this, v_kernel k, c_string name) { c_type type; assert(_this && name); assert(C_TYPECHECK(_this, v_rnrStorageStatistics)); v_statisticsInit(v_statistics(_this)); _this->name = name; type = c_resolve(c_getBase(k), "kernelModule::v_rnrGroupStatistics"); _this->topics = c_tableNew(type, "name"); }
d_storeResult d_storeMMFKernelMarkNameSpaceComplete( d_storeMMFKernel kernel, const d_nameSpace nameSpace, const c_bool isComplete) { d_nameSpaceInfo nsInfo; c_type type; c_char* name; c_value keyValues[1]; d_storeResult result; if(kernel && nameSpace){ name = d_nameSpaceGetName(nameSpace); keyValues[0] = c_stringValue((c_string)name); nsInfo = c_tableFind(kernel->nameSpaces, keyValues); if(nsInfo){ nsInfo->complete = isComplete; result = D_STORE_RESULT_OK; } else { type = c_resolve(c_getBase(kernel), "durabilityModule2::d_nameSpaceInfo"); nsInfo = (d_nameSpaceInfo)c_new(type); c_free(type); if (nsInfo) { nsInfo->name = c_stringNew(c_getBase(kernel), name); nsInfo->complete = isComplete; c_tableInsert(kernel->nameSpaces, nsInfo); c_free(nsInfo); result = D_STORE_RESULT_OK; } else { OS_REPORT(OS_ERROR, "d_storeMMFKernelMarkNameSpaceComplete",0, "Failed to allocate nameSpaceInfo."); result = D_STORE_RESULT_OUT_OF_RESOURCES; } } } else { result = D_STORE_RESULT_ILL_PARAM; } return result; }
/************************************************************** * constructor/destructor **************************************************************/ v_lifespanAdmin v_lifespanAdminNew( v_kernel kernel) { v_lifespanAdmin admin; admin = NULL; admin = c_new(c_resolve(c_getBase(kernel), "kernelModule::v_lifespanAdmin")); if (admin != NULL) { admin->sampleCount = 0; admin->head = NULL; admin->tail = NULL; } else { OS_REPORT(OS_ERROR, "v_lifespanAdminNew",0, "Failed to allocate lifespan admin."); assert(FALSE); } return admin; }
v_networkChannelStatistics v_networkChannelStatisticsNew( v_kernel k, const c_char *name) { v_networkChannelStatistics ncs; c_string channelName; c_type type; assert(k != NULL); assert(C_TYPECHECK(k, v_kernel)); type = c_resolve(c_getBase(k), "kernelModuleI::v_networkChannelStatistics"); assert(type); ncs = v_networkChannelStatistics(v_new(k, type)); c_free(type); channelName = c_stringNew(c_getBase(c_object(k)),name); v_networkChannelStatisticsInit(ncs,channelName); return ncs; }
v_rnrStorageStatistics v_rnrStorageStatisticsNew( v_kernel k, const c_char *name) { v_rnrStorageStatistics _this; c_string storageName; c_type type; assert(k && name); assert(C_TYPECHECK(k, v_kernel)); type = c_resolve(c_getBase(k), "kernelModule::v_rnrStorageStatistics"); _this = v_rnrStorageStatistics(c_new(type)); storageName = c_stringNew(c_getBase(c_object(k)), name); c_free(type); v_rnrStorageStatisticsInit(_this, k, storageName); return _this; }