14#include "framework/pcore/RingBuffer.h"
19#define MAXBUF 400000000
21int main(
int argc,
char** argv)
24 printf(
"rawfile2rb : rbufname filename neof\n");
28 int fd = open(argv[2], O_RDONLY);
33 int neof = atoi(argv[3]);
38 char* buf =
new char[MAXBUF];
44 int sstat = read(fd, buf,
sizeof(
int));
45 if (sstat <= 0)
break;
46 int* recsize = (
int*)buf;
47 int rstat = read(fd, buf +
sizeof(
int), (*recsize - 1) * 4);
48 if (rstat <= 0)
break;
49 if (nrec % 1000 == 0) {
50 printf(
"record %d: size = %d\n", nrec, *recsize);
55 int irb = rbuf->
insq((
int*)buf, *recsize);
63 lseek(fd, 0, SEEK_SET);
Class to manage a Ring Buffer placed in an IPC shared memory.
void dump_db()
Print some info on the RingBufInfo structure.
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
Abstract base class for different kinds of events.