OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
CorePolicy.hpp
Go to the documentation of this file.
1 #ifndef OMG_TDDS_CORE_POLICY_CORE_POLICY_HPP_
2 #define OMG_TDDS_CORE_POLICY_CORE_POLICY_HPP_
3 
4 /* Copyright 2010, Object Management Group, Inc.
5  * Copyright 2010, PrismTech, Corp.
6  * Copyright 2010, Real-Time Innovations, Inc.
7  * All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
26 
27 //==============================================================================
28 // DDS Policy Classes
29 namespace dds
30 {
31 namespace core
32 {
33 namespace policy
34 {
35 
36 //==============================================================================
41 class UserData : public dds::core::Value
42 {
43 public:
47  UserData();
48 
54  explicit UserData(const dds::core::ByteSeq& sequence);
55 
64  UserData(const uint8_t* value_begin, const uint8_t* value_end);
65 
71  UserData(const UserData& other);
72 
73 public:
79  UserData& value(const dds::core::ByteSeq& sequence);
80 
88  template <typename OCTET_ITER>
89  UserData& value(OCTET_ITER begin, OCTET_ITER end);
90 
96  const dds::core::ByteSeq value() const;
97 
103  const uint8_t* begin() const;
104 
110  const uint8_t* end() const;
111 };
112 
113 //==============================================================================
114 
120 {
121 public:
125  GroupData();
126 
132  explicit GroupData(const dds::core::ByteSeq& sequence);
133 
139  GroupData(const GroupData& other);
140 
149  GroupData(const uint8_t* value_begin, const uint8_t* value_end);
150 
151 public:
157  GroupData& value(const dds::core::ByteSeq& sequence);
158 
166  template <typename OCTET_ITER>
167  GroupData& value(OCTET_ITER begin, OCTET_ITER end);
168 
174  const dds::core::ByteSeq value() const;
175 
181  const uint8_t* begin() const;
182 
188  const uint8_t* end() const;
189 };
190 
191 //==============================================================================
192 
198 {
199 public:
203  TopicData();
204 
210  explicit TopicData(const dds::core::ByteSeq& sequence);
211 
217  TopicData(const TopicData& other);
218 
227  TopicData(const uint8_t* value_begin, const uint8_t* value_end);
228 
229 public:
235  TopicData& value(const dds::core::ByteSeq& sequence);
236 
244  template <typename OCTET_ITER>
245  TopicData& value(OCTET_ITER begin, OCTET_ITER end);
246 
252  const dds::core::ByteSeq value() const;
253 
259  const uint8_t* begin() const;
260 
266  const uint8_t* end() const;
267 };
268 
269 
270 //==============================================================================
271 
277 {
278 public:
285  explicit EntityFactory(bool autoenable_created_entities = true);
286 
292  EntityFactory(const EntityFactory& other);
293 
294 public:
302  EntityFactory& autoenable_created_entities(bool autoenable_created_entities);
303 
310  bool autoenable_created_entities() const;
311 
312 public:
317  static EntityFactory AutoEnable();
318 
323  static EntityFactory ManuallyEnable();
324 };
325 
326 //==============================================================================
327 
333 {
334 public:
340  explicit TransportPriority(int32_t priority = 0);
341 
347  TransportPriority(const TransportPriority& other);
348 
349 public:
355  TransportPriority& value(int32_t priority);
356 
362  int32_t value() const;
363 };
364 
365 //==============================================================================
366 
372 {
373 public:
379  explicit Lifespan(const dds::core::Duration& duration = dds::core::Duration::infinite());
380 
386  Lifespan(const Lifespan& other);
387 
388 public:
394  Lifespan& duration(const dds::core::Duration& duration);
395 
401  const dds::core::Duration duration() const;
402 };
403 
404 //==============================================================================
405 
411 {
412 public:
418  explicit Deadline(const dds::core::Duration& period = dds::core::Duration::infinite());
419 
425  Deadline(const Deadline& other);
426 
427 public:
433  Deadline& period(const dds::core::Duration& period);
434 
440  const dds::core::Duration period() const;
441 };
442 
443 //==============================================================================
444 
450 {
451 public:
457  explicit LatencyBudget(const dds::core::Duration& duration = dds::core::Duration::zero());
458 
464  LatencyBudget(const LatencyBudget& other);
465 
466 public:
472  LatencyBudget& duration(const dds::core::Duration& duration);
473 
479  const dds::core::Duration duration() const;
480 };
481 
482 //==============================================================================
483 
489 {
490 public:
496  explicit TimeBasedFilter(
498 
504  TimeBasedFilter(const TimeBasedFilter& other);
505 
506 public:
512  TimeBasedFilter& minimum_separation(const dds::core::Duration& period);
513 
519  const dds::core::Duration minimum_separation() const;
520 };
521 
522 
523 //==============================================================================
524 
530 {
531 public:
537  explicit Partition(const std::string& name = "");
538 
544  explicit Partition(const dds::core::StringSeq& names);
545 
551  Partition(const Partition& other);
552 
553 public:
559  Partition& name(const std::string& name);
560 
566  Partition& name(const dds::core::StringSeq& names);
567 
573  const dds::core::StringSeq name() const;
574 };
575 
576 //==============================================================================
577 #ifdef OMG_DDS_OWNERSHIP_SUPPORT
578 
584 {
585 public:
586  # if defined (__SUNPRO_CC) && defined(SHARED)
587 # undef SHARED
588  # endif
589 
594  explicit Ownership(
596 
602  Ownership(const Ownership& other);
603 
604 public:
611 
618 
619 public:
623  static Ownership Exclusive();
624 
628  static Ownership Shared();
629 };
630 
631 
632 //==============================================================================
633 
639 {
640 public:
646  explicit OwnershipStrength(int32_t strength = 0);
647 
653  OwnershipStrength(const OwnershipStrength& other);
654 
655 public:
661  int32_t value() const;
662 
668  OwnershipStrength& value(int32_t strength);
669 };
670 
671 #endif // OMG_DDS_OWNERSHIP_SUPPORT
672 //==============================================================================
673 
679 {
680 public:
687  explicit WriterDataLifecycle(bool autodispose_unregistered_instances = true);
688 
695 
696 public:
702  bool autodispose_unregistered_instances() const;
703 
710  WriterDataLifecycle& autodispose_unregistered_instances(
711  bool autodispose_unregistered_instances);
712 
713 public:
718  static WriterDataLifecycle AutoDisposeUnregisteredInstances();
719 
724  static WriterDataLifecycle ManuallyDisposeUnregisteredInstances();
725 
726 #ifdef DOXYGEN_FOR_ISOCPP2
727 public:
728  /*
729  * The above macro is never (and must never) be defined in normal compilation.
730  *
731  * The following code is for documenting proprietary API only.
732  */
733 
754  void autopurge_suspended_samples_delay(const dds::core::Duration& d);
755 
770  const dds::core::Duration autopurge_suspended_samples_delay() const;
771 
792  void autounregister_instance_delay(const dds::core::Duration& d);
793 
808  const dds::core::Duration autounregister_instance_delay() const;
809 
810 #endif /* DOXYGEN_FOR_ISOCPP2 */
811 
812 };
813 
814 //==============================================================================
815 
821 {
822 public:
830  const dds::core::Duration& autopurge_nowriter_samples_delay = dds::core::Duration::infinite(),
831  const dds::core::Duration& autopurge_disposed_samples_delay = dds::core::Duration::infinite());
832 
839 public:
845  const dds::core::Duration autopurge_nowriter_samples_delay() const;
846 
852  ReaderDataLifecycle& autopurge_nowriter_samples_delay(
853  const dds::core::Duration& autopurge_nowriter_samples_delay);
854 
860  const dds::core::Duration autopurge_disposed_samples_delay() const;
861 
867  ReaderDataLifecycle& autopurge_disposed_samples_delay(
868  const dds::core::Duration& autopurge_disposed_samples_delay);
869 
870 public:
875  static ReaderDataLifecycle NoAutoPurgeDisposedSamples();
876 
882  static ReaderDataLifecycle AutoPurgeDisposedSamples(
883  const dds::core::Duration& autopurge_disposed_samples_delay);
884 
885 #ifdef DOXYGEN_FOR_ISOCPP2
886 public:
887  /*
888  * The above macro is never (and must never) be defined in normal compilation.
889  *
890  * The following code is for documenting proprietary API only.
891  */
892 
893  /*
894  * Although enable_invalid_samples is available in the delegate, that feature is
895  * actually deprecated. So, don't add it to the API documentation.
896  */
897 
912  bool autopurge_dispose_all() const;
913 
938  void autopurge_dispose_all(bool b);
939 
954  org::opensplice::core::policy::InvalidSampleVisibility::Type invalid_sample_visibility() const;
955 
973  void invalid_sample_visibility(org::opensplice::core::policy::InvalidSampleVisibility::Type visibility);
974 
975 #endif /* DOXYGEN_FOR_ISOCPP2 */
976 
977 };
978 
979 //==============================================================================
980 
986 {
987 public:
993  explicit Durability(
995 
1001  Durability(const Durability& other);
1002 
1003 public:
1010 
1017 
1018 public:
1022  static Durability Volatile();
1023 
1027  static Durability TransientLocal();
1028 
1032  static Durability Transient();
1033 
1037  static Durability Persistent();
1038 };
1039 
1040 //==============================================================================
1041 
1047 {
1048 public:
1056  Presentation(
1059  bool coherent_access = false,
1060  bool ordered_access = false);
1061 
1067  Presentation(const Presentation& other);
1068 
1069 public:
1076 
1083 
1089  Presentation& coherent_access(bool coherent_access);
1090 
1096  bool coherent_access() const;
1097 
1103  Presentation& ordered_access(bool ordered_access);
1104 
1110  bool ordered_access() const;
1111 
1112 public:
1120  static Presentation GroupAccessScope(bool coherent_access = false, bool ordered_access = false);
1121 
1129  static Presentation InstanceAccessScope(bool coherent_access = false, bool ordered_access = false);
1130 
1138  static Presentation TopicAccessScope(bool coherent_access = false, bool ordered_access = false);
1139 };
1140 
1141 //==============================================================================
1142 
1148 {
1149 public:
1156  Reliability(
1158  const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100));
1159 
1165  Reliability(const Reliability& other);
1166 
1167 public:
1174 
1181 
1187  Reliability& max_blocking_time(const dds::core::Duration& max_blocking_time);
1188 
1194  const dds::core::Duration max_blocking_time() const;
1195 
1196 public:
1202  static Reliability Reliable(const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100));
1203 
1207  static Reliability BestEffort(const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100));
1208 
1209 #ifdef DOXYGEN_FOR_ISOCPP2
1210 public:
1211  /*
1212  * The above macro is never (and must never) be defined in normal compilation.
1213  *
1214  * The following code is for documenting proprietary API only.
1215  */
1216 
1217 
1232  bool synchronous() const;
1233 
1250  void synchronous(bool b);
1251 
1252 #endif /* DOXYGEN_FOR_ISOCPP2 */
1253 
1254 };
1255 
1256 //==============================================================================
1257 
1263 {
1264 public:
1270  explicit DestinationOrder(
1273 
1279  DestinationOrder(const DestinationOrder& other);
1280 
1281 public:
1288 
1295 
1296 public:
1300  static DestinationOrder SourceTimestamp();
1301 
1305  static DestinationOrder ReceptionTimestamp();
1306 };
1307 
1308 //==============================================================================
1309 
1315 {
1316 public:
1324  int32_t depth = 1);
1325 
1331  History(const History& other);
1332 
1333 public:
1340 
1347 
1353  int32_t depth() const;
1354 
1360  History& depth(int32_t depth);
1361 
1362 public:
1366  static History KeepAll();
1367 
1373  static History KeepLast(uint32_t depth);
1374 };
1375 
1376 //==============================================================================
1377 
1383 {
1384 public:
1393  int32_t max_instances = dds::core::LENGTH_UNLIMITED,
1394  int32_t max_samples_per_instance = dds::core::LENGTH_UNLIMITED);
1395 
1401  ResourceLimits(const ResourceLimits& other);
1402 
1403 public:
1410 
1416  int32_t max_samples() const;
1417 
1423  ResourceLimits& max_instances(int32_t max_instances);
1424 
1430  int32_t max_instances() const;
1431 
1437  ResourceLimits& max_samples_per_instance(int32_t max_samples_per_instance);
1438 
1444  int32_t max_samples_per_instance() const;
1445 };
1446 
1447 //==============================================================================
1448 
1454 {
1455 public:
1462  Liveliness(
1464  const dds::core::Duration& lease_duration = dds::core::Duration::infinite());
1465 
1471  Liveliness(const Liveliness& other);
1472 
1473 public:
1480 
1487 
1493  Liveliness& lease_duration(const dds::core::Duration& lease_duration);
1494 
1500  const dds::core::Duration lease_duration() const;
1501 
1502 public:
1506  static Liveliness Automatic();
1507 
1512  static Liveliness ManualByParticipant(const dds::core::Duration& lease_duration = dds::core::Duration::infinite());
1513 
1518  static Liveliness ManualByTopic(const dds::core::Duration& lease_duration = dds::core::Duration::infinite());
1519 };
1520 
1521 
1522 //==============================================================================
1523 #ifdef OMG_DDS_PERSISTENCE_SUPPORT
1524 
1530 {
1531 public:
1543  const dds::core::Duration& service_cleanup_delay = dds::core::Duration::zero(),
1545  int32_t history_depth = 1,
1547  int32_t max_instances = dds::core::LENGTH_UNLIMITED,
1548  int32_t max_samples_per_instance = dds::core::LENGTH_UNLIMITED);
1549 
1555  DurabilityService(const DurabilityService& other);
1556 
1557 public:
1563  DurabilityService& service_cleanup_delay(const dds::core::Duration& service_cleanup_delay);
1564 
1570  const dds::core::Duration service_cleanup_delay() const;
1571 
1577  DurabilityService& history_kind(dds::core::policy::HistoryKind::Type history_kind);
1578 
1584  dds::core::policy::HistoryKind::Type history_kind() const;
1585 
1591  DurabilityService& history_depth(int32_t history_depth);
1592 
1598  int32_t history_depth() const;
1599 
1606 
1612  int32_t max_samples() const;
1613 
1619  DurabilityService& max_instances(int32_t max_instances);
1620 
1625  int32_t max_instances() const;
1626 
1632  DurabilityService& max_samples_per_instance(int32_t max_samples_per_instance);
1633 
1639  int32_t max_samples_per_instance() const;
1640 };
1641 
1642 #endif // OMG_DDS_PERSISTENCE_SUPPORT
1643 
1644 //==============================================================================
1645 
1646 //============================================================================
1647 
1648 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
1649 
1650 
1651 class DataRepresentation : public dds::core::Value
1652 {
1653 
1654 public:
1655  explicit DataRepresentation(
1656  const dds::core::policy::DataRepresentationIdSeq& value);
1657 
1658  DataRepresentation(const DataRepresentation& other)
1659  : dds::core::Value(other.value())
1660  { }
1661 public:
1662  DataRepresentation& value(const dds::core::policy::DataRepresentationIdSeq& value);
1663 
1664  const dds::core::policy::DataRepresentationIdSeq value() const;
1665 
1666  dds::core::policy::DataRepresentationIdSeq&
1667 };
1668 
1669 #endif // defined(OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT)
1670 
1671 
1672 //============================================================================
1673 
1674 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
1675 
1676 
1677 class TypeConsistencyEnforcement : public dds::core::Value
1678 {
1679 public:
1680  explicit TypeConsistencyEnforcement(dds::core::policy::TypeConsistencyEnforcementKind::Type kind);
1681 
1682 public:
1683  TypeConsistencyEnforcement& kind(dds::core::policy::TypeConsistencyEnforcementKind::Type kind);
1685 };
1686 
1687 #endif // defined(OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT)
1688 
1689 
1690 //==============================================================================
1691 
1692 
1693 }
1694 }
1695 }
1696 
1697 #endif /* OMG_TDDS_CORE_POLICY_CORE_POLICY_HPP_ */
dds::sub::functors::MaxSamplesManipulatorFunctor max_samples(uint32_t n)
This class is the base for various value-type dds objects.
Definition: Value.hpp:28
static const Duration infinite()
const dds::core::ByteSeq value() const
Definition: array.hpp:23
const uint8_t * begin() const
static const Duration zero()
dds::core::xtypes::SharedAnnotation Shared()
const int32_t LENGTH_UNLIMITED
std::vector< std::string > StringSeq
Definition: types.hpp:43
const uint8_t * end() const
std::vector< uint8_t > ByteSeq
Definition: types.hpp:38
static const Duration from_millisecs(int64_t milliseconds)