Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ROC_SPLITTERMODULE_H
00016 #define ROC_SPLITTERMODULE_H
00017
00018 #include "dabc/ModuleAsync.h"
00019 #include "dabc/Pointer.h"
00020 #include "dabc/timing.h"
00021
00022 #include "roc/BoardsVector.h"
00023
00024 #include <map>
00025
00026 namespace roc {
00027
00028 class SplitterModule : public dabc::ModuleAsync {
00029
00030 protected:
00031
00032 struct OutputRec {
00033
00034 unsigned nout;
00035 dabc::Buffer buf;
00036 dabc::Pointer ptr;
00037 unsigned len;
00038 dabc::TimeStamp lasttm;
00039 bool wassent;
00040
00041 OutputRec() :
00042 nout(0), buf(), ptr(), len(0), lasttm(), wassent(false) {}
00043
00044 OutputRec(const OutputRec& r) :
00045 nout(r.nout), buf(r.buf), ptr(r.ptr), len(r.len), lasttm(r.lasttm), wassent(r.wassent) {}
00046 };
00047
00048 typedef std::map<unsigned, OutputRec> OutputMap;
00049
00050 virtual int ExecuteCommand(dabc::Command cmd);
00051
00052 bool FlushNextBuffer();
00053 void CheckBuffersFlush(bool forceunsent = false);
00054
00055 double fFlushTime;
00056 OutputMap fMap;
00057
00058 public:
00059
00060 SplitterModule(const char* name, dabc::Command cmd);
00061 virtual ~SplitterModule();
00062
00063 virtual void BeforeModuleStart();
00064 virtual void AfterModuleStop();
00065
00066 virtual void ProcessInputEvent(dabc::Port* port);
00067
00068 virtual void ProcessOutputEvent(dabc::Port* port);
00069
00070 virtual void ProcessTimerEvent(dabc::Timer* timer);
00071
00072 };
00073 }
00074
00075 #endif