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

DDSPSMC11_ — Inconsistent use of Type/type - fix compilation

  • Key: DDSPSMC11_-28
  • Legacy Issue Number: 18614
  • Status: open  
  • Source: Micro Focus ( Simon McQueen)
  • Summary:

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

    Issues:

    Code in src/hpp/dds/core/SafeEnumeration.hpp and
    src/hpp/dds/core/policy/PolicyKind.hpp does not compile.

    Suggested resolution:

    diff --git a/src/hpp/dds/core/SafeEnumeration.hpp
    b/src/hpp/dds/core/SafeEnumeration.hpp
    index 3f7ca67..0d443c2 100644
    --- a/src/hpp/dds/core/SafeEnumeration.hpp
    +++ b/src/hpp/dds/core/SafeEnumeration.hpp
    @@ -1,29 +1,76 @@
    +/* Copyright 2010, Object Management Group, Inc.
    +* Copyright 2010, PrismTech, Corp.
    +* Copyright 2010, Real-Time Innovations, Inc.
    +* All rights reserved.
    +*
    +* Licensed under the Apache License, Version 2.0 (the "License");
    +* you may not use this file except in compliance with the License.
    +* You may obtain a copy of the License at
    +*
    +*     http://www.apache.org/licenses/LICENSE-2.0
    +*
    +* Unless required by applicable law or agreed to in writing, software
    +* distributed under the License is distributed on an "AS IS" BASIS,
    +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +* See the License for the specific language governing permissions and
    +* limitations under the License.
    +*/
    
     #ifndef OMG_DDS_CORE_SAFEENUMERATION_HPP_
     #define OMG_DDS_CORE_SAFEENUMERATION_HPP_
    
    namespace dds {
    namespace core {
    +/**
    + * safe_enum provides a wrapper for enumerated types in a typesafe
    + * manner.
    + * safe_enums allow specification of the underlying type,
    + * do not implictly convert to integers, and resolve scoping issues.
    + */
    -    template<typename def, typename inner = typename def::type>
    +    template<typename def, typename inner = typename def::Type>
         class safe_enum : public def
         {
    -      typedef typename def::type type;
    +      typedef typename def::Type type;
           inner val;
    
         public:
    diff --git a/src/hpp/dds/core/policy/PolicyKind.hpp
    b/src/hpp/dds/core/policy/PolicyKind.hpp
    index 6928742..9537d78 100644
    --- a/src/hpp/dds/core/policy/PolicyKind.hpp
    +++ b/src/hpp/dds/core/policy/PolicyKind.hpp
    @@ -25,7 +25,7 @@
     namespace dds { namespace core { namespace policy {
    
    
       struct OwnershipKind_def {
    -    enum type {
    +    enum Type {
           SHARED
    
    
     #ifdef  OMG_DDS_OWNERSHIP_SUPPORT
    @@ -37,7 +37,7 @@ namespace dds { namespace core { namespace policy {
       typedef dds::core::safe_enum<OwnershipKind_def> OwnershipKind;
    
    
       struct DurabilityKind_def {
    -    enum type {
    +    enum Type {
           VOLATILE,
           TRANSIENT_LOCAL
    
    
    @@ -46,8 +46,7 @@ namespace dds { namespace core { namespace policy {
           TRANSIENT,
           PERSISTENT
     #endif  // #ifdef  OMG_DDS_PERSISTENCE_SUPPORT
    -    };
    -  };
    +    }; };
       typedef dds::core::safe_enum<DurabilityKind_def> DurabilityKind;
    
    
       struct PresentationAccessScopeKind_def  {
    @@ -60,11 +59,11 @@ namespace dds { namespace core { namespace policy {
           GROUP
     #endif  // OMG_DDS_OBJECT_MODEL_SUPPORT
         }; };
    -
    +  typedef dds::core::safe_enum<PresentationAccessScopeKind_def>
    PresentationAccessScopeKind;
    
    
    
       struct ReliabilityKind_def {
    -    enum type {
    +    enum Type {
           BEST_EFFORT,
           RELIABLE
         };
    @@ -73,7 +72,7 @@ namespace dds { namespace core { namespace policy {
    
    
    
       struct DestinationOrderKind_def {
    -    enum type {
    +    enum Type {
           BY_RECEPTION_TIMESTAMP,
           BY_SOURCE_TIMESTAMP
         }; };
    @@ -81,7 +80,7 @@ namespace dds { namespace core { namespace policy {
       typedef dds::core::safe_enum<DestinationOrderKind_def>
    DestinationOrderKind;
    
    
       struct HistoryKind_def {
    -    enum type {
    +    enum Type {
           KEEP_LAST,
           KEEP_ALL
         };};
    @@ -89,7 +88,7 @@ namespace dds { namespace core { namespace policy {
       typedef dds::core::safe_enum<HistoryKind_def> HistoryKind;
    
    
       struct LivelinessKind_def {
    -    enum type {
    +    enum Type {
           AUTOMATIC,
           MANUAL_BY_PARTICIPANT,
           MANUAL_BY_TOPIC
    @@ -97,7 +96,7 @@ namespace dds { namespace core { namespace policy {
       typedef dds::core::safe_enum<LivelinessKind_def> LivelinessKind;
    
    
       struct TypeConsistencyEnforcementKind_def {
    -    enum type {
    +    enum Type {
           EXACT_TYPE_TYPE_CONSISTENCY,
           EXACT_NAME_TYPE_CONSISTENCY,
           DECLARED_TYPE_CONSISTENCY,
    
  • Reported: DDS-PSM-Cxx 1.0b2 — Wed, 3 Apr 2013 04:00 GMT
  • Updated: Sun, 30 Sep 2018 23:30 GMT