当前位置: 首页>>代码示例>>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;未经允许,请勿转载。