5 #ifndef JODA_PARSERFLAGS_H
6 #define JODA_PARSERFLAGS_H
12 #define JODA_PARSER_FLAG_T JODA_FLAG_T
44 using type =
typename std::underlying_type<argument_type>::type;
45 return std::hash<type>()(
static_cast<type
>(x));
60 if (!first) os <<
"|";
65 if (!first) os <<
"|";
70 if (!first) os <<
"|";
81 #define JODA_JSON_TEXT_PARSER_FLAG \
82 (ParserFlag::JSON | ParserFlag::TEXT | ParserFlag::MEMORY)
83 #define JODA_JSON_TEXT_STREAM_PARSER_FLAG \
84 (ParserFlag::JSON | ParserFlag::TEXT | ParserFlag::STREAM)
90 template <ParserFlag R_FLAGS>
101 typedef std::pair<std::unique_ptr<IOrigin>, std::string>
payload_t;
112 return std::make_unique<queue_t>();
114 static std::unique_ptr<queue_t>
getQueue(
size_t minCapacity,
115 size_t maxExplicitProducers,
116 size_t maxImplicitProducers = 0) {
117 return std::make_unique<queue_t>(minCapacity, maxExplicitProducers,
118 maxImplicitProducers);
125 typedef std::pair<std::unique_ptr<IDPositionOrigin>,
126 std::unique_ptr<std::basic_istream<char>>>
142 return std::make_unique<queue_t>();
145 static std::unique_ptr<queue_t>
getQueue(
size_t minCapacity,
146 size_t maxExplicitProducers,
147 size_t maxImplicitProducers = 0) {
148 return std::make_unique<queue_t>(minCapacity, maxExplicitProducers,
149 maxImplicitProducers);
#define JODA_JSON_TEXT_PARSER_FLAG
Definition: ParserFlags.h:81
JODA_PARSER_QUEUE< JODA_JSON_TEXT_PARSER_FLAG > JsonTextParserQueue
Definition: ParserFlags.h:156
JODA_PARSER_QUEUE< JODA_JSON_TEXT_STREAM_PARSER_FLAG > JsonTextStreamParserQueue
Definition: ParserFlags.h:158
#define JODA_JSON_TEXT_STREAM_PARSER_FLAG
Definition: ParserFlags.h:83
#define JODA_PARSER_FLAG_T
Definition: ParserFlags.h:12
ParserFlag
Definition: ParserFlags.h:13
std::ostream & operator<<(std::ostream &os, const ParserFlag &flag)
Definition: ParserFlags.h:50
constexpr enum ParserFlag operator&(const enum ParserFlag selfValue, const enum ParserFlag inValue)
Definition: ParserFlags.h:31
constexpr enum ParserFlag operator|(const enum ParserFlag selfValue, const enum ParserFlag inValue)
Definition: ParserFlags.h:25
#define JODA_FLAG_T
Definition: Queue.h:11
Definition: ParserFlags.h:100
static constexpr ParserFlag getFlag()
Definition: ParserFlags.h:109
static std::unique_ptr< queue_t > getQueue(size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers=0)
Definition: ParserFlags.h:114
static constexpr bool hasFlag(ParserFlag flag)
Definition: ParserFlags.h:106
static std::unique_ptr< queue_t > getQueue()
Definition: ParserFlags.h:111
std::pair< std::unique_ptr< IOrigin >, std::string > payload_t
Definition: ParserFlags.h:101
Definition: ParserFlags.h:124
static constexpr bool hasFlag(ParserFlag flag)
Definition: ParserFlags.h:133
static std::unique_ptr< queue_t > getQueue()
Definition: ParserFlags.h:141
static std::unique_ptr< queue_t > getQueue(size_t minCapacity, size_t maxExplicitProducers, size_t maxImplicitProducers=0)
Definition: ParserFlags.h:145
static constexpr ParserFlag getFlag()
Definition: ParserFlags.h:137
std::pair< std::unique_ptr< IDPositionOrigin >, std::unique_ptr< std::basic_istream< char > > > payload_t
Definition: ParserFlags.h:127
Definition: ParserFlags.h:91
JODA_PARSER_QUEUE(JODA_PARSER_QUEUE &q)=delete
Definition: ParserFlags.h:95
static const size_t BLOCK_SIZE
Definition: ParserFlags.h:96
Definition: concurrentqueue.h:349
ParserFlag argument_type
Definition: ParserFlags.h:40
size_t result_type
Definition: ParserFlags.h:41
result_type operator()(const argument_type &x) const
Definition: ParserFlags.h:43