Skip to content

Commit

Permalink
Fix enum templates not compatible with Solaris compiler
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Malygin <[email protected]>
  • Loading branch information
678098 committed Jan 9, 2025
1 parent 81b0f42 commit e526167
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 46 deletions.
12 changes: 4 additions & 8 deletions src/groups/mqb/mqbstat/mqbstat_brokerstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,35 +165,31 @@ inline bmqst::StatContext* BrokerStats::statContext()
}

template <>
inline void
BrokerStats::onEvent<BrokerStats::EventType::Enum::e_CLIENT_CREATED>()
inline void BrokerStats::onEvent<BrokerStats::EventType::e_CLIENT_CREATED>()
{
BSLS_ASSERT_SAFE(d_statContext_p && "initialize was not called");

d_statContext_p->adjustValue(BrokerStatsIndex::e_STAT_CLIENT_COUNT, 1);
}

template <>
inline void
BrokerStats::onEvent<BrokerStats::EventType::Enum::e_CLIENT_DESTROYED>()
inline void BrokerStats::onEvent<BrokerStats::EventType::e_CLIENT_DESTROYED>()
{
BSLS_ASSERT_SAFE(d_statContext_p && "initialize was not called");

d_statContext_p->adjustValue(BrokerStatsIndex::e_STAT_CLIENT_COUNT, -1);
}

template <>
inline void
BrokerStats::onEvent<BrokerStats::EventType::Enum::e_QUEUE_CREATED>()
inline void BrokerStats::onEvent<BrokerStats::EventType::e_QUEUE_CREATED>()
{
BSLS_ASSERT_SAFE(d_statContext_p && "initialize was not called");

d_statContext_p->adjustValue(BrokerStatsIndex::e_STAT_QUEUE_COUNT, 1);
}

template <>
inline void
BrokerStats::onEvent<BrokerStats::EventType::Enum::e_QUEUE_DESTROYED>()
inline void BrokerStats::onEvent<BrokerStats::EventType::e_QUEUE_DESTROYED>()
{
BSLS_ASSERT_SAFE(d_statContext_p && "initialize was not called");

Expand Down
12 changes: 4 additions & 8 deletions src/groups/mqb/mqbstat/mqbstat_clusterstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,32 +418,28 @@ inline bmqst::StatContext* ClusterNodeStats::statContext()
}

template <>
inline void
ClusterNodeStats::onEvent<ClusterNodeStats::EventType::Enum::e_ACK>(
inline void ClusterNodeStats::onEvent<ClusterNodeStats::EventType::e_ACK>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
d_statContext_mp->adjustValue(ClusterNodeStatsIndex::e_STAT_ACK, 1);
}

template <>
inline void
ClusterNodeStats::onEvent<ClusterNodeStats::EventType::Enum::e_CONFIRM>(
inline void ClusterNodeStats::onEvent<ClusterNodeStats::EventType::e_CONFIRM>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
d_statContext_mp->adjustValue(ClusterNodeStatsIndex::e_STAT_CONFIRM, 1);
}

template <>
inline void
ClusterNodeStats::onEvent<ClusterNodeStats::EventType::Enum::e_PUSH>(
inline void ClusterNodeStats::onEvent<ClusterNodeStats::EventType::e_PUSH>(
bsls::Types::Int64 value)
{
d_statContext_mp->adjustValue(ClusterNodeStatsIndex::e_STAT_PUSH, value);
}

template <>
inline void
ClusterNodeStats::onEvent<ClusterNodeStats::EventType::Enum::e_PUT>(
inline void ClusterNodeStats::onEvent<ClusterNodeStats::EventType::e_PUT>(
bsls::Types::Int64 value)
{
d_statContext_mp->adjustValue(ClusterNodeStatsIndex::e_STAT_PUT, value);
Expand Down
6 changes: 3 additions & 3 deletions src/groups/mqb/mqbstat/mqbstat_domainstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,23 @@ inline bmqst::StatContext* DomainStats::statContext()
}

template <>
inline void DomainStats::onEvent<DomainStats::EventType::Enum::e_CFG_MSGS>(
inline void DomainStats::onEvent<DomainStats::EventType::e_CFG_MSGS>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->setValue(DomainStatsIndex::e_STAT_CFG_MSGS, value);
}

template <>
inline void DomainStats::onEvent<DomainStats::EventType::Enum::e_CFG_BYTES>(
inline void DomainStats::onEvent<DomainStats::EventType::e_CFG_BYTES>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->setValue(DomainStatsIndex::e_STAT_CFG_BYTES, value);
}

template <>
inline void DomainStats::onEvent<DomainStats::EventType::Enum::e_QUEUE_COUNT>(
inline void DomainStats::onEvent<DomainStats::EventType::e_QUEUE_COUNT>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand Down
45 changes: 18 additions & 27 deletions src/groups/mqb/mqbstat/mqbstat_queuestats.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,26 +527,23 @@ inline bmqst::StatContext* QueueStatsDomain::statContext()
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_ACK>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_ACK>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->adjustValue(DomainQueueStats::e_STAT_ACK, 1);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_ACK_TIME>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_ACK_TIME>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->reportValue(DomainQueueStats::e_STAT_ACK_TIME, value);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_NACK>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_NACK>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -555,8 +552,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_NACK>(
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CONFIRM>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_CONFIRM>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -566,7 +562,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CONFIRM>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CONFIRM_TIME>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_CONFIRM_TIME>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -575,8 +571,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CONFIRM_TIME>(
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_REJECT>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_REJECT>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -586,25 +581,23 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_REJECT>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_QUEUE_TIME>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_QUEUE_TIME>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->reportValue(DomainQueueStats::e_STAT_QUEUE_TIME, value);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_PUSH>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_PUSH>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->adjustValue(DomainQueueStats::e_STAT_PUSH, value);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_PUT>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_PUT>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -613,7 +606,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_PUT>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_ADD_MESSAGE>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_ADD_MESSAGE>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -631,7 +624,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_ADD_MESSAGE>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_DEL_MESSAGE>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_DEL_MESSAGE>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -641,16 +634,15 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_DEL_MESSAGE>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_GC_MESSAGE>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_GC_MESSAGE>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->adjustValue(DomainQueueStats::e_STAT_GC_MSGS, value);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_PURGE>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_PURGE>(
BSLS_ANNOTATION_UNUSED bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -670,16 +662,15 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_PURGE>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CHANGE_ROLE>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_CHANGE_ROLE>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
d_statContext_mp->setValue(DomainQueueStats::e_STAT_ROLE, value);
}

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CFG_MSGS>(
inline void QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_CFG_MSGS>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -688,7 +679,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CFG_MSGS>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CFG_BYTES>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_CFG_BYTES>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -697,7 +688,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_CFG_BYTES>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_NO_SC_MESSAGE>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_NO_SC_MESSAGE>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand All @@ -706,7 +697,7 @@ QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_NO_SC_MESSAGE>(

template <>
inline void
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::Enum::e_UPDATE_HISTORY>(
QueueStatsDomain::onEvent<QueueStatsDomain::EventType::e_UPDATE_HISTORY>(
bsls::Types::Int64 value)
{
BSLS_ASSERT_SAFE(d_statContext_mp && "initialize was not called");
Expand Down

0 comments on commit e526167

Please sign in to comment.