nidas
v1.2-1520
|
Class that should include all that is configurable about a DSM. More...
#include <DSMConfig.h>
Classes | |
class | MyDictionary |
Public Member Functions | |
DSMConfig () | |
virtual | ~DSMConfig () |
void | setSite (const Site *val) |
const Site * | getSite () const |
const Project * | getProject () const |
const std::string & | getName () const |
void | setName (const std::string &val) |
const std::string & | getLocation () const |
void | setLocation (const std::string &val) |
dsm_sample_id_t | getId () const |
void | setId (dsm_sample_id_t val) |
void | addSensor (DSMSensor *sensor) |
void | removeSensor (DSMSensor *sensor) |
const std::list< DSMSensor * > & | getSensors () const |
void | initSensors () throw (nidas::util::IOException) |
void | openSensors (SensorHandler *) |
Pass my sensors to the SensorHandler for opening. More... | |
void | addOutput (SampleOutput *output) |
const std::list< SampleOutput * > & | getOutputs () const |
std::list< nidas::core::FileSet * > | findSampleOutputStreamFileSets () const |
unsigned short | getRemoteSerialSocketPort () const |
void | setRemoteSerialSocketPort (unsigned short val) |
SensorIterator | getSensorIterator () const |
SampleTagIterator | getSampleTagIterator () const |
VariableIterator | getVariableIterator () const |
float | getRawSorterLength () const |
Get the length of the SampleSorter of raw Samples, in seconds. More... | |
void | setRawSorterLength (float val) |
Set the length of the SampleSorter of raw Samples, in seconds. More... | |
float | getProcSorterLength () const |
Get the length of the SampleSorter of processed Samples, in seconds. More... | |
void | setProcSorterLength (float val) |
Set the length of the SampleSorter of processed Samples, in seconds. More... | |
size_t | getRawHeapMax () const |
Get the size of in bytes of the raw SampleSorter. More... | |
void | setRawHeapMax (size_t val) |
Set the size of in bytes of the raw SampleSorter. More... | |
size_t | getProcHeapMax () const |
Get the size of in bytes of the processed SampleSorter. More... | |
void | setProcHeapMax (size_t val) |
Set the size of in bytes of the processed SampleSorter. More... | |
unsigned int | getRawLateSampleCacheSize () const |
Get the size of the late sample cache in the raw sample sorter. More... | |
void | setRawLateSampleCacheSize (unsigned int val) |
Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter. More... | |
unsigned int | getProcLateSampleCacheSize () const |
Get the size of the late sample cache in the processed sample sorter. More... | |
void | setProcLateSampleCacheSize (unsigned int val) |
Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter. More... | |
DSMSensor * | sensorFromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException) |
Parse a DOMElement for a DSMSensor, returning a pointer to the DSMSensor. More... | |
void | validate () throw (nidas::util::InvalidParameterException) |
void | fromDOMElement (const xercesc::DOMElement *) throw (nidas::util::InvalidParameterException) |
Initialize myself from a xercesc::DOMElement. More... | |
xercesc::DOMElement * | toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException) |
Create a DOMElement and append it to the parent. More... | |
xercesc::DOMElement * | toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException) |
Add my content into a DOMElement. More... | |
std::string | expandString (const std::string &input) const |
Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue(). More... | |
bool | getTokenValue (const std::string &token, std::string &value) const |
Implement a lookup for tokens that I know about, like $DSM, $LOCATION. More... | |
const Dictionary & | getDictionary () const |
void | setDerivedDataSocketAddr (const nidas::util::SocketAddress &val) |
const nidas::util::SocketAddress & | getDerivedDataSocketAddr () const |
void | setStatusSocketAddr (const nidas::util::SocketAddress &val) |
const nidas::util::SocketAddress & | getStatusSocketAddr () const |
virtual void | addProcessor (SampleIOProcessor *proc) |
Add a processor to this DSM. More... | |
virtual const std::list < SampleIOProcessor * > & | getProcessors () const |
ProcessorIterator | getProcessorIterator () const |
Static Public Member Functions | |
static const XMLCh * | getNamespaceURI () |
Private Member Functions | |
void | validateSensorAndSampleIds () throw (nidas::util::InvalidParameterException) |
Validate the ids of the DSMSensors belonging to this DSMConfig, and their SampleTags, for uniqueness. More... | |
DSMConfig (const DSMConfig &x) | |
DSMConfig & | operator= (const DSMConfig &x) |
Private Attributes | |
const Site * | _site |
std::string | _name |
std::string | _suffix |
std::string | _location |
nidas::core::DSMConfig::MyDictionary | _dictionary |
unsigned int | _id |
std::list< DSMSensor * > | _ownedSensors |
A list of the sensors on this DSM that have not been passed to a SensorHandler, i.e. More... | |
std::list< DSMSensor * > | _allSensors |
A list of all sensors configured on this DSM. More... | |
std::list< SampleOutput * > | _outputs |
SampleOutputs. More... | |
unsigned short | _remoteSerialSocketPort |
TCP socket port that DSMEngine listens on for remote serial connections. More... | |
float | _rawSorterLength |
float | _procSorterLength |
size_t | _rawHeapMax |
size_t | _procHeapMax |
unsigned int | _rawLateSampleCacheSize |
unsigned int | _procLateSampleCacheSize |
nidas::util::SocketAddress * | _derivedDataSocketAddr |
std::list< SampleIOProcessor * > | _processors |
nidas::util::SocketAddress * | _statusSocketAddr |
Class that should include all that is configurable about a DSM.
It should be able to initialize itself from a <dsm>
XML element, and provide get methods to access its essential pieces, like sensors.
DSMConfig::DSMConfig | ( | ) |
|
virtual |
References _derivedDataSocketAddr, _ownedSensors, _processors, _statusSocketAddr, and getOutputs().
|
private |
|
inline |
References _outputs.
|
inlinevirtual |
void DSMConfig::addSensor | ( | DSMSensor * | sensor | ) |
References _allSensors, _ownedSensors, and nidas::core::DSMSensor::allowOpen().
|
inline |
Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().
If curly brackets are not used, then the TOKEN should be delimited by a '/', a '.' or the end of string, e.g.: xxx/yyy/$ZZZ.dat
References _dictionary, and nidas::core::Dictionary::expandString().
list< nidas::core::FileSet * > DSMConfig::findSampleOutputStreamFileSets | ( | ) | const |
References nidas::core::SampleOutput::getIOChannel(), and getOutputs().
Referenced by nidas::core::Project::findSampleOutputStreamFileSets().
|
virtual |
Initialize myself from a xercesc::DOMElement.
Implements nidas::core::DOMable.
References nidas::core::DOMObjectFactory::createObject(), nidas::core::Project::expandString(), nidas::core::DSMCatalog::find(), nidas::core::DOMable::fromDOMElement(), nidas::core::SampleIOProcessor::fromDOMElement(), nidas::core::XDOMElement::getAttributeValue(), nidas::util::Inet4Address::getByName(), nidas::core::Project::getDSMCatalog(), nidas::util::Logger::getInstance(), nidas::core::XDOMAttr::getName(), nidas::core::XDOMElement::getNodeName(), nidas::util::Logger::log(), LOG_WARNING, NIDAS_MULTICAST_ADDR, port, nidas::core::SampleIOProcessor::setDSMConfig(), nidas::core::SampleOutput::setDSMConfig(), nidas::util::Exception::what(), and WLOG.
Referenced by nidas::core::Site::fromDOMElement().
|
inline |
References _derivedDataSocketAddr.
Referenced by nidas::core::DSMEngine::run().
|
inline |
References _dictionary.
|
inline |
|
inline |
References _location.
Referenced by nidas::core::GetDsmList::execute(), nidas::core::DSMSensor::getLocation(), nidas::core::DSMConfig::MyDictionary::getTokenValue(), and main().
|
inline |
References _name.
Referenced by nidas::core::XMLConfigWriterFilter::acceptDSMNode(), SampleCounter::collectMetadata(), nidas::dynld::UDPSampleOutput::connected(), DataStats::createCounters(), nidas::core::GetDsmList::execute(), nidas::core::Project::findDSM(), nidas::core::Site::findDSM(), nidas::core::Project::findDSMFromHostname(), nidas::core::Site::fromDOMElement(), nidas::core::DSMSensor::fromDOMElement(), nidas::core::DSMSensor::getDSMName(), PConfig::getHostNames(), nidas::core::DSMConfig::MyDictionary::getTokenValue(), main(), ARLIngest::prepareHeaderIds(), nidas::dynld::RawSampleService::printStatus(), DmdA2dCk::run(), nidas::core::DSMEngineStat::run(), PConfig::showCalFiles(), and nidas::core::Site::validate().
|
inlinestaticinherited |
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), toDOMParent(), nidas::core::Project::toDOMParent(), nidas::core::Site::toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inline |
References _outputs.
Referenced by nidas::core::DSMEngine::closeOutputs(), nidas::core::DSMEngine::connectOutputs(), findSampleOutputStreamFileSets(), and ~DSMConfig().
ProcessorIterator DSMConfig::getProcessorIterator | ( | ) | const |
|
inlinevirtual |
References _processors.
Referenced by nidas::core::ProcessorIterator::hasNext().
|
inline |
Get the size of in bytes of the processed SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _procHeapMax.
Referenced by nidas::core::DSMEngine::openSensors().
|
inline |
Get the size of the late sample cache in the processed sample sorter.
See SampleSorter::getLateSampleCacheSize(). Default: 0.
References _procLateSampleCacheSize.
Referenced by nidas::core::DSMEngine::openSensors().
|
inline |
Get the length of the SampleSorter of processed Samples, in seconds.
References _procSorterLength.
Referenced by nidas::core::DSMEngine::openSensors().
const Project * DSMConfig::getProject | ( | ) | const |
|
inline |
Get the size of in bytes of the raw SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _rawHeapMax.
Referenced by nidas::core::DSMEngine::openSensors().
|
inline |
Get the size of the late sample cache in the raw sample sorter.
See SampleSorter::getLateSampleCacheSize(). Default: 0.
References _rawLateSampleCacheSize.
Referenced by nidas::core::DSMEngine::openSensors().
|
inline |
Get the length of the SampleSorter of raw Samples, in seconds.
References _rawSorterLength.
Referenced by nidas::core::DSMEngine::openSensors().
|
inline |
References _remoteSerialSocketPort.
Referenced by nidas::core::DSMEngine::openSensors().
SampleTagIterator DSMConfig::getSampleTagIterator | ( | ) | const |
SensorIterator DSMConfig::getSensorIterator | ( | ) | const |
|
inline |
References _allSensors.
Referenced by nidas::dynld::psql::PSQLProcessor::connect(), nidas::dynld::psql::PSQLProcessor::disconnect(), nidas::core::SensorIterator::hasNext(), DataPrep::matchVariables(), nidas::core::DSMEngine::openSensors(), nidas::dynld::raf::DSMArincSensor::registerWithUDPArincSensor(), DmdA2dCk::run(), ExtractDMT::run(), ExtractFast2D::run(), DataDump::run(), DataStats::run(), PConfig::showCalFiles(), and validateSensorAndSampleIds().
|
inline |
|
inline |
References _statusSocketAddr.
Referenced by nidas::core::DSMEngine::run().
|
inline |
Implement a lookup for tokens that I know about, like $DSM, $LOCATION.
For other tokens, call getSite()->getTokenValue(token,value);
References _dictionary, and nidas::core::DSMConfig::MyDictionary::getTokenValue().
Referenced by nidas::core::DSMSensor::MyDictionary::getTokenValue().
VariableIterator DSMConfig::getVariableIterator | ( | ) | const |
void DSMConfig::initSensors | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References _allSensors, and nidas::core::DSMSensor::init().
Referenced by nidas::core::Site::initSensors().
void DSMConfig::openSensors | ( | SensorHandler * | selector | ) |
Pass my sensors to the SensorHandler for opening.
References _ownedSensors, and nidas::core::SensorHandler::addSensor().
Referenced by nidas::core::DSMEngine::openSensors().
void DSMConfig::removeSensor | ( | DSMSensor * | sensor | ) |
References _allSensors, and _ownedSensors.
DSMSensor * DSMConfig::sensorFromDOMElement | ( | const xercesc::DOMElement * | node | ) | |
throw | ( | nidas::util::InvalidParameterException | |||
) |
Parse a DOMElement for a DSMSensor, returning a pointer to the DSMSensor.
The pointer may be for a new instance of a DSMSensor, or, if the devicename matches a previous DSMSensor that has been added to this DSMConfig, will point to the matching DSMSensor.
References nidas::core::DOMObjectFactory::createObject(), nidas::core::DSMSensor::fromDOMElement(), nidas::core::XDOMElement::getAttributeValue(), nidas::core::DSMSensor::getClassName(), nidas::core::DSMSensor::getDeviceName(), nidas::core::DSMSensor::getName(), nidas::core::XDOMElement::getNodeName(), nidas::core::DSMSensor::setDSMConfig(), and nidas::util::Exception::what().
|
inline |
References _derivedDataSocketAddr, and nidas::util::SocketAddress::clone().
|
inline |
References _id.
|
inline |
References _location.
|
inline |
References _name.
|
inline |
Set the size of in bytes of the processed SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _procHeapMax.
|
inline |
Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.
See SampleSorter::setLateSampleCacheSize(val).
References _procLateSampleCacheSize.
|
inline |
Set the length of the SampleSorter of processed Samples, in seconds.
References _procSorterLength.
|
inline |
Set the size of in bytes of the raw SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _rawHeapMax.
|
inline |
Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.
See SampleSorter::setLateSampleCacheSize(val).
References _rawLateSampleCacheSize.
|
inline |
Set the length of the SampleSorter of raw Samples, in seconds.
References _rawSorterLength.
|
inline |
References _remoteSerialSocketPort.
|
inline |
References _site.
Referenced by nidas::core::Site::fromDOMElement().
|
inline |
References _statusSocketAddr, and nidas::util::SocketAddress::clone().
|
virtual |
Add my content into a DOMElement.
Reimplemented from nidas::core::DOMable.
References nidas::core::SensorIterator::hasNext(), nidas::core::XDOMElement::setAttributeValue(), and nidas::core::DSMSensor::toDOMParent().
|
virtual |
Create a DOMElement and append it to the parent.
Reimplemented from nidas::core::DOMable.
References nidas::core::DOMable::getNamespaceURI().
Referenced by nidas::core::Site::toDOMElement().
void DSMConfig::validate | ( | ) | ||
throw | ( | nidas::util::InvalidParameterException | ||
) |
References getSensorIterator(), nidas::core::SensorIterator::hasNext(), nidas::core::DSMSensor::validate(), and validateSensorAndSampleIds().
Referenced by nidas::core::Site::validate().
|
private |
Validate the ids of the DSMSensors belonging to this DSMConfig, and their SampleTags, for uniqueness.
References nidas::core::DSMSensor::getDSMId(), nidas::core::DSMSensor::getDuplicateIdOK(), nidas::core::SampleTag::getId(), nidas::core::DSMSensor::getId(), nidas::core::DSMSensor::getName(), nidas::core::DSMSensor::getSampleTags(), nidas::core::DSMSensor::getSensorId(), and getSensors().
Referenced by validate().
|
private |
A list of all sensors configured on this DSM.
Referenced by addSensor(), getSensors(), initSensors(), and removeSensor().
|
private |
Referenced by getDerivedDataSocketAddr(), setDerivedDataSocketAddr(), and ~DSMConfig().
|
private |
Referenced by expandString(), getDictionary(), and getTokenValue().
|
private |
Referenced by getLocation(), and setLocation().
|
private |
SampleOutputs.
Referenced by addOutput(), and getOutputs().
|
private |
A list of the sensors on this DSM that have not been passed to a SensorHandler, i.e.
the sensors that DSMConfig still ownes. On a running DSM this list will be empty.
Referenced by addSensor(), openSensors(), removeSensor(), and ~DSMConfig().
|
private |
Referenced by addProcessor(), getProcessors(), and ~DSMConfig().
|
private |
Referenced by getProcHeapMax(), and setProcHeapMax().
|
private |
Referenced by getProcLateSampleCacheSize(), and setProcLateSampleCacheSize().
|
private |
Referenced by getProcSorterLength(), and setProcSorterLength().
|
private |
Referenced by getRawHeapMax(), and setRawHeapMax().
|
private |
Referenced by getRawLateSampleCacheSize(), and setRawLateSampleCacheSize().
|
private |
Referenced by getRawSorterLength(), and setRawSorterLength().
|
private |
TCP socket port that DSMEngine listens on for remote serial connections.
0=don't listen.
Referenced by getRemoteSerialSocketPort(), and setRemoteSerialSocketPort().
|
private |
Referenced by getStatusSocketAddr(), setStatusSocketAddr(), and ~DSMConfig().
|
private |