- fixed buffer resize
- added readAt() git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@949 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#define __PROCESSOR_BUFFER_HPP__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <exception>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
#define RETURN_OR_EXCEPT(code) return code
|
||||
#endif
|
||||
|
||||
|
||||
namespace Processor
|
||||
{
|
||||
class IBuffer
|
||||
{
|
||||
public:
|
||||
@@ -59,6 +60,7 @@ class Buffer : public IBuffer
|
||||
T* data_r();
|
||||
size_t write(const T* pData, size_t len);
|
||||
size_t read(T* pData, size_t len);
|
||||
Result readAt(size_t offset, T &x);
|
||||
Result consume(size_t len);
|
||||
Result produce(size_t len);
|
||||
void print(const char *prefix);
|
||||
@@ -98,5 +100,6 @@ class Buffer : public IBuffer
|
||||
};
|
||||
|
||||
#include "Buffer.tcc"
|
||||
};
|
||||
|
||||
#endif // __PROCESSOR_BUFFER_HPP__
|
||||
Reference in New Issue
Block a user