nidas
v1.2-1520
|
Public Member Functions | |
NidsMerge () | |
int | parseRunstring (int argc, char **argv) throw () |
int | run () throw () |
int | usage (const char *argv0) |
void | sendHeader (dsm_time_t thead, SampleOutput *out) throw (n_u::IOException) |
Method called to write a header to an SampleOutput. More... | |
void | printHeader () |
for debugging. More... | |
Static Public Member Functions | |
static int | main (int argc, char **argv) throw () |
static void | setDefaults (SampleInputHeader &header) |
static void | sendDefaultHeader (SampleOutput *output) throw (nidas::util::IOException) |
Private Member Functions | |
bool | receiveAllowedDsm (SampleOutputStream &, const Sample *) |
receiveAllowedDsm writes the passed sample to the stream if the DSM id of the sample is in allowed_dsms. More... | |
void | flushSorter (dsm_time_t tcur, SampleOutputStream &outStream) |
Private Attributes | |
vector< list< string > > | inputFileNames |
string | outputFileName |
vector< dsm_time_t > | lastTimes |
long long | readAheadUsecs |
UTime | startTime |
UTime | endTime |
int | outputFileLength |
SampleInputHeader | header |
string | configName |
list< unsigned int > | allowed_dsms |
SortedSampleSet3 | sorter |
vector< size_t > | samplesRead |
vector< size_t > | samplesUnique |
unsigned long | ndropped |
NidasApp | _app |
BadSampleFilterArg | FilterArg |
NidasAppArg | KeepOpening |
NidsMerge::NidsMerge | ( | ) |
|
private |
References nidas::core::Sample::freeReference(), receiveAllowedDsm(), samplesRead, samplesUnique, nidas::core::Sample::setTimeTag(), sorter, and tformat().
Referenced by run().
|
static |
References parseRunstring(), run(), and nidas::core::NidasApp::setupSignals().
Referenced by main().
int NidsMerge::parseRunstring | ( | int | argc, |
char ** | argv | ||
) | |||
throw | ( | ||
) |
References nidas::core::NidasAppArg::acceptShortFlag(), nidas::util::LogContext::active(), nidas::core::NidasAppInputFilesArg::allowFiles, nidas::core::NidasAppInputFilesArg::allowSockets, nidas::core::NidasAppArg::asInt(), check_fileset(), DLOG, nidas::core::NidasApp::enableArguments(), nidas::core::NidasApp::EndTime, nidas::core::NidasApp::getEndTime(), nidas::core::NidasApp::getStartTime(), nidas::core::NidasAppArg::getValue(), nidas::core::NidasApp::Help, nidas::core::NidasApp::helpRequested(), nidas::core::NidasApp::InputFiles, LOG_DEBUG, nidas::core::NidasApp::LogConfig, nidas::core::NidasApp::LogFields, nidas::core::NidasApp::LogParam, nidas::core::NidasApp::LogShow, nidas::core::NidasApp::nextArg(), nidas::core::NidasApp::outputFileLength(), nidas::core::NidasApp::outputFileName(), nidas::core::NidasApp::OutputFiles, nidas::core::NidasApp::parseNext(), nidas::core::NidasAppArg::specified(), nidas::core::NidasApp::startArgs(), nidas::core::NidasApp::StartTime, usage(), USECS_PER_SEC, nidas::core::NidasApp::Version, and nidas::util::Exception::what().
Referenced by main().
void NidsMerge::printHeader | ( | ) |
for debugging.
References nidas::core::SampleInputHeader::getArchiveVersion(), nidas::core::SampleInputHeader::getConfigName(), nidas::core::SampleInputHeader::getConfigVersion(), nidas::core::SampleInputHeader::getProjectName(), nidas::core::SampleInputHeader::getSoftwareVersion(), nidas::core::SampleInputHeader::getSystemName(), and header.
|
private |
receiveAllowedDsm writes the passed sample to the stream if the DSM id of the sample is in allowed_dsms.
If allowed_dsms is empty, the sample is written to the stream. Returns whatever stream.receive(sample) returns, or else true, so a return of false means the write to the output stream failed.
References allowed_dsms, nidas::core::Sample::getDSMId(), and nidas::dynld::SampleOutputStream::receive().
Referenced by flushSorter().
int NidsMerge::run | ( | ) | ||
throw | ( | |||
) |
References _app, nidas::core::NidasAppArg::asBool(), nidas::dynld::SampleOutputStream::close(), nidas::dynld::SampleInputStream::close(), DLOG, endTime, FilterArg, nidas::dynld::SampleOutputStream::flush(), flushSorter(), nidas::util::UTime::format(), nidas::core::Sample::freeReference(), nidas::core::Sample::getDSMId(), nidas::util::Exception::getErrno(), nidas::core::FileSet::getFileSet(), nidas::core::BadSampleFilterArg::getFilter(), nidas::core::FileSet::getName(), nidas::core::Sample::getSpSId(), nidas::core::Sample::getTimeTag(), header, inputFileNames, nidas::core::NidasApp::interrupted(), KeepOpening, lastTimes, ndropped, outputFileLength, outputFileName, readAheadUsecs, nidas::dynld::SampleInputStream::readSample(), samplesRead, samplesUnique, nidas::core::BadSampleFilter::setDefaultTimeRange(), nidas::core::FileSet::setEndTime(), nidas::core::FileSet::setFileLengthSecs(), nidas::core::FileSet::setFileName(), nidas::core::SampleOutputBase::setHeaderSource(), nidas::core::FileSet::setKeepOpening(), nidas::core::FileSet::setStartTime(), sorter, startTime, tformat(), nidas::util::UTime::toUsecs(), and nidas::util::Exception::what().
Referenced by main().
|
staticinherited |
|
virtual |
Method called to write a header to an SampleOutput.
Derived classes implement as they see fit.
Implements nidas::core::HeaderSource.
|
staticinherited |
References nidas::core::Version::getArchiveVersion(), nidas::core::Project::getInstance(), nidas::core::Version::getSoftwareVersion(), nidas::core::Project::getSystemName(), nidas::core::SampleInputHeader::setArchiveVersion(), nidas::core::SampleInputHeader::setConfigName(), nidas::core::SampleInputHeader::setConfigVersion(), nidas::core::SampleInputHeader::setProjectName(), nidas::core::SampleInputHeader::setSoftwareVersion(), and nidas::core::SampleInputHeader::setSystemName().
int NidsMerge::usage | ( | const char * | argv0 | ) |
|
private |
Referenced by receiveAllowedDsm().
|
private |
|
private |
Referenced by run().
|
private |
Referenced by printHeader(), and run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by run().
|
private |
Referenced by flushSorter(), and run().
|
private |
Referenced by flushSorter(), and run().
|
private |
Referenced by flushSorter(), and run().