Issue 18614: Inconsistent use of Type/type - fix compilation (dds-psm-cxx-rtf) Source: Micro Focus (Mr. Simon McQueen, simon.mcqueen(at)microfocus.com) Nature: Revision Severity: 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 @@ -3,10 +3,10 @@ namespace dds { namespace core { - 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, Resolution: Revised Text: Actions taken: April 3, 2013: received issue Discussion: End of Annotations:===== ogle-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=9rWc8ltUyZMO4MRhjCOhbBpvtj22fd/YE9CqUhqYfYg=; b=WrM8CyHa9lozvYbV6vgcI2WyG2XRUQALd8t3dlQXOduCv5ebTjnifc65T1BBX7ZlBh k9rdQfD1DDlARLp4XGaAht8/TkIuFcvoqAsqYmj6Nj1NXwyrNNKUDvxXHJnRtRTz0BK6 e7+eZRRpfUrG82SYNVidgK91sUoA206R1Tk+PR0hRAMC1yWXMZAVJXlpkut4A4m7w21W g93GMRCphwsxvj9znzkGM7uMGA/TvLl8BZp+L2zoyWHNvkGKM6bt+ol5CBRqP1HWtdfb ugJvxDc5Mdy0OipBEQLWnxs6sZiFb9bq4Umdk0vB0516ivHrEWSpXorwvtprqFgI3XS/ 6Wyw== X-Received: by 10.194.120.195 with SMTP id le3mr3818623wjb.46.1365005884165; Wed, 03 Apr 2013 09:18:04 -0700 (PDT) Date: Wed, 03 Apr 2013 17:17:57 +0100 From: Simon McQueen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 To: issues@omg.org Subject: Inconsistent use of Type/type - fix compilation X-Gm-Message-State: ALoCoQlZs/Gq8dVZizqYTTW6hV5C+ZQy4DeY1youEY6Xs5xNEW/iJYnu6oUJeWrY/MG+qqrFhkgy X-Virus-Scanned: amavisd-new at omg.org X-Brightmail-Tracker: AAAAAA== X-Brightmail-Tracker: AAAAAA== 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 @@ -3,10 +3,10 @@ namespace dds { namespace core { - template + template 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; 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; 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; 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; 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; 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; struct TypeConsistencyEnforcementKind_def { - enum type { + enum Type { EXACT_TYPE_TYPE_CONSISTENCY, EXACT_NAME_TYPE_CONSISTENCY, DECLARED_TYPE_CONSISTENCY,