[
https://issues.apache.org/jira/browse/GEODE-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Charlie Black closed GEODE-4032.
--------------------------------
This EntryExpiryHandler uses the enumerations to handle the various
Expirations. This was implemented at some point over the years since this
ticket was opened. Closing as implemented - if you would like to reopen
please give a pointer to source where this was not implemented.
> Investigate enum types being used as integer values
> ---------------------------------------------------
>
> Key: GEODE-4032
> URL: https://issues.apache.org/jira/browse/GEODE-4032
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: David Kimura
> Priority: Major
>
> DiskPolicyType and ExpirationAction have enums being used as integers.
> Evaluate whether enum is the correct data type to use here. Consider change
> to use {{enum class DiskPolicy}} and {{enum class ExpirationAction}} which
> would throw compiler errors unless {{static_cast<int>}} is made.
> Example in {{ExpirationAction.hpp}}:
> {noformat}
> class CPPCACHE_EXPORT ExpirationAction {
> public:
> typedef enum { INVALIDATE = 0, LOCAL_INVALIDATE, DESTROY, LOCAL_DESTROY,
> INVALID_ACTION } Action;
> // ...
> };
> {noformat}
> With usages in {{ExpirationAction.cpp}} like...
> {noformat}
> const char* ExpirationAction::fromOrdinal(const int ordinal) {
> if (INVALIDATE <= ordinal && ordinal <= LOCAL_DESTROY) {
> return names[ordinal];
> }
> return nullptr;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)