-
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.
basic.get is asynchronous until the entire body has been received, on…
…ly then subsequent messages are sent + first work in progress on implementing smarter buffers
- Loading branch information
1 parent
b97222c
commit e299aa5
Showing
7 changed files
with
138 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Buffer.h | ||
* | ||
* Interface that can be implemented by client applications and that | ||
* is parsed to the Connection::parse() method. | ||
* | ||
* Normally, the Connection::parse() method is fed with a byte | ||
* array. However, if you're receiving big frames, it may be inconvenient | ||
* to copy these big frames into continguous byte arrays, and you | ||
* prefer using objects that internally use linked lists or other | ||
* ways to store the bytes. In such sitations, you can implement this | ||
* interface and pass that to the connection. | ||
* | ||
* @author Emiel Bruijntjes <[email protected]> | ||
* @copyright 2014 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Include guard | ||
*/ | ||
#pragma once | ||
|
||
/** | ||
* Namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class definition | ||
*/ | ||
class Buffer | ||
{ | ||
|
||
|
||
}; | ||
|
||
/** | ||
* End of 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* ByteByffer.h | ||
* | ||
* Very simple implementation of the buffer class that simply wraps | ||
* around a buffer of bytes | ||
* | ||
* @author Emiel Bruijntjes <[email protected]> | ||
* @copyright 2014 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Include guard | ||
*/ | ||
#pragma once | ||
|
||
/** | ||
* Open namespace | ||
*/ | ||
namespace AMQP { | ||
|
||
/** | ||
* Class definition | ||
*/ | ||
class ByteBuffer : public Buffer | ||
{ | ||
private: | ||
/** | ||
* The actual byte buffer | ||
* @var const char * | ||
*/ | ||
const char *_data; | ||
|
||
/** | ||
* Size of the buffer | ||
* @var size_t | ||
*/ | ||
size_t _size; | ||
|
||
public: | ||
/** | ||
* Constructor | ||
* @param data | ||
* @param size | ||
*/ | ||
ByteBuffer(const char *data, size_t size) : _data(data), _size(size) {} | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
virtual ~ByteBuffer() {} | ||
|
||
}; | ||
|
||
/** | ||
* 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
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
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
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