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 : inrbufname1 inrbufname2 .... outrbufname\n");
33 vector<RingBuffer*> rbufin;
34 for (
int i = 0; i < nin; i++) {
36 printf(
"mrb2rb : allocating %s with size=%d (KBytes)\n", argv[i + 1], RBUFSIZE * 4 / 1000);
37 rbufin.push_back(
new RingBuffer(argv[i + 1], RBUFSIZE));
42 char* evbuf =
new char[MAXEVTSIZE];
48 while ((bsize = rbufin[inptr]->remq((
int*)evbuf)) == 0) {
54 if (msg->
type() == MSG_TERMINATE) {
55 printf(
"EoF found. Exitting.....\n");
60 int irb = rbufout->
insq((
int*)evbuf, bsize);
66 if (inptr >= nin) inptr = 0;
Class to manage streamed object.
ERecordType type() const
Get record type.
Class to manage a Ring Buffer placed in an IPC shared memory.
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
Abstract base class for different kinds of events.