projects
/
iotcloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generating IV from random numbers, not machine ID and local sequence number.
[iotcloud.git]
/
version2
/
src
/
C
/
ByteBuffer.h
diff --git
a/version2/src/C/ByteBuffer.h
b/version2/src/C/ByteBuffer.h
index a5b6dcf9b7bee044d468833af34a2a06cb3a18b3..06c309bf885a088ff0521f4da6754f0e4f36b86d 100644
(file)
--- a/
version2/src/C/ByteBuffer.h
+++ b/
version2/src/C/ByteBuffer.h
@@
-7,15
+7,23
@@
public:
void put(char c);
void putInt(int32_t l);
void putLong(int64_t l);
void put(char c);
void putInt(int32_t l);
void putLong(int64_t l);
- void put(Array<char> *
array);
+ void put(Array<char> *array);
int64_t getLong();
int32_t getInt();
char get();
int64_t getLong();
int32_t getInt();
char get();
- void get(Array<char> *
array);
+ void get(Array<char> *array);
void position(int32_t newPosition);
void position(int32_t newPosition);
- Array<char> * array();
+ void releaseArray() {buffer = NULL;}
+ Array<char> *array();
+ ~ByteBuffer() {if (buffer != NULL) delete buffer;}
+
private:
private:
+ ByteBuffer(Array<char> *array);
+ friend ByteBuffer *ByteBuffer_wrap(Array<char> *array);
+ friend ByteBuffer *ByteBuffer_allocate(uint size);
+ Array<char> *buffer;
+ uint offset;
};
};
-ByteBuffer *
ByteBuffer_wrap(Array<char> *
array);
-ByteBuffer *
ByteBuffer_allocate(uint size);
+ByteBuffer *
ByteBuffer_wrap(Array<char> *
array);
+ByteBuffer *ByteBuffer_allocate(uint size);
#endif
#endif