⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ownershipmanagement.cc

📁 分布式仿真 开放源码
💻 CC
📖 第 1 页 / 共 2 页
字号:
{    NetworkMessage req, rep ;    req.type = NetworkMessage::ATTRIBUTE_OWNERSHIP_ACQUISITION ;    req.federation = fm->_numero_federation ;    req.federate = fm->federate ;    req.object = theObject ;    req.handleArraySize = attribArraySize ;    for (int i = 0 ; i < attribArraySize ; i++)        req.handleArray[i] = attribArray[i] ;    strcpy(req.label, theTag);    D.Out(pdDebug, "OWNERSHIP_ACQUISITION Federate %u ", fm->federate);    comm->sendMessage(&req);    comm->waitMessage(&rep, NetworkMessage::ATTRIBUTE_OWNERSHIP_ACQUISITION,                      req.federate);    e = rep.exception ;}// ----------------------------------------------------------------------------//! attributeOwnershipRealeaseResponse.AttributeHandleSet*OwnershipManagement::attributeOwnershipRealeaseResponse(ObjectHandle theObject,                                   AttributeHandle *attribArray,                                   UShort attribArraySize,                                   TypeException &e){    NetworkMessage req, rep ;    req.type = NetworkMessage::ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE ;    req.federation = fm->_numero_federation ;    req.federate = fm->federate ;    req.object = theObject ;    req.handleArraySize = attribArraySize ;    D.Out(pdDebug, "RELEASE_RESPONSE Object %u handleArraySize %u",          theObject, req.handleArraySize);    for (int i = 0 ; i < attribArraySize ; i++) {        req.handleArray[i] = attribArray[i] ;    }    comm->sendMessage(&req);    comm->waitMessage(&rep, NetworkMessage::ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE,                      req.federate);    e = rep.exception ;    if (e == e_NO_EXCEPTION) {        AttributeHandleSet *AttributeSet ;        AttributeSet=AttributeHandleSetFactory::create(rep.handleArraySize);        for (int i = 0 ; i < rep.handleArraySize ; i++) {            AttributeSet->add(rep.handleArray[i]);        }        return(AttributeSet);    }    else        return NULL ;}// ----------------------------------------------------------------------------//! cancelAttributeOwnershipAcquisition.voidOwnershipManagement::cancelattributeOwnershipAcquisition(ObjectHandle theObject,                                    AttributeHandle *attribArray,                                    UShort attribArraySize,                                    TypeException &e){    NetworkMessage req, rep ;    req.type = NetworkMessage::CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION ;    req.federation = fm->_numero_federation ;    req.federate = fm->federate ;    req.object = theObject ;    req.handleArraySize = attribArraySize ;    for (int i = 0 ; i < attribArraySize ; i++)        req.handleArray[i] = attribArray[i] ;    D.Out(pdDebug, "CANCEL_ACQUISITION Federate %u ", fm->federate);    comm->sendMessage(&req);    comm->waitMessage(&rep, NetworkMessage::CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION,                      req.federate);    e = rep.exception ;}// ----------------------------------------------------------------------------//! informAttributeOwnership.voidOwnershipManagement::informAttributeOwnership(ObjectHandle the_object,                                              AttributeHandle the_attribute,                                              FederateHandle the_owner,                                              TypeException &){    Message req, rep ;    req.type = Message::INFORM_ATTRIBUTE_OWNERSHIP ;    req.setObject(the_object);    req.setAttribute(the_attribute);    req.setFederate(the_owner);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! attributeIsNotOwned.voidOwnershipManagement::attributeIsNotOwned(ObjectHandle the_object,                                         AttributeHandle the_attribute,                                         FederateHandle,                                         TypeException &){    Message req, rep ;    req.type = Message::ATTRIBUTE_IS_NOT_OWNED ;    req.setObject(the_object);    req.setAttribute(the_attribute);    // req.setFederate(the_owner);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! attributeOwnershipUnavailable.voidOwnershipManagement::attributeOwnershipUnavailable(ObjectHandle the_object,                              AttributeHandle *the_attributes,                              UShort the_size,                              FederateHandle,                              TypeException &){    Message req, rep ;    req.type = Message::ATTRIBUTE_OWNERSHIP_UNAVAILABLE ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! attributeOwnershipAcquisitionNotification.voidOwnershipManagement::attributeOwnershipAcquisitionNotification(ObjectHandle the_object,                                          AttributeHandle *the_attributes,                                          UShort the_size,                                          FederateHandle,                                          TypeException &){    Message req, rep ;    req.type = Message::ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! requestAttributeOwnershipAssumption.voidOwnershipManagement::requestAttributeOwnershipAssumption(ObjectHandle the_object,                                    AttributeHandle *the_attributes,                                    UShort the_size,                                    FederateHandle,                                    char *the_tag,                                    TypeException &){    Message req, rep ;    req.type = Message::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    req.setTag(the_tag);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! requestAttributeOwnershipRelease.voidOwnershipManagement::requestAttributeOwnershipRelease(ObjectHandle the_object,                                 AttributeHandle *the_attributes,                                 UShort the_size,                                 char *the_tag,                                 TypeException &){    Message req, rep ;    req.type = Message::REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    req.setTag(the_tag);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! attributeOwnershipDivestitureNotification.voidOwnershipManagement::attributeOwnershipDivestitureNotification(ObjectHandle the_object,                                          AttributeHandle *the_attributes,                                          UShort the_size,                                          TypeException &){    Message req, rep ;    req.type = Message::ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    comm->requestFederateService(&req, &rep);}// ----------------------------------------------------------------------------//! confirmattributeOwnershipAcquisitionCancellation.voidOwnershipManagement::confirmAttributeOwnershipAcquisitionCancellation(ObjectHandle the_object,                                                 AttributeHandle *the_attributes,                                                 UShort the_size,                                                 TypeException &){    Message req ;    req.type = Message::CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION ;    req.setObject(the_object);    req.setAttributes(the_attributes, the_size);    Message rep ;    comm->requestFederateService(&req, &rep);}}} // namespace certi/rtia// $Id: OwnershipManagement.cc,v 3.8 2003/06/27 17:26:28 breholee Exp $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -