15#include "framework/pcore/RingBuffer.h"
16#include "framework/pcore/EvtMessage.h"
18#define RBUFSIZE 10000000
19#define MAXEVTSIZE 400000000
24int main(
int argc,
char** argv)
27 printf(
"file2rb : inrbufname outrbufname1 outbufname2 .....\n");
31 printf(
"rb2mrb : allocating %s with size=%d (KBytes)\n", argv[1], RBUFSIZE * 4 / 1000);
38 vector<RingBuffer*> rbufout;
39 for (
int i = 0; i < nout; i++) {
41 printf(
"rb2mrb : allocating %s with size=%d (KBytes)\n", argv[i + 2], RBUFSIZE * 4 / 1000);
42 rbufout.push_back(
new RingBuffer(argv[i + 2], RBUFSIZE));
45 char* evbuf =
new char[MAXEVTSIZE];
51 while ((bsize = rbufin->
remq((
int*)evbuf)) == 0) {
57 if (msg->
type() == MSG_TERMINATE) {
58 printf(
"EoF found. Exitting.....\n");
64 int irb = rbufout[outptr]->insq((
int*)evbuf, bsize);
70 if (outptr >= nout) outptr = 0;
75 for (
int i = 0; i < nout; i++) {
77 int irb = rbufout[i]->insq((
int*)evbuf, bsize);
Class to manage streamed object.
ERecordType type() const
Get record type.
Class to manage a Ring Buffer placed in an IPC shared memory.
int remq(int *buf)
Pick up a buffer from the RingBuffer.
Abstract base class for different kinds of events.