CatapultServer  v0.5.0.1 (Elephant)
BitwiseEnum.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Casting.h"
23 
25 #define MAKE_BITWISE_ENUM(ENUM_TYPE) \
26  /* Returns the result of bitwise-ORing \a lhs and \a rhs. */ \
27  constexpr ENUM_TYPE operator|(ENUM_TYPE lhs, ENUM_TYPE rhs) { \
28  return static_cast<ENUM_TYPE>(utils::to_underlying_type(lhs) | utils::to_underlying_type(rhs)); \
29  } \
30  \
31  /* Bitwise-ORs \a lhs and \a rhs and assigns the result to \a lhs. */ \
32  constexpr ENUM_TYPE& operator|=(ENUM_TYPE& lhs, ENUM_TYPE rhs) { \
33  return lhs = lhs | rhs; \
34  } \
35  \
36  /* Returns \c true if all bits in \a testedFlag are also set in \a value. */ \
37  constexpr bool HasFlag(ENUM_TYPE testedFlag, ENUM_TYPE value) { \
38  return utils::to_underlying_type(testedFlag) == (utils::to_underlying_type(testedFlag) & utils::to_underlying_type(value)); \
39  } \
40  /* Returns true if \a value has exactly one bit set. */ \
41  constexpr bool HasSingleFlag(ENUM_TYPE value) { \
42  return utils::to_underlying_type(value) && !(utils::to_underlying_type(value) & (utils::to_underlying_type(value) - 1)); \
43  }
catapult::observers::DEFINE_OBSERVER
DEFINE_OBSERVER(AccountAddress, model::AccountAddressNotification, [](const auto &notification, const auto &context) { DefaultAccountVisitor visitor(context);visitor.visit(notification.Address);})
Observers.h
AccountStateCache.h
catapult::cache::ProcessForwardedAccountState
void ProcessForwardedAccountState(AccountStateCacheDelta &cache, const Key &publicKey, const consumer< state::AccountState & > &action)
Forwards account state or linked account state found in cache associated with publicKey to action.
Definition: AccountStateCacheUtils.cpp:26
Casting.h
catapult::importance::UpdateActivity
void UpdateActivity(const Key &publicKey, const observers::ObserverContext &context, const ActivityBucketConsumer &commitAction, const ActivityBucketConsumer &rollbackAction)
Definition: ActivityObserverUtils.cpp:36
catapult
Definition: AddressExtractionExtension.cpp:28
ActivityObserverUtils.h
AccountStateCacheUtils.h
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41