-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bas van Berckel
committed
Sep 24, 2020
1 parent
bcb1ba1
commit 0d42234
Showing
3 changed files
with
233 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
/** | ||
* Class describing an AMQP confirm frame | ||
* | ||
* @author Marcin Gibula <m.gibula@gmail.com> | ||
* @copyright 2017 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Set up namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class implementation | ||
*/ | ||
class ConfirmFrame : public MethodFrame | ||
{ | ||
protected: | ||
/** | ||
* Constructor | ||
* @param channel channel identifier | ||
* @param size frame size | ||
*/ | ||
ConfirmFrame(uint16_t channel, uint32_t size) : | ||
MethodFrame(channel, size) | ||
{} | ||
|
||
/** | ||
* Constructor based on incoming frame | ||
* @param frame | ||
*/ | ||
ConfirmFrame(ReceivedFrame &frame) : | ||
MethodFrame(frame) | ||
{} | ||
|
||
public: | ||
/** | ||
* Destructor | ||
*/ | ||
virtual ~ConfirmFrame() {} | ||
|
||
/** | ||
* Class id | ||
* @return uint16_t | ||
*/ | ||
virtual uint16_t classID() const override | ||
{ | ||
return 85; | ||
} | ||
}; | ||
|
||
/** | ||
* end namespace | ||
*/ | ||
} | ||
|
||
/** | ||
* Class describing an AMQP confirm frame | ||
* | ||
* @author Marcin Gibula <m.gibula@gmail.com> | ||
* @copyright 2017 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Set up namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class implementation | ||
*/ | ||
class ConfirmFrame : public MethodFrame | ||
{ | ||
protected: | ||
/** | ||
* Constructor | ||
* @param channel channel identifier | ||
* @param size frame size | ||
*/ | ||
ConfirmFrame(uint16_t channel, uint32_t size) : | ||
MethodFrame(channel, size) | ||
{} | ||
|
||
/** | ||
* Constructor based on incoming frame | ||
* @param frame | ||
*/ | ||
ConfirmFrame(ReceivedFrame &frame) : | ||
MethodFrame(frame) | ||
{} | ||
|
||
public: | ||
/** | ||
* Destructor | ||
*/ | ||
virtual ~ConfirmFrame() {} | ||
|
||
/** | ||
* Class id | ||
* @return uint16_t | ||
*/ | ||
virtual uint16_t classID() const override | ||
{ | ||
return 85; | ||
} | ||
}; | ||
|
||
/** | ||
* end namespace | ||
*/ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,88 @@ | ||
/** | ||
* Class describing an AMQP confirm select frame | ||
* | ||
* @author Marcin Gibula <m.gibula@gmail.com> | ||
* @copyright 2017 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Set up namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class implementation | ||
*/ | ||
class ConfirmSelectFrame : public ConfirmFrame | ||
{ | ||
private: | ||
|
||
/** | ||
* whether to wait for a response | ||
* @var BooleanSet | ||
*/ | ||
BooleanSet _noWait; | ||
|
||
protected: | ||
/** | ||
* Encode a frame on a string buffer | ||
* | ||
* @param buffer buffer to write frame to | ||
*/ | ||
virtual void fill(OutBuffer& buffer) const override | ||
{ | ||
// call base | ||
ConfirmFrame::fill(buffer); | ||
|
||
// add boolean | ||
_noWait.fill(buffer); | ||
} | ||
|
||
public: | ||
/** | ||
* Decode a confirm select frame from a received frame | ||
* | ||
* @param frame received frame to decode | ||
*/ | ||
ConfirmSelectFrame(ReceivedFrame& frame) : ConfirmFrame(frame), _noWait(frame) {} | ||
|
||
/** | ||
* Construct a confirm select frame | ||
* | ||
* @param channel channel identifier | ||
* @return newly created confirm select frame | ||
*/ | ||
ConfirmSelectFrame(uint16_t channel, bool noWait = false) : | ||
ConfirmFrame(channel, 1), //sizeof bool | ||
_noWait(noWait) | ||
{} | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
virtual ~ConfirmSelectFrame() {} | ||
|
||
/** | ||
* return the method id | ||
* @return uint16_t | ||
*/ | ||
virtual uint16_t methodID() const override | ||
{ | ||
return 10; | ||
} | ||
|
||
/** | ||
* Return whether to wait for a response | ||
* @return boolean | ||
*/ | ||
bool noWait() const | ||
{ | ||
return _noWait.get(0); | ||
} | ||
}; | ||
|
||
/** | ||
* end namespace | ||
*/ | ||
} | ||
|
||
/** | ||
* Class describing an AMQP confirm select frame | ||
* | ||
* @author Marcin Gibula <m.gibula@gmail.com> | ||
* @copyright 2017 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Set up namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class implementation | ||
*/ | ||
class ConfirmSelectFrame : public ConfirmFrame | ||
{ | ||
private: | ||
|
||
/** | ||
* whether to wait for a response | ||
* @var BooleanSet | ||
*/ | ||
BooleanSet _noWait; | ||
|
||
protected: | ||
/** | ||
* Encode a frame on a string buffer | ||
* | ||
* @param buffer buffer to write frame to | ||
*/ | ||
virtual void fill(OutBuffer& buffer) const override | ||
{ | ||
// call base | ||
ConfirmFrame::fill(buffer); | ||
|
||
// add boolean | ||
_noWait.fill(buffer); | ||
} | ||
|
||
public: | ||
/** | ||
* Decode a confirm select frame from a received frame | ||
* | ||
* @param frame received frame to decode | ||
*/ | ||
ConfirmSelectFrame(ReceivedFrame& frame) : ConfirmFrame(frame), _noWait(frame) {} | ||
|
||
/** | ||
* Construct a confirm select frame | ||
* | ||
* @param channel channel identifier | ||
* @return newly created confirm select frame | ||
*/ | ||
ConfirmSelectFrame(uint16_t channel, bool noWait = false) : | ||
ConfirmFrame(channel, 1), //sizeof bool | ||
_noWait(noWait) | ||
{} | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
virtual ~ConfirmSelectFrame() {} | ||
|
||
/** | ||
* return the method id | ||
* @return uint16_t | ||
*/ | ||
virtual uint16_t methodID() const override | ||
{ | ||
return 10; | ||
} | ||
|
||
/** | ||
* Return whether to wait for a response | ||
* @return boolean | ||
*/ | ||
bool noWait() const | ||
{ | ||
return _noWait.get(0); | ||
} | ||
}; | ||
|
||
/** | ||
* end namespace | ||
*/ | ||
} | ||
|
Oops, something went wrong.