convert dos line endings
This commit is contained in:
parent
bcb1ba1361
commit
0d42234a3d
|
|
@ -1,56 +1,56 @@
|
||||||
/**
|
/**
|
||||||
* Class describing an AMQP confirm frame
|
* Class describing an AMQP confirm frame
|
||||||
*
|
*
|
||||||
* @author Marcin Gibula <m.gibula@gmail.com>
|
* @author Marcin Gibula <m.gibula@gmail.com>
|
||||||
* @copyright 2017 Copernica BV
|
* @copyright 2017 Copernica BV
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up namespace
|
* Set up namespace
|
||||||
*/
|
*/
|
||||||
namespace AMQP {
|
namespace AMQP {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class implementation
|
* Class implementation
|
||||||
*/
|
*/
|
||||||
class ConfirmFrame : public MethodFrame
|
class ConfirmFrame : public MethodFrame
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param channel channel identifier
|
* @param channel channel identifier
|
||||||
* @param size frame size
|
* @param size frame size
|
||||||
*/
|
*/
|
||||||
ConfirmFrame(uint16_t channel, uint32_t size) :
|
ConfirmFrame(uint16_t channel, uint32_t size) :
|
||||||
MethodFrame(channel, size)
|
MethodFrame(channel, size)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor based on incoming frame
|
* Constructor based on incoming frame
|
||||||
* @param frame
|
* @param frame
|
||||||
*/
|
*/
|
||||||
ConfirmFrame(ReceivedFrame &frame) :
|
ConfirmFrame(ReceivedFrame &frame) :
|
||||||
MethodFrame(frame)
|
MethodFrame(frame)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~ConfirmFrame() {}
|
virtual ~ConfirmFrame() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class id
|
* Class id
|
||||||
* @return uint16_t
|
* @return uint16_t
|
||||||
*/
|
*/
|
||||||
virtual uint16_t classID() const override
|
virtual uint16_t classID() const override
|
||||||
{
|
{
|
||||||
return 85;
|
return 85;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* end namespace
|
* end namespace
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,88 +1,88 @@
|
||||||
/**
|
/**
|
||||||
* Class describing an AMQP confirm select frame
|
* Class describing an AMQP confirm select frame
|
||||||
*
|
*
|
||||||
* @author Marcin Gibula <m.gibula@gmail.com>
|
* @author Marcin Gibula <m.gibula@gmail.com>
|
||||||
* @copyright 2017 Copernica BV
|
* @copyright 2017 Copernica BV
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up namespace
|
* Set up namespace
|
||||||
*/
|
*/
|
||||||
namespace AMQP {
|
namespace AMQP {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class implementation
|
* Class implementation
|
||||||
*/
|
*/
|
||||||
class ConfirmSelectFrame : public ConfirmFrame
|
class ConfirmSelectFrame : public ConfirmFrame
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* whether to wait for a response
|
* whether to wait for a response
|
||||||
* @var BooleanSet
|
* @var BooleanSet
|
||||||
*/
|
*/
|
||||||
BooleanSet _noWait;
|
BooleanSet _noWait;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Encode a frame on a string buffer
|
* Encode a frame on a string buffer
|
||||||
*
|
*
|
||||||
* @param buffer buffer to write frame to
|
* @param buffer buffer to write frame to
|
||||||
*/
|
*/
|
||||||
virtual void fill(OutBuffer& buffer) const override
|
virtual void fill(OutBuffer& buffer) const override
|
||||||
{
|
{
|
||||||
// call base
|
// call base
|
||||||
ConfirmFrame::fill(buffer);
|
ConfirmFrame::fill(buffer);
|
||||||
|
|
||||||
// add boolean
|
// add boolean
|
||||||
_noWait.fill(buffer);
|
_noWait.fill(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Decode a confirm select frame from a received frame
|
* Decode a confirm select frame from a received frame
|
||||||
*
|
*
|
||||||
* @param frame received frame to decode
|
* @param frame received frame to decode
|
||||||
*/
|
*/
|
||||||
ConfirmSelectFrame(ReceivedFrame& frame) : ConfirmFrame(frame), _noWait(frame) {}
|
ConfirmSelectFrame(ReceivedFrame& frame) : ConfirmFrame(frame), _noWait(frame) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a confirm select frame
|
* Construct a confirm select frame
|
||||||
*
|
*
|
||||||
* @param channel channel identifier
|
* @param channel channel identifier
|
||||||
* @return newly created confirm select frame
|
* @return newly created confirm select frame
|
||||||
*/
|
*/
|
||||||
ConfirmSelectFrame(uint16_t channel, bool noWait = false) :
|
ConfirmSelectFrame(uint16_t channel, bool noWait = false) :
|
||||||
ConfirmFrame(channel, 1), //sizeof bool
|
ConfirmFrame(channel, 1), //sizeof bool
|
||||||
_noWait(noWait)
|
_noWait(noWait)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~ConfirmSelectFrame() {}
|
virtual ~ConfirmSelectFrame() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the method id
|
* return the method id
|
||||||
* @return uint16_t
|
* @return uint16_t
|
||||||
*/
|
*/
|
||||||
virtual uint16_t methodID() const override
|
virtual uint16_t methodID() const override
|
||||||
{
|
{
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether to wait for a response
|
* Return whether to wait for a response
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
bool noWait() const
|
bool noWait() const
|
||||||
{
|
{
|
||||||
return _noWait.get(0);
|
return _noWait.get(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* end namespace
|
* end namespace
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,89 +1,89 @@
|
||||||
/**
|
/**
|
||||||
* Class describing an AMQP confirm select ok frame
|
* Class describing an AMQP confirm select ok frame
|
||||||
*
|
*
|
||||||
* @author Marcin Gibula <m.gibula@gmail.com>
|
* @author Marcin Gibula <m.gibula@gmail.com>
|
||||||
* @copyright 2017 Copernica BV
|
* @copyright 2017 Copernica BV
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up namespace
|
* Set up namespace
|
||||||
*/
|
*/
|
||||||
namespace AMQP {
|
namespace AMQP {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class implementation
|
* Class implementation
|
||||||
*/
|
*/
|
||||||
class ConfirmSelectOKFrame : public ConfirmFrame
|
class ConfirmSelectOKFrame : public ConfirmFrame
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Encode a frame on a string buffer
|
* Encode a frame on a string buffer
|
||||||
*
|
*
|
||||||
* @param buffer buffer to write frame to
|
* @param buffer buffer to write frame to
|
||||||
*/
|
*/
|
||||||
virtual void fill(OutBuffer& buffer) const override
|
virtual void fill(OutBuffer& buffer) const override
|
||||||
{
|
{
|
||||||
// call base
|
// call base
|
||||||
ConfirmFrame::fill(buffer);
|
ConfirmFrame::fill(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor for an incoming frame
|
* Constructor for an incoming frame
|
||||||
*
|
*
|
||||||
* @param frame received frame to decode
|
* @param frame received frame to decode
|
||||||
*/
|
*/
|
||||||
ConfirmSelectOKFrame(ReceivedFrame& frame) :
|
ConfirmSelectOKFrame(ReceivedFrame& frame) :
|
||||||
ConfirmFrame(frame)
|
ConfirmFrame(frame)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a confirm select ok frame
|
* Construct a confirm select ok frame
|
||||||
*
|
*
|
||||||
* @param channel channel identifier
|
* @param channel channel identifier
|
||||||
* @return newly created confirm select ok frame
|
* @return newly created confirm select ok frame
|
||||||
*/
|
*/
|
||||||
ConfirmSelectOKFrame(uint16_t channel) :
|
ConfirmSelectOKFrame(uint16_t channel) :
|
||||||
ConfirmFrame(channel, 0)
|
ConfirmFrame(channel, 0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~ConfirmSelectOKFrame() {}
|
virtual ~ConfirmSelectOKFrame() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the method id
|
* return the method id
|
||||||
* @return uint16_t
|
* @return uint16_t
|
||||||
*/
|
*/
|
||||||
virtual uint16_t methodID() const override
|
virtual uint16_t methodID() const override
|
||||||
{
|
{
|
||||||
return 11;
|
return 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the frame
|
* Process the frame
|
||||||
* @param connection The connection over which it was received
|
* @param connection The connection over which it was received
|
||||||
* @return bool Was it succesfully processed?
|
* @return bool Was it succesfully processed?
|
||||||
*/
|
*/
|
||||||
virtual bool process(ConnectionImpl *connection) override
|
virtual bool process(ConnectionImpl *connection) override
|
||||||
{
|
{
|
||||||
// we need the appropriate channel
|
// we need the appropriate channel
|
||||||
auto channel = connection->channel(this->channel());
|
auto channel = connection->channel(this->channel());
|
||||||
|
|
||||||
// channel does not exist
|
// channel does not exist
|
||||||
if(!channel) return false;
|
if(!channel) return false;
|
||||||
|
|
||||||
// report that the channel is open
|
// report that the channel is open
|
||||||
channel->reportSuccess();
|
channel->reportSuccess();
|
||||||
|
|
||||||
// done
|
// done
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* end namespace
|
* end namespace
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue