DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TCorePolicy.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 
24 #include <dds/core/Value.hpp>
26 
27 //==============================================================================
28 // DDS Policy Classes
29 namespace dds { namespace core { namespace policy {
30 
31  //==============================================================================
44  template <typename D>
45  class TUserData : public dds::core::Value<D> {
46  public:
51 
57  explicit TUserData(const dds::core::ByteSeq& seq);
58 
59  //@TODO Implement
60  TUserData(const uint8_t* value_begin, const uint8_t* value_end);
61 
62  TUserData(const TUserData& other);
63 
64  public:
70  TUserData& value(const dds::core::ByteSeq& seq);
71 
75  template <typename OCTET_ITER>
76  TUserData& value(OCTET_ITER begin, OCTET_ITER end);
77 
83  const dds::core::ByteSeq value() const;
84 
85  const uint8_t* begin() const;
86  const uint8_t* end() const;
87  };
88 
89  //==============================================================================
90 
101  template <typename D>
102  class TGroupData : public dds::core::Value<D> {
103  public:
108 
114  explicit TGroupData(const dds::core::ByteSeq& seq) : dds::core::Value<D>(seq);
115 
116  TGroupData(const TGroupData& other);
117 
118  TGroupData(const uint8_t* value_begin, const uint8_t* value_end);
119 
120  public:
126  TGroupData& value(const dds::core::ByteSeq& seq);
127 
131  template <typename OCTET_ITER>
132  TGroupData& value(OCTET_ITER begin, OCTET_ITER end);
133 
139  const dds::core::ByteSeq value() const;
140 
145 
146  const uint8_t* begin() const;
147  const uint8_t* end() const;
148  };
149 
150  //==============================================================================
151 
160  template <typename D>
161  class TTopicData : public dds::core::Value<D> {
162  public:
164 
165  explicit TTopicData(const dds::core::ByteSeq& seq);
166 
167  TTopicData(const TTopicData& other);
168 
169  TTopicData(const uint8_t* value_begin, const uint8_t* value_end);
170 
171  public:
177  TTopicData& value(const dds::core::ByteSeq& seq);
178 
182  template <typename OCTET_ITER>
183  TTopicData& value(OCTET_ITER begin, OCTET_ITER end);
184 
190  const dds::core::ByteSeq value() const;
191 
196 
197  const uint8_t* begin() const;
198  const uint8_t* end() const;
199  };
200 
201 
202  //==============================================================================
203 
219  template <typename D>
220  class TEntityFactory : public dds::core::Value<D> {
221  public:
223  explicit TEntityFactory(bool the_auto_enable);
224  TEntityFactory(const TEntityFactory& other);
225 
226  public:
227  TEntityFactory& autoenable_created_entities(bool on);
228  bool autoenable_created_entities() const;
229 
230  public:
231  static TEntityFactory AutoEnable();
232  static TEntityFactory ManuallyEnable();
233  };
234 
235  //==============================================================================
236 
253  template <typename D>
255  public:
256  explicit TTransportPriority(int32_t prio);
257 
259 
261 
262  public:
263  TTransportPriority& value(int32_t prio);
264  int32_t value() const;
265  };
266 
267  //==============================================================================
268 
287  template <typename D>
288  class TLifespan : public dds::core::Value<D> {
289  public:
293  explicit TLifespan(const dds::core::Duration& d);
294 
298  TLifespan();
299  TLifespan(const TLifespan& other);
300 
301  public:
303  const dds::core::Duration duration() const;
304  };
305 
306  //==============================================================================
307 
328  template <typename D>
329  class TDeadline : public dds::core::Value<D> {
330  public:
331  explicit TDeadline(const dds::core::Duration& d);
332 
333  TDeadline(const TDeadline& other);
334 
338  TDeadline();
339 
340  public:
342  const dds::core::Duration period() const;
343  };
344 
345  //==============================================================================
346 
347  template <typename D>
348  class TLatencyBudget : public dds::core::Value<D> {
349  public:
350  explicit TLatencyBudget(const dds::core::Duration& d);
351 
355  TLatencyBudget();
356  TLatencyBudget(const TLatencyBudget& other);
357 
358  public:
360  const dds::core::Duration duration() const;
361  };
362 
363  //==============================================================================
364  template <typename D>
365  class TTimeBasedFilter : public dds::core::Value<D> {
366  public:
371  explicit TTimeBasedFilter(const dds::core::Duration& the_min_separation);
372  TTimeBasedFilter(const TTimeBasedFilter& other);
373 
374  public:
377  };
378 
379 
380  //==============================================================================
381  template <typename D>
382  class TPartition : public dds::core::Value<D> {
383  public:
384  TPartition();
385  explicit TPartition(const std::string& partition);
386  explicit TPartition(const dds::core::StringSeq& partitions);
387  TPartition(const TPartition& other);
388 
389  public:
390  TPartition& name(const dds::core::StringSeq& partitions);
391 
392  const dds::core::StringSeq name() const;
393 
395  };
396 
397  //==============================================================================
398 #ifdef OMG_DDS_OWNERSHIP_SUPPORT
399 
400  template <typename D>
401  class TOwnership : public dds::core::Value<D> {
402  public:
406  TOwnership();
407  explicit TOwnership(dds::core::policy::OwnershipKind::Type the_kind);
408  TOwnership(const TOwnership& other);
409 
410 
411 
412  public:
413  TOwnership& kind(dds::core::policy::OwnershipKind::Type the_kind);
414  dds::core::policy::OwnershipKind::Type kind() const;
415 
416  public:
417  static TOwnership Exclusive();
418  static TOwnership Shared();
419  };
420 
421 
422  //==============================================================================
423 
424 
425  template <typename D>
426  class TOwnershipStrength : public dds::core::Value<D> {
427  public:
428  explicit TOwnershipStrength(int32_t s);
429 
430  TOwnershipStrength(const TOwnershipStrength& other);
431 
432  public:
433  int32_t value() const;
434  TOwnershipStrength& value(int32_t s);
435  };
436 
437 #endif // OMG_DDS_OWNERSHIP_SUPPORT
438 
439 
440  //==============================================================================
441 
442  template <typename D>
444  public:
446  explicit TWriterDataLifecycle(bool the_autodispose);
448 
449  public:
452 
453  public:
456  };
457 
458  template <typename D>
460  public:
466  TReaderDataLifecycle(const dds::core::Duration& the_nowriter_delay,
467  const dds::core::Duration& the_disposed_samples_delay);
469  public:
472 
475 
476  public:
479  };
480 
481  //==============================================================================
482  template <typename D>
483  class TDurability : public dds::core::Value<D> {
484  public:
488  TDurability();
489  explicit TDurability(dds::core::policy::DurabilityKind::Type the_kind);
490  TDurability(const TDurability& other);
491 
492  public:
493  TDurability& kind(dds::core::policy::DurabilityKind::Type the_kind);
494  dds::core::policy::DurabilityKind::Type kind() const;
495 
496  public:
497  static TDurability Volatile();
498  static TDurability TransientLocal();
499  static TDurability Transient();
500  static TDurability Persistent();
501  };
502  //==============================================================================
503  template <typename D>
504  class TPresentation : public dds::core::Value<D> {
505  public:
511  TPresentation();
512  TPresentation(dds::core::policy::PresentationAccessScopeKind::Type the_access_scope,
513  bool the_coherent_access,
514  bool the_ordered_access);
515 
516  TPresentation(const TPresentation& other);
517 
518 
519  public:
520  TPresentation& access_scope(dds::core::policy::PresentationAccessScopeKind::Type as);
521  dds::core::policy::PresentationAccessScopeKind::Type access_scope() const;
522 
523  TPresentation& coherent_access(bool on);
524  bool coherent_access() const;
525 
526  TPresentation& ordered_access(bool on);
527  bool ordered_access() const;
528 
529  public:
530  static TPresentation GroupAccessScope(bool coherent = false, bool ordered = false);
531  static TPresentation InstanceAccessScope(bool coherent = false, bool ordered = false);
532  static TPresentation TopicAccessScope(bool coherent = false, bool ordered = false);
533  };
534 
535  //==============================================================================
536 
537  template <typename D>
538  class TReliability : public dds::core::Value<D> {
539  public:
543  TReliability();
544  TReliability(dds::core::policy::ReliabilityKind::Type the_kind,
545  const dds::core::Duration& the_max_blocking_time);
546  TReliability(const TReliability& other);
547 
548  public:
549 
550  TReliability& kind(dds::core::policy::ReliabilityKind::Type the_kind);
551  dds::core::policy::ReliabilityKind::Type kind() const;
552 
555 
556  public:
558  static TReliability BestEffort();
559  };
560 
561 
562  //==============================================================================
563 
564  template <typename D>
566  public:
571  explicit TDestinationOrder(dds::core::policy::DestinationOrderKind::Type the_kind);
572 
573  TDestinationOrder(const TDestinationOrder& other);
574 
575  public:
576  TDestinationOrder& kind(dds::core::policy::DestinationOrderKind::Type the_kind);
577  dds::core::policy::DestinationOrderKind::Type kind() const;
578 
579  public:
582  };
583 
584  //==============================================================================
585  template <typename D>
586  class THistory : public dds::core::Value<D> {
587  public:
591  THistory();
592  THistory(dds::core::policy::HistoryKind::Type the_kind, int32_t the_depth);
593  THistory(const THistory& other);
594 
595  public:
596  dds::core::policy::HistoryKind::Type kind() const;
597  THistory& kind(dds::core::policy::HistoryKind::Type the_kind);
598 
599  int32_t depth() const;
600  THistory& depth(int32_t the_depth);
601 
602  public:
603  static THistory KeepAll();
604  static THistory KeepLast(uint32_t depth);
605  };
606 
607  //==============================================================================
608 
609  template <typename D>
610  class TResourceLimits : public dds::core::Value<D> {
611  public:
615  TResourceLimits();
616  TResourceLimits(int32_t the_max_samples,
617  int32_t the_max_instances,
618  int32_t the_max_samples_per_instance);
619  TResourceLimits(const TResourceLimits& other);
620 
621  public:
622  TResourceLimits& max_samples(int32_t samples);
623  int32_t max_samples() const;
624 
625  TResourceLimits& max_instances(int32_t the_max_instances);
626  int32_t max_instances() const;
627 
628  TResourceLimits& max_samples_per_instance(int32_t the_max_samples_per_instance);
629  int32_t max_samples_per_instance() const;
630  };
631 
632 
633 
634  //==============================================================================
635 
636  template <typename D>
637  class TLiveliness : public dds::core::Value<D> {
638  public:
642  TLiveliness();
643  TLiveliness(dds::core::policy::LivelinessKind::Type the_kind,
644  const dds::core::Duration& the_lease_duration);
645  TLiveliness(const TLiveliness& other);
646 
647  public:
648  TLiveliness& kind(dds::core::policy::LivelinessKind::Type the_kind);
649  dds::core::policy::LivelinessKind::Type kind() const;
650 
651  TLiveliness& lease_duration(const dds::core::Duration& the_lease_duration);
652  const dds::core::Duration lease_duration() const;
653 
654  public:
655  static TLiveliness Automatic();
658  };
659 
660 
661  //==============================================================================
662 
663 #ifdef OMG_DDS_PERSISTENCE_SUPPORT
664 
665  template <typename D>
666  class TDurabilityService : public dds::core::Value<D> {
667  public:
668  TDurabilityService();
669 
670  TDurabilityService(
671  const dds::core::Duration& the_service_cleanup_delay,
672  dds::core::policy::HistoryKind::Type the_history_kind,
673  int32_t the_history_depth,
674  int32_t the_max_samples,
675  int32_t the_max_instances,
676  int32_t the_max_samples_per_instance);
677 
678  TDurabilityService(const TDurabilityService& other);
679 
680 
681  public:
682  TDurabilityService& service_cleanup_delay(const dds::core::Duration& d);
683  const dds::core::Duration service_cleanup_delay() const;
684 
685  TDurabilityService& history_kind(dds::core::policy::HistoryKind::Type the_kind);
686  dds::core::policy::HistoryKind::Type history_kind() const;
687 
688  TDurabilityService& history_depth(int32_t the_depth);
689 
690  int32_t history_depth() const;
691 
692  TDurabilityService& max_samples(int32_t the_max_samples);
693  int32_t max_samples() const;
694 
695  TDurabilityService& max_instances(int32_t the_max_instances);
696  int32_t max_instances() const;
697 
698  TDurabilityService& max_samples_per_instance(int32_t the_max_samples_per_instance);
699  int32_t max_samples_per_instance() const;
700  };
701 
702 #endif // OMG_DDS_PERSISTENCE_SUPPORT
703 
704 
705  //============================================================================
706 
707  //============================================================================
708 
709 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
710 
711  template <typename D>
712  class TDataRepresentation : public dds::core::Value<D> {
713 
714  public:
715  explicit TDataRepresentation(
716  const dds::core::policy::DataRepresentationIdSeq& value);
717 
718  TDataRepresentation(const TDataRepresentation& other)
719  : dds::core::Value<D>(other.value())
720  { }
721  public:
722  TDataRepresentation& value(const dds::core::policy::DataRepresentationIdSeq& value);
723 
724  const dds::core::policy::DataRepresentationIdSeq value() const;
725 
726  dds::core::policy::DataRepresentationIdSeq&
727  value(dds::core::policy::DataRepresentationIdSeq& dst) const;
728  };
729 
730 #endif // defined(OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT)
731 
732 
733  //============================================================================
734 
735 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
736 
737  template <typename D>
738  class TTypeConsistencyEnforcement : public dds::core::Value<D> {
739  public:
740  explicit TTypeConsistencyEnforcement(dds::core::policy::TypeConsistencyEnforcementKind::Type kind);
741 
742  public:
743  TTypeConsistencyEnforcement& kind(dds::core::policy::TypeConsistencyEnforcementKind::Type value);
744  dds::core::policy::TypeConsistencyEnforcementKind::Type kind() const;
745  };
746 
747 #endif // defined(OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT)
748 
749 
750  //==============================================================================
751 
752 
753 } } }
754 
755 #endif /* OMG_TDDS_CORE_POLICY_CORE_POLICY_HPP_ */
756