17 #ifndef INCLUDED_BMQT_QUEUEFLAGS
18 #define INCLUDED_BMQT_QUEUEFLAGS
32 #include <bsl_iosfwd.h>
33 #include <bsl_string.h>
34 #include <bsls_types.h>
84 static bsl::ostream&
print(bsl::ostream& stream,
87 int spacesPerLevel = 4);
135 static bool isValid(bsl::ostream& errorDescription,
136 bsls::Types::Uint64 flags);
139 static bsls::Types::Uint64
empty();
142 static bool isEmpty(bsls::Types::Uint64 flags);
145 static bool isReader(bsls::Types::Uint64 flags);
148 static bool isWriter(bsls::Types::Uint64 flags);
151 static bool isAdmin(bsls::Types::Uint64 flags);
154 static bool isAck(bsls::Types::Uint64 flags);
157 static void setReader(bsls::Types::Uint64* flags);
160 static void setAdmin(bsls::Types::Uint64* flags);
163 static void setWriter(bsls::Types::Uint64* flags);
166 static void setAck(bsls::Types::Uint64* flags);
169 static void unsetReader(bsls::Types::Uint64* flags);
172 static void unsetAdmin(bsls::Types::Uint64* flags);
175 static void unsetWriter(bsls::Types::Uint64* flags);
178 static void unsetAck(bsls::Types::Uint64* flags);
182 static bsls::Types::Uint64
additions(bsls::Types::Uint64 oldFlags,
183 bsls::Types::Uint64 newFlags);
187 static bsls::Types::Uint64
removals(bsls::Types::Uint64 oldFlags,
188 bsls::Types::Uint64 newFlags);
194 bsls::Types::Uint64 flags);
203 bsls::Types::Uint64* out,
204 const bsl::string& str);
218 return ((flags & flag) != 0);
243 *flags &= ~bmqt::QueueFlags::e_READ;
248 *flags &= ~bmqt::QueueFlags::e_ADMIN;
253 *flags &= ~bmqt::QueueFlags::e_WRITE;
258 *flags &= ~bmqt::QueueFlags::e_ACK;
283 return flags ==
empty();
bsl::ostream & operator<<(bsl::ostream &stream, CompressionAlgorithmType::Enum value)
Definition: bmqt_compressionalgorithmtype.h:141
Definition: bmqa_abstractsession.h:42
Definition: bmqt_queueflags.h:116
static bool isReader(bsls::Types::Uint64 flags)
Returns true if the specified flags represent a reader.
Definition: bmqt_queueflags.h:261
static void unsetWriter(bsls::Types::Uint64 *flags)
Resets the specified flags representation for writer.
Definition: bmqt_queueflags.h:251
static bsl::ostream & prettyPrint(bsl::ostream &stream, bsls::Types::Uint64 flags)
static void setWriter(bsls::Types::Uint64 *flags)
Sets the specified flags representation for writer.
Definition: bmqt_queueflags.h:231
static bool isValid(bsl::ostream &errorDescription, bsls::Types::Uint64 flags)
static bool isWriter(bsls::Types::Uint64 flags)
Returns true if the specified flags represent a writer.
Definition: bmqt_queueflags.h:266
static void setAdmin(bsls::Types::Uint64 *flags)
Sets the specified flags representation for admin.
Definition: bmqt_queueflags.h:226
static bool isSet(bsls::Types::Uint64 flags, QueueFlags::Enum flag)
Definition: bmqt_queueflags.h:215
static void unsetReader(bsls::Types::Uint64 *flags)
Resets the specified flags representation for reader.
Definition: bmqt_queueflags.h:241
static void unsetAdmin(bsls::Types::Uint64 *flags)
Resets the specified flags representation for admin.
Definition: bmqt_queueflags.h:246
static bool isAck(bsls::Types::Uint64 flags)
Returns true if the specified flags represent ack required.
Definition: bmqt_queueflags.h:276
static bool isAdmin(bsls::Types::Uint64 flags)
Returns true if the specified flags represent an admin.
Definition: bmqt_queueflags.h:271
static bsls::Types::Uint64 removals(bsls::Types::Uint64 oldFlags, bsls::Types::Uint64 newFlags)
static int fromString(bsl::ostream &errorDescription, bsls::Types::Uint64 *out, const bsl::string &str)
static void setAck(bsls::Types::Uint64 *flags)
Sets the specified flags representation for ack.
Definition: bmqt_queueflags.h:236
static bool isEmpty(bsls::Types::Uint64 flags)
Returns true if the specified flags have the empty value.
Definition: bmqt_queueflags.h:281
static bsls::Types::Uint64 additions(bsls::Types::Uint64 oldFlags, bsls::Types::Uint64 newFlags)
static void unsetAck(bsls::Types::Uint64 *flags)
Resets the specified flags representation for ack.
Definition: bmqt_queueflags.h:256
static bsls::Types::Uint64 empty()
The empty value for flags.
Definition: bmqt_queueflags.h:286
static void setReader(bsls::Types::Uint64 *flags)
Sets the specified flags representation for reader.
Definition: bmqt_queueflags.h:221
This enum represents queue flags.
Definition: bmqt_queueflags.h:44
static const int k_LOWEST_SUPPORTED_QUEUE_FLAG
Definition: bmqt_queueflags.h:63
static const char * toAscii(QueueFlags::Enum value)
static bsl::ostream & print(bsl::ostream &stream, QueueFlags::Enum value, int level=0, int spacesPerLevel=4)
Enum
Definition: bmqt_queueflags.h:46
@ e_ACK
Definition: bmqt_queueflags.h:54
@ e_ADMIN
Definition: bmqt_queueflags.h:47
@ e_WRITE
Definition: bmqt_queueflags.h:52
@ e_READ
Definition: bmqt_queueflags.h:50
static const int k_HIGHEST_SUPPORTED_QUEUE_FLAG
Definition: bmqt_queueflags.h:68
static bool fromAscii(QueueFlags::Enum *out, const bslstl::StringRef &str)