Fast and simple C++ byte stream abstraction
1
Name:
Anonymous
2011-07-04 6:04
I wanted a simple stream like class that was very light-weight and easy to use for binary serialization of variable-length structures. I didn't want it to be much more expensive than just dereferencing values with a pointer, but I wanted it to provide somewhat better type safety and endian byte-order independence for working with different file formats in a portable manner.
Furthermore, I wanted it to be usable on top of asynchronous file and network I/O, so you just serialize your stuff into a big block of memory that you specify, and then when you're done you asynchronously stream it to a file or socket. Same process in reverse for deserialization.
This is what I came up with:
byte_stream.hpp -
http://codepad.org/4IaQJwpi
byte_stream.cpp -
http://codepad.org/8iJiYraM
I've added it to my
libprog++ library, so it has some header dependencies, namely the stuff in byte_swap.hpp which maps to compiler intrinsics or inline assembly using the CPU's byte swapping instructions. I've also removed some ugly preprocessor macros for proper shared library/dll symbol exporting for sake of brevity.
So, what do you think
/prog/ ?
81
Name:
Anonymous
2011-07-04 7:36
OP here.
Stopped reading right there.
82
Name:
Anonymous
2011-07-04 7:36
OP here.
Stopped reading right there.
83
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
84
Name:
Anonymous
2011-07-04 7:37
Why are you shitting on my thread with your script, Lifthp faggot?
85
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
86
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
87
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
88
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
89
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
90
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
91
Name:
Anonymous
2011-07-04 7:37
OP here.
Stopped reading right there.
92
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
93
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
94
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
95
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
96
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
97
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
98
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
99
Name:
Anonymous
2011-07-04 7:38
OP here.
Stopped reading right there.
100
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
101
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
102
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
103
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
104
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
105
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
106
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
107
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
108
Name:
Anonymous
2011-07-04 7:39
OP here.
Stopped reading right there.
109
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
110
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
111
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
112
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
113
Name:
Anonymous
2011-07-04 7:40
DUBZ
also the spammer is written in LISP
114
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
115
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
116
Name:
Anonymous
2011-07-04 7:40
OP here.
Stopped reading right there.
117
Name:
Anonymous
2011-07-04 7:41
OP here.
Stopped reading right there.
118
Name:
Anonymous
2011-07-04 7:41
OP here.
Stopped reading right there.
119
Name:
Anonymous
2011-07-04 7:41
OP here.
Stopped reading right there.
120
Name:
Anonymous
2011-07-04 7:41
OP here.
Stopped reading right there.
Newer Posts