// $Id$ /************************************************************ * The Data Acquisition Backbone Core (DABC) * ************************************************************ * Copyright (C) 2009 - * * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * Planckstr. 1, 64291 Darmstadt, Germany * * Contact: http://dabc.gsi.de * ************************************************************ * This software can be used under the GPL license * * agreements as stated in LICENSE.txt file * * which is part of the distribution. * ************************************************************/ #include "dabc/MultiplexerModule.h" #include "dabc/Manager.h" dabc::MultiplexerModule::MultiplexerModule(const std::string& name, dabc::Command cmd) : dabc::ModuleAsync(name, cmd), fQueue(100), fDataRateName() { EnsurePorts(1, 1); fDataRateName = Cfg("DataRateName", cmd).AsStr(); if (!fDataRateName.empty()) CreatePar(fDataRateName).SetRatemeter(false, 3.).SetUnits("MB"); for (unsigned n=0;n0)) { unsigned id = fQueue.Pop(); dabc::Buffer buf = Recv(id); if (buf.null()) EOUT("Fail to get buffer from input %u", id); SendToAllOutputs(buf); } } // ======================================================================================== dabc::RepeaterModule::RepeaterModule(const std::string& name, dabc::Command cmd) : dabc::ModuleAsync(name, cmd) { EnsurePorts(1, 1); std::string ratemeter = Cfg("DataRateName", cmd).AsStr(); if (!ratemeter.empty()) { CreatePar(ratemeter).SetRatemeter(false, 3.).SetUnits("MB"); for (unsigned n=0;n