5 #ifndef JODA_CONTAINERFLAGS_H
6 #define JODA_CONTAINERFLAGS_H
11 #define JODA_CONTAINER_FLAG_T JODA_FLAG_T
36 using type =
typename std::underlying_type<argument_type>::type;
37 return std::hash<type>()(
static_cast<type
>(x));
52 if (!first) os <<
"|";
63 #define JODA_JSON_CONTAINER_FLAG (ContainerFlag::JSON)
64 #define JODA_JSON_CONTAINER_REF_FLAG (ContainerFlag::JSON | ContainerFlag::REF)
70 template <ContainerFlag R_FLAGS>
90 return std::make_unique<queue_t>();
92 static std::unique_ptr<queue_t>
getQueue(
size_t minCapacity,
93 size_t maxExplicitProducers,
94 size_t maxImplicitProducers = 0) {
95 return std::make_unique<queue_t>(minCapacity, maxExplicitProducers,
96 maxImplicitProducers);
117 return std::make_unique<queue_t>();
119 static std::unique_ptr<queue_t>
getQueue(
size_t minCapacity,
120 size_t maxExplicitProducers,
121 size_t maxImplicitProducers = 0) {
122 return std::make_unique<queue_t>(minCapacity, maxExplicitProducers,
123 maxImplicitProducers);
std::ostream & operator<<(std::ostream &os, const ContainerFlag &flag)
Definition: ContainerFlags.h:42
ContainerFlag
Definition: ContainerFlags.h:12
constexpr enum ContainerFlag operator|(const enum ContainerFlag selfValue, const enum ContainerFlag inValue)
Definition: ContainerFlags.h:18
JODA_CONTAINER_QUEUE< JODA_JSON_CONTAINER_REF_FLAG > JsonContainerRefQueue
Definition: ContainerFlags.h:132
JODA_CONTAINER_QUEUE< JODA_JSON_CONTAINER_FLAG > JsonContainerQueue
Definition: ContainerFlags.h:130
constexpr enum ContainerFlag operator&(const enum ContainerFlag selfValue, const enum ContainerFlag inValue)
Definition: ContainerFlags.h:24
#define JODA_CONTAINER_FLAG_T
Definition: ContainerFlags.h:11
#define JODA_JSON_CONTAINER_FLAG
Definition: ContainerFlags.h:63
#define JODA_JSON_CONTAINER_REF_FLAG
Definition: ContainerFlags.h:64
#define JODA_FLAG_T
Definition: Queue.h:11
Definition: JSONContainer.h:37
Definition: ContainerFlags.h:78
std::unique_ptr< JSONContainer > payload_t
Definition: ContainerFlags.h:79
static constexpr bool hasFlag(ContainerFlag flag)
Definition: ContainerFlags.h:83
static constexpr ContainerFlag getFlag()
Definition: ContainerFlags.h:87
static std::unique_ptr< queue_t > getQueue(size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers=0)
Definition: ContainerFlags.h:92
static std::unique_ptr< queue_t > getQueue()
Definition: ContainerFlags.h:89
Definition: ContainerFlags.h:102
JSONContainer * payload_t
Definition: ContainerFlags.h:103
static constexpr bool hasFlag(ContainerFlag flag)
Definition: ContainerFlags.h:108
static std::unique_ptr< queue_t > getQueue()
Definition: ContainerFlags.h:116
static constexpr ContainerFlag getFlag()
Definition: ContainerFlags.h:112
static std::unique_ptr< queue_t > getQueue(size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers=0)
Definition: ContainerFlags.h:119
Definition: ContainerFlags.h:71
JODA_CONTAINER_QUEUE(JODA_CONTAINER_QUEUE &q)=delete
size_t result_type
Definition: ContainerFlags.h:33
ContainerFlag argument_type
Definition: ContainerFlags.h:32
result_type operator()(const argument_type &x) const
Definition: ContainerFlags.h:35