DDS-PSM-Cxx 1.1 RTF Avatar
  1. OMG Issue

DDSPSMC11_ — API correction required to src/hpp/dds/core/cond/TWaitSet.hpp

  • Key: DDSPSMC11_-29
  • Legacy Issue Number: 18619
  • Status: open  
  • Source: Leonardo S.p.A ( Simon McQueen)
  • Summary:

    Name: Simon McQueen
    Employer: PrismTech
    Specification: DDS CXX PSM RTF
    FormalNumber: ptc/12-10-03
    Nature: Revision

    Issues:

    Code does not compile.
    Comments incorrect.

    Suggested resolution:

    diff --git a/src/hpp/dds/core/cond/TWaitSet.hpp b/src/hpp/dds/core/cond/TWaitSet.hpp
    index dfb05a2..a7fa3ee 100644
    --- a/src/hpp/dds/core/cond/TWaitSet.hpp
    +++ b/src/hpp/dds/core/cond/TWaitSet.hpp
    @@ -22,7 +22,9 @@
     #include <vector>
    
    
     #include <dds/core/types.hpp>
    +#include <dds/core/Duration.hpp>
     #include <dds/core/cond/Condition.hpp>
    +#include <dds/core/cond/WaitSet.hpp>
    
    
     namespace dds {
       namespace core {
    
    @@ -39,209 +44,207 @@ namespace dds {
      * the attached Condition objects has a trigger_value of TRUE or else
      * until the timeout expires.
      * A WaitSet is not necessarily associated with a single DomainParticipant
    - * and could be used to wait on Condition objects associated with different
    + * and could be used to wait for Condition objects associated with different
      * DomainParticipant objects.
    
     public:
    -  OMG_DDS_REF_TYPE(TWaitSet, dds::core::Reference, DELEGATE)
    + OMG_DDS_REF_TYPE_PUBLIC(TWaitSet, dds::core::Reference, DELEGATE)
    
     public:
    -  /**
    -   * Creates a new waitset.
    -   */
    -  TWaitSet();
    -
       ~TWaitSet();
    
    
     public:
     public:
      /**
       * This operation allows an application thread to wait for the occurrence
    -   * of certain conditions. If none of the conditions attached to the
    +  * of certain Conditions. If none of the Conditions attached to the
       * WaitSet have a trigger_value of TRUE, the wait operation will block
       * suspending the calling thread.
         *
         * The wait operation takes a timeout argument that specifies the maximum
    -    * duration for the wait. It this duration is exceeded and none of
    +    * duration for the wait. If this duration is exceeded and none of
         * the attached Condition objects is true, wait will continue and the
         * returned ConditionSeq will be empty.
         *
         * It is not allowed for more than one application thread to be waiting
         * on the same WaitSet. If the wait operation is invoked on a WaitSet that
    -     * already has a thread blocking on it, the operation will raise
    -     * immediately an exception PreconditionNotMet.
    +     * already has a thread blocking on it, the operation will immediately 
    +     * raise a PreconditionNotMet exception.
         *
         * The result of the wait operation is the list of all the attached
    -     * conditions that have a trigger_value of TRUE (i.e., the conditions
    +     * Conditions that have a trigger_value of TRUE (i.e., the Conditions
         * that unblocked the wait).
         *
         * @param timeout the maximum amount of time for which the wait
    -     * should block while waiting for a condition to be triggered.
    +     * should block while waiting for a Condition to be triggered.
         *
    -     * @raise PreconditionNotMetException when multiple thread try to invoke
    -     *        the method concurrently.
    +     * @throws PreconditionNotMetException when multiple threads try to invoke
    +     *        the function concurrently.
         *
    -     * @return a vector containing the triggered conditions
    +     * @return a vector containing the triggered Conditions
         */
    
    @@ -95,11 +92,6 @@ public:
       /**
        * This operation allows an application thread to wait for the occurrence
    -    * of certain conditions. If none of the conditions attached to the
    +   * of certain Conditions. If none of the Conditions attached to the
        * WaitSet have a trigger_value of TRUE, the wait operation will block
        * suspending the calling thread.
        *
    -   * The wait operation takes a timeout argument that specifies the maximum
    -   * duration for the wait. It this duration is exceeded and none of
    -   * the attached Condition objects is true, wait will continue and the
    -   * returned ConditionSeq will be empty.
    -   *
        * It is not allowed for more than one application thread to be waiting
        * on the same WaitSet. If the wait operation is invoked on a WaitSet that
    -     * already has a thread blocking on it, the operation will raise
    -     * immediately an exception PreconditionNotMet.
    +     * already has a thread blocking on it, the operation will immediately 
    +     * raise a PreconditionNotMet exception.
        *
        * The result of the wait operation is the list of all the attached
    -    * conditions that have a trigger_value of TRUE (i.e., the conditions
    +    * Conditions that have a trigger_value of TRUE (i.e., the Conditions
        * that unblocked the wait).
        *
    -   * @param timeout the maximum amount of time for which the wait
    -   * should block while waiting for a condition to be triggered.
    -   *
    -   * @raise PreconditionNotMetException when multiple thread try to invoke
    +   * @throws PreconditionNotMetException when multiple threads try to invoke
        *        the method concurrently.
        *
    -    * @return a vector containing the triggered conditions
    +    * @return a vector containing the triggered Conditions
    @@ -142,7 +131,7 @@ public:
       /**
        * This operation allows an application thread to wait for the occurrence
    -    * of certain conditions. If none of the conditions attached to the
    +    * of certain Conditions. If none of the Conditions attached to the
        * WaitSet have a trigger_value of TRUE, the wait operation will block
        * suspending the calling thread.
        *
        * The wait operation takes a timeout argument that specifies the maximum
    -    * duration for the wait. It this duration is exceeded and none of
    +    * duration for the wait. If this duration is exceeded and none of
        * the attached Condition objects is true, wait will continue and the
        * returned ConditionSeq will be empty.
        *
        * It is not allowed for more than one application thread to be waiting
        * on the same WaitSet. If the wait operation is invoked on a WaitSet that
    -     * already has a thread blocking on it, the operation will raise
    -     * immediately an exception PreconditionNotMet.
    +     * already has a thread blocking on it, the operation will immediately 
    +     * raise a PreconditionNotMet exception.
        *
        * The result of the wait operation is the list of all the attached
    -    * conditions that have a trigger_value of TRUE (i.e., the conditions
    +    * Conditions that have a trigger_value of TRUE (i.e., the Conditions
        * that unblocked the wait).
    +    *
    +    * @param triggered a ConditionSeq in which to put Conditions that were
    +    * triggered during the wait.
        *
        * @param timeout the maximum amount of time for which the wait
    -    * should block while waiting for a condition to be triggered.
    +    * should block while waiting for a Condition to be triggered.
        *
    -   * @raise PreconditionNotMetException when multiple thread try to invoke
    +   * @throws PreconditionNotMetException when multiple threads try to invoke
        *        the method concurrently.
        *
    -    * @return a vector containing the triggered conditions
    +    * @return a vector containing the triggered Conditions
    @@ -173,7 +162,7 @@ public:
        * This operation allows an application thread to wait for the occurrence
    -    * of certain conditions. If none of the conditions attached to the
    +    * of certain Conditions. If none of the Conditions attached to the
        * WaitSet have a trigger_value of TRUE, the wait operation will block
        * suspending the calling thread.
        *
        * The wait operation takes a timeout argument that specifies the maximum
    -    * duration for the wait. It this duration is exceeded and none of
    +    * duration for the wait. If this duration is exceeded and none of
        * the attached Condition objects is true, wait will continue and the
        * returned ConditionSeq will be empty.
        *
        * It is not allowed for more than one application thread to be waiting
        * on the same WaitSet. If the wait operation is invoked on a WaitSet that
    -     * already has a thread blocking on it, the operation will raise
    -     * immediately an exception PreconditionNotMet.
    +     * already has a thread blocking on it, the operation will immediately 
    +     * raise a PreconditionNotMet exception.
        *
        * The result of the wait operation is the list of all the attached
    -    * conditions that have a trigger_value of TRUE (i.e., the conditions
    +    * Conditions that have a trigger_value of TRUE (i.e., the Conditions
        * that unblocked the wait).
        *
    +    * @param triggered a ConditionSeq in which to put Conditions that were
    +    * triggered during the wait.
    -    *
    -    * @param timeout the maximum amount of time for which the wait
    -    * should block while waiting for a condition to be triggered.
        *
    -   * @raise PreconditionNotMetException when multiple thread try to invoke
    +   * @throws PreconditionNotMetException when multiple threads try to invoke
        *        the method concurrently.
        *
    -    * @return a vector containing the triggered conditions
    +    * @return a vector containing the triggered Conditions
        ConditionSeq& wait(ConditionSeq& triggered);
    
    public:
        /**
    -     * Waits for at least one of the attached conditions to trigger and then
    -     * dispatches the events.
    +     * Waits for at least one of the attached Conditions to trigger and then
    +     * dispatches the functor associated with the Condition.
         */
        void dispatch();
    
        /**
    -     * Waits for at least one of the attached conditions to trigger and then
    -     * dispatches the events, or, times out and unblocks.
    +    * Waits for at least one of the attached Conditions to trigger and then
    +     * dispatches the functor associated with the Condition, or, times
    +     * out and unblocks.*
         */
        void dispatch(const dds::core::Duration& timeout);
    
    @@ -199,12 +188,12 @@ public:
       /**
        * A synonym for attach_condition.
        */
    -  WaitSet& operator +=(const dds::core::cond::Condition& cond);
    +  TWaitSet& operator +=(const dds::core::cond::Condition& cond);
    
    
       /**
        * A synonym for detach_condition.
        */
    -  WaitSet& operator -=(const dds::core::cond::Condition& cond);
    +  TWaitSet& operator -=(const dds::core::cond::Condition& cond);
    
    
       /**
        * Attaches a Condition to the WaitSet. It is possible to attach a
    @@ -216,7 +205,7 @@ public:
       /**
        * Attaches a Condition to the WaitSet. It is possible to attach a
        * Condition on a WaitSet that is currently being waited upon
        * (via the wait operation). In this case, if the Condition has a
    -    * trigger_value of TRUE, then attaching the condition will unblock
    +    * trigger_value of TRUE, then attaching the Condition will unblock
        * the WaitSet. Adding a Condition that is already attached to the WaitSet
        * has no effect.
        *
    -    * @param cond the condition to be attached to this waitset.
    +    * @param cond the Condition to be attached to this WaitSet.
    +    *
    +    * @return the WaitSet itself so that attaching Conditions
    +    * can be chained.
        */
    -  WaitSet& attach_condition(const dds::core::cond::Condition& cond);
    +  TWaitSet& attach_condition(const dds::core::cond::Condition& cond);
    
    
       /**
        * Detaches a Condition from the WaitSet. If the Condition was not
        * attached to the WaitSet, the operation will return false.
        *
    -    * @param cond the condition to detach from this WaitSet
    +    * @param cond the Condition to detach from this WaitSet
        *
    -    * @return true if the condition was found and detached, false if the
    -    *         condition was not part of the WaitSet.
    +    * @return true if the Condition was found and detached, false if the
    +    *         Condition was not part of the WaitSet.
        */
       bool detach_condition(const dds::core::cond::Condition& cond);
    
       /**
    -    * This operation retrieves the list of attached conditions.
    +   * This operation retrieves the list of attached Conditions.
        *
    -    * @return the list of attached conditions.
    +    * @return the list of attached Conditions.
        */
    -   const ConditionSeq conditions();
    +   const ConditionSeq conditions() const;
    
       /**
    -    * This operation retrieves the list of attached conditions.
    +    * This operation retrieves the list of attached Conditions.
        *
    +    * @param conds a ConditionSeq in which to put the attached
    +    * Conditions.
    +    *
    -    * @return the list of attached conditions.
    +    * @return the list of attached Conditions.
        */
       ConditionSeq& conditions(ConditionSeq& conds) const;
    };
    
  • Reported: DDS-PSM-Cxx 1.0b2 — Wed, 3 Apr 2013 04:00 GMT
  • Updated: Sun, 30 Sep 2018 23:30 GMT