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 5ef5ea5
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 58 deletions.
8 changes: 8 additions & 0 deletions src/groups/bmq/bmqtsk/bmqtsk_alarmlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ class AlarmLog : public ball::ObserverAdapter {
/// will be dumped to stderr with respects to rate-controlled logic.
void publish(const ball::Record& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE;

/// Note: this member is overriden to get rid of the "hides the virtual
/// function" warning.
inline void publish(const bsl::shared_ptr<const ball::Record>& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE
{
publish(*record, context);
}
};

} // close package namespace
Expand Down
8 changes: 8 additions & 0 deletions src/groups/bmq/bmqtsk/bmqtsk_consoleobserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ class ConsoleObserver : public ball::ObserverAdapter {
void publish(const ball::Record& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE;

/// Note: this member is overriden to get rid of the "hides the virtual
/// function" warning.
inline void publish(const bsl::shared_ptr<const ball::Record>& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE
{
publish(*record, context);
}

// ACCESSORS

/// Return the currently set severity threshold of this object.
Expand Down
8 changes: 8 additions & 0 deletions src/groups/bmq/bmqtsk/bmqtsk_syslogobserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ class SyslogObserver : public ball::ObserverAdapter {
void publish(const ball::Record& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE;

/// Note: this member is overriden to get rid of the "hides the virtual
/// function" warning.
inline void publish(const bsl::shared_ptr<const ball::Record>& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE
{
publish(*record, context);
}

// ACCESSORS

/// Return the currently set severity threshold of this object.
Expand Down
8 changes: 8 additions & 0 deletions src/groups/bmq/bmqtst/bmqtst_scopedlogobserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ class ScopedLogObserver : public ball::ObserverAdapter {
void publish(const ball::Record& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE;

/// Note: this member is overriden to get rid of the "hides the virtual
/// function" warning.
inline void publish(const bsl::shared_ptr<const ball::Record>& record,
const ball::Context& context) BSLS_KEYWORD_OVERRIDE
{
publish(*record, context);
}

public:
// ACCESSORS

Expand Down
10 changes: 0 additions & 10 deletions src/groups/bmq/bmqu/bmqu_blobiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ class BlobIterator {
/// referring to a valid value.
const char& operator*() const;

/// Return a pointer to the byte being referred to by this
/// iterator. The behavior is undefined if this iterator isn't
/// referring to a valid value.
const char* operator->() const;

/// Return `true` if this `BlobIterator` has reached its end.
bool atEnd() const;

Expand Down Expand Up @@ -284,11 +279,6 @@ inline const char& BlobIterator::operator*() const
return d_blob_p->buffer(d_pos.buffer()).data()[d_pos.byte()];
}

inline const char* BlobIterator::operator->() const
{
return &**this;
}

inline bool BlobIterator::atEnd() const
{
return d_remaining <= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/groups/mqb/mqbblp/mqbblp_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ void Domain::removeDomainReset()
bslmt::LockGuard<bslmt::Mutex> guard(&d_mutex); // LOCK

d_state = e_PREREMOVE;
d_teardownRemoveCb = nullptr;
d_teardownRemoveCb = bsl::nullptr_t();
}

void Domain::removeDomainComplete()
Expand Down
2 changes: 1 addition & 1 deletion src/groups/mqb/mqbc/mqbc_clusterstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ bool ClusterState::unassignQueue(const bmqt::Uri& uri)

domIt->second->queuesInfo().erase(cit);
if (domIt->second->queuesInfo().empty()) {
domIt->second->setDomain(nullptr);
domIt->second->setDomain(NULL);
}

// POSTCONDITIONS
Expand Down
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 5ef5ea5

Please sign in to comment.