ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc.. Fossies Dox: ucommon-7.0.0.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 25 #ifndef _UCOMMON_TEMPORARY_H_ 26 #define _UCOMMON_TEMPORARY_H_ 28 #ifndef _UCOMMON_CONFIG_H_ 32 #ifndef _UCOMMON_PROTOCOLS_H_ 36 #ifndef _UCOMMON_THREAD_H_ 40 #ifndef _UCOMMON_STRING_H_ 44 #ifndef _UCOMMON_MEMORY_H_ 48 #ifndef _UCOMMON_FSYS_H_ 56 #ifndef UCOMMON_SYSRUNTIME 57 #define THROW(x) throw x 58 #define THROWS(x) throw(x) 59 #define THROWS_ANY throw() 61 #define THROW(x) ::abort() 101 for(
size_t p = 0; p < size; ++p)
118 inline operator T&()
const {
138 inline operator bool()
const {
139 return array != NULL;
143 return array == NULL;
159 crit(index <
used,
"array out of bound");
164 crit(index <
used,
"array out of bound");
165 return &
array[index];
169 crit(index <
used,
"array out of bound");
173 inline T&
value(
size_t index)
const {
174 crit(index <
used,
"array out of bound");
179 crit(index <
used,
"array out of bound");
184 return (fp == NULL) || (
array == NULL) ?
189 return (fp == NULL) || (
array == NULL) ?
193 inline size_t seek(FILE *fp,
long pos) {
194 return (fp == NULL) ?
195 0 : (fseek(fp,
sizeof(T) * pos, SEEK_CUR) /
sizeof(T));
214 object = (
char *)::malloc(size);
218 inline operator char *()
const {
234 inline operator bool()
const {
235 return object != NULL;
239 return object == NULL;
257 return (fp == NULL) || (
object == NULL) ?
262 return (fp == NULL) || (
object == NULL) ?
263 0 : fputs(
object, fp);
266 inline size_t seek(FILE *fp,
long pos) {
267 return (fp == NULL) ?
268 0 : fseek(fp, pos, SEEK_CUR);
287 object = (uint8_t *)::malloc(size);
291 inline operator uint8_t *()
const {
307 inline operator bool()
const {
308 return object != NULL;
312 return object == NULL;
323 return (fp == NULL) || (
object == NULL) ?
324 0 : fread(
object, 1, used, fp);
328 return (fp == NULL) || (
object == NULL) ?
329 0 : fwrite(
object, 1, used, fp);
332 inline size_t seek(FILE *fp,
long pos) {
333 return (fp == NULL) ?
334 0 : fseek(fp, pos, SEEK_CUR);
339 if(!
object || (
result = fs.
read(
object, used)) < 0)
346 if(!
object || (
result = fs.
write(
object, used)) < 0)
ssize_t write(const void *buffer, size_t count)
temporary(const temporary< uint8_t * > &)
ssize_t read(void *buffer, size_t count)
temporary(size_t size, const T initial)
temporary & operator=(const T initial)
static void result(const char *path, int code)
size_t seek(FILE *fp, long pos)
void operator()(size_t index, const T value)
size_t seek(FILE *fp, long pos)
size_t seek(FILE *fp, long pos)
uint8_t * operator*() const
T & value(size_t index) const
T * operator()(size_t index) const
temporary(const T initial)
T & operator[](size_t index) const
void value(size_t index, const T value)