當前位置: 首頁>>代碼示例>>Java>>正文


Java PublisherQos類代碼示例

本文整理匯總了Java中com.rti.dds.publication.PublisherQos的典型用法代碼示例。如果您正苦於以下問題:Java PublisherQos類的具體用法?Java PublisherQos怎麽用?Java PublisherQos使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PublisherQos類屬於com.rti.dds.publication包,在下文中一共展示了PublisherQos類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addPartition

import com.rti.dds.publication.PublisherQos; //導入依賴的package包/類
private void addPartition(
    String partition
) {
  // get publisher
  Publisher publisher = dataWriter.get_publisher();

  // get QoS
  PublisherQos publisherQos = new PublisherQos();
  publisher.get_qos(publisherQos);

  // update QoS if necessary
  if (!publisherQos.partition.name.contains(partition)) {
    publisherQos.partition.name.add(partition);
    publisher.set_qos(publisherQos);
  }
}
 
開發者ID:aguther,項目名稱:dds-examples,代碼行數:17,代碼來源:ShapeTypeExtendedPublisher.java

示例2: removePartition

import com.rti.dds.publication.PublisherQos; //導入依賴的package包/類
private void removePartition(
    String partition
) {
  // get publisher
  Publisher publisher = dataWriter.get_publisher();

  // get QoS
  PublisherQos publisherQos = new PublisherQos();
  publisher.get_qos(publisherQos);

  // update QoS if necessary
  if (publisherQos.partition.name.contains(partition)) {
    publisherQos.partition.name.remove(partition);
    publisher.set_qos(publisherQos);
  }
}
 
開發者ID:aguther,項目名稱:dds-examples,代碼行數:17,代碼來源:ShapeTypeExtendedPublisher.java

示例3: Publisher

import com.rti.dds.publication.PublisherQos; //導入依賴的package包/類
Publisher(final DomainParticipant domainParticipant,
          final com.rider.ddswrapper.configuration.Publisher publisherXML,
          final Logger defaultLogger) {
    if (publisherXML.getLoggerName() == null) {
        logger = defaultLogger;
    } else {
        logger = Logger.getLogger(publisherXML.getLoggerName());
    }

    name = publisherXML.getPublisherName();
    writers = new HashMap<>();
    ddsPublisher = domainParticipant.getDDSDomainParticipant().create_publisher_with_profile(publisherXML.getQoSLibrary(), publisherXML.getQoSProfile(), null, StatusKind.STATUS_MASK_NONE);

    if (ddsPublisher == null) {
        logger.error("Error creating Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\",QoSLibrary=\"" + publisherXML.getQoSLibrary() + "\",QoSProfile=\"" + publisherXML.getQoSProfile() + "\",Partitions=\"" + publisherXML.getPartitionNames() + "\")");
    } else {
        if (!publisherXML.getPartitionNames().isEmpty()) {
            final PublisherQos publisherQoS = new PublisherQos();

            ddsPublisher.get_qos(publisherQoS);
            publisherXML.getPartitionNames().stream().forEach(partition -> publisherQoS.partition.name.add(partition));
            ddsPublisher.set_qos(publisherQoS);
        }

        logger.info("Created Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\",QoSLibrary=\"" + publisherXML.getQoSLibrary() + "\",QoSProfile=\"" + publisherXML.getQoSProfile() + "\",Partitions=\"" + publisherXML.getPartitionNames() + "\")");

        publisherXML.getWriter().stream().forEach(writerXML -> {
            if (writers.containsKey(writerXML.getWriterName())) {
                logger.warn("Publisher (DomainParticipant=\"" + domainParticipant.getName() + "\",Publisher=\"" + publisherXML.getPublisherName() + "\") contains multiple Writers called \"" + writerXML.getWriterName() + "\". Using only the first one");
            } else {
                writers.put(writerXML.getWriterName(), new Writer(domainParticipant, this, writerXML, logger));
            }
        });
    }
}
 
開發者ID:ridernator,項目名稱:ddsWrapper,代碼行數:36,代碼來源:Publisher.java

示例4: getPublisherQos

import com.rti.dds.publication.PublisherQos; //導入依賴的package包/類
private PublisherQos getPublisherQos(DomainParticipant participant, DdsQosConfiguration config) {
 	PublisherQos qos = new PublisherQos();
 	participant.get_default_publisher_qos(qos);
 	if (config != null && config.isCustom()) {
try {
  		if (config.getLibrary() != null && config.getProfile() != null) {
  			DomainParticipantFactory.get_instance().get_publisher_qos_from_profile(qos, config.getLibrary(), config.getProfile());
  		}
  		RtiHelper.setQosPolicies(qos, config, getEndpoint().getCamelContext());
} catch (Exception e) {
	throw new RuntimeCamelException("Cannot create qos instance from profile", e);
}
 	}
 	return qos;
 }
 
開發者ID:EdwardOst,項目名稱:mdpnp,代碼行數:16,代碼來源:RtiProducer.java


注:本文中的com.rti.dds.publication.PublisherQos類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。