DK_CacheAccessTypeRegistry* DK_CacheAccessTypeRegistry_new( DLRL_Exception* exception, DK_ObjectHomeAdmin* home, LOC_unsigned_long containedTypesIndex) { DK_CacheAccessTypeRegistry* _this = NULL; DLRL_INFO(INF_ENTER); assert(home); assert(exception); DLRL_ALLOC(_this, DK_CacheAccessTypeRegistry, exception, allocError); _this->containedTypesIndex = containedTypesIndex; Coll_Set_init(&(_this->unresolvedElements), pointerIsLessThen, TRUE); Coll_Set_init(&(_this->objects), pointerIsLessThen, FALSE); Coll_Set_init(&(_this->changedObjects), pointerIsLessThen, FALSE); Coll_Set_init(&(_this->unregisteredObjects), pointerIsLessThen, FALSE); Coll_List_init(&(_this->newObjects)); Coll_List_init(&(_this->modifiedObjects)); Coll_List_init(&(_this->deletedObjects)); _this->home = (DK_ObjectHomeAdmin*)DK_Entity_ts_duplicate((DK_Entity*)home); DLRL_Exception_EXIT(exception); if(exception->exceptionID != DLRL_NO_EXCEPTION && _this) { DK_Entity_ts_release((DK_Entity*)_this->home); os_free(_this); _this = NULL; } DLRL_INFO(INF_EXIT); return _this; }
DMM_DLRLMultiRelation* DMM_DLRLMultiRelation_new( DLRL_Exception* exception, LOC_boolean isComposition, LOC_string name, LOC_string typeName, LOC_string associatedRelationName, DMM_Basis basis, DMM_DLRLClass* owner, LOC_unsigned_long index, LOC_boolean isOptional) { DMM_DLRLMultiRelation* _this; DLRL_INFO(INF_ENTER); assert(exception); assert(name); assert(typeName); /* associatedRelationName may be null */ assert(owner); assert(basis < DMM_Basis_elements); DLRL_ALLOC(_this, DMM_DLRLMultiRelation, exception, "%s '%s::%s'", allocError, DLRL_VALID_NAME(DMM_DLRLClass_getName(owner)), DLRL_VALID_NAME(name)); /* initialise the internal DMM_DLRLRelation struct */ DMM_DLRLRelation_init(&(_this->base), exception, DMM_DLRL_MULTI_RELATION_CLASS, isComposition, name, typeName, associatedRelationName,owner, isOptional); /* initialise variables specific to DMM_DLRLMultiRelation struct */ _this->basis = basis; _this->relationTopicIndexField = NULL; _this->relationTopic = NULL; _this->index = index; Coll_List_init(&(_this->relationTopicOwnerFields)); Coll_List_init(&(_this->relationTopicTargetFields)); DLRL_INFO(INF_ENTITY, "created %s, address = %p", ENTITY_NAME, _this); DLRL_Exception_EXIT(exception); if(exception->exceptionID != DLRL_NO_EXCEPTION){ DMM_DLRLMultiRelation_delete(_this); _this = NULL; } DLRL_INFO(INF_EXIT); return _this; }
Coll_List * Coll_List_new( void) { Coll_List *_this; _this = os_malloc(sizeof(Coll_List)); if (_this){ Coll_List_init(_this); } return _this; }