nidas v1.2.3
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
nidas::core::DSMServerApp Class Reference

#include <DSMServerApp.h>

Public Member Functions

 DSMServerApp ()
 
 ~DSMServerApp ()
 
void initLogger ()
 
int initProcess ()
 
int run () throw ()
 
int parseRunstring (int argc, char **argv)
 
int usage ()
 Send usage message to cerr.
 
void parseXMLConfigFile (const std::string &xmlFileName, Project &)
 Invoke a XMLCachingParser to parse the XML and initialize the Project.
 
void startXmlRpcThread ()
 
void killXmlRpcThread ()
 
void startStatusThread (DSMServer *svr)
 
void killStatusThread ()
 
const std::string & getXMLFileName ()
 What is the XML configuration file name.
 
Dataset getDataset ()
 

Static Public Member Functions

static int main (int argc, char **argv) throw ()
 Run DSMServerApp from the unix command line.
 
static DSMServerAppgetInstance ()
 

Private Types

enum  runState { RUN , QUIT , RESTART , ERROR }
 

Private Member Functions

void setupSignals ()
 Create a signal mask, and block those masked signals.
 
void waitForSignal (int timeoutSecs)
 Unblock and wait for signals of interest up to timeoutSecs.
 
 DSMServerApp (const DSMServerApp &)
 Copy not needed.
 
DSMServerAppoperator= (const DSMServerApp &)
 Assignment not needed.
 

Private Attributes

bool _debug
 -d option.
 
std::string _xmlFileName
 The xml file that is being used for configuration information.
 
std::string _configsXMLName
 The xml file that contains all the project configurations, by date.
 
enum runState _runState
 
DSMServerIntf_xmlrpcThread
 This thread provides XML-based Remote Procedure calls.
 
DSMServerStat_statusThread
 
bool _externalControl
 
bool _optionalProcessing
 
sigset_t _signalMask
 
pthread_t _myThreadId
 
std::string _datasetName
 
NidasApp _app
 
NidasAppArg ExternalControl
 
NidasAppArg OptionalProcessing
 

Static Private Attributes

static DSMServerApp_instance = 0
 

Member Enumeration Documentation

◆ runState

Enumerator
RUN 
QUIT 
RESTART 
ERROR 

Constructor & Destructor Documentation

◆ DSMServerApp() [1/2]

DSMServerApp::DSMServerApp ( )

References setupSignals().

◆ ~DSMServerApp()

DSMServerApp::~DSMServerApp ( )

◆ DSMServerApp() [2/2]

nidas::core::DSMServerApp::DSMServerApp ( const DSMServerApp & )
private

Copy not needed.

Member Function Documentation

◆ getDataset()

Dataset DSMServerApp::getDataset ( )

References _app, _datasetName, and nidas::core::NidasApp::getDataset().

Referenced by run().

◆ getInstance()

static DSMServerApp * nidas::core::DSMServerApp::getInstance ( )
inlinestatic

References _instance.

◆ getXMLFileName()

const std::string & nidas::core::DSMServerApp::getXMLFileName ( )
inline

What is the XML configuration file name.

References _xmlFileName.

◆ initLogger()

void DSMServerApp::initLogger ( )

References _app, and nidas::core::NidasApp::setupDaemon().

Referenced by main().

◆ initProcess()

int DSMServerApp::initProcess ( )

◆ killStatusThread()

void DSMServerApp::killStatusThread ( )

◆ killXmlRpcThread()

void DSMServerApp::killXmlRpcThread ( )

◆ main()

int DSMServerApp::main ( int argc,
char ** argv )
throw ( )
static

◆ operator=()

DSMServerApp & nidas::core::DSMServerApp::operator= ( const DSMServerApp & )
private

Assignment not needed.

◆ parseRunstring()

int DSMServerApp::parseRunstring ( int argc,
char ** argv )

◆ parseXMLConfigFile()

void DSMServerApp::parseXMLConfigFile ( const std::string & xmlFileName,
Project &  )

◆ run()

int DSMServerApp::run ( )
throw ( )

◆ setupSignals()

void DSMServerApp::setupSignals ( )
private

Create a signal mask, and block those masked signals.

DSMEngine uses sigwait, and does not register asynchronous signal handlers.

References _signalMask, and nidas::core::getSample().

Referenced by DSMServerApp().

◆ startStatusThread()

void DSMServerApp::startStatusThread ( DSMServer * svr)
Exceptions
nidas::util::Exception

References _statusThread, and nidas::util::Thread::start().

Referenced by run().

◆ startXmlRpcThread()

void DSMServerApp::startXmlRpcThread ( )

◆ usage()

int DSMServerApp::usage ( )

◆ waitForSignal()

void DSMServerApp::waitForSignal ( int timeoutSecs)
private

Unblock and wait for signals of interest up to timeoutSecs.

After return, _runState will be set depending on the signal received.

References _runState, _signalMask, nidas::core::getSample(), ILOG, PLOG, QUIT, RESTART, timeoutSecs, and WLOG.

Referenced by run().

Member Data Documentation

◆ _app

NidasApp nidas::core::DSMServerApp::_app
private

◆ _configsXMLName

std::string nidas::core::DSMServerApp::_configsXMLName
private

The xml file that contains all the project configurations, by date.

Referenced by parseRunstring(), and run().

◆ _datasetName

std::string nidas::core::DSMServerApp::_datasetName
private

Referenced by getDataset(), parseRunstring(), and run().

◆ _debug

bool nidas::core::DSMServerApp::_debug
private

-d option.

If user wants messages on stderr rather than syslog.

◆ _externalControl

bool nidas::core::DSMServerApp::_externalControl
private

◆ _instance

DSMServerApp * DSMServerApp::_instance = 0
staticprivate

Referenced by getInstance().

◆ _myThreadId

pthread_t nidas::core::DSMServerApp::_myThreadId
private

◆ _optionalProcessing

bool nidas::core::DSMServerApp::_optionalProcessing
private

Referenced by parseRunstring(), and run().

◆ _runState

enum runState nidas::core::DSMServerApp::_runState
private

Referenced by run(), and waitForSignal().

◆ _signalMask

sigset_t nidas::core::DSMServerApp::_signalMask
private

Referenced by setupSignals(), and waitForSignal().

◆ _statusThread

DSMServerStat* nidas::core::DSMServerApp::_statusThread
private

◆ _xmlFileName

std::string nidas::core::DSMServerApp::_xmlFileName
private

The xml file that is being used for configuration information.

Referenced by getXMLFileName(), parseRunstring(), and run().

◆ _xmlrpcThread

DSMServerIntf* nidas::core::DSMServerApp::_xmlrpcThread
private

This thread provides XML-based Remote Procedure calls.

Referenced by killXmlRpcThread(), run(), and startXmlRpcThread().

◆ ExternalControl

NidasAppArg nidas::core::DSMServerApp::ExternalControl
private

Referenced by parseRunstring().

◆ OptionalProcessing

NidasAppArg nidas::core::DSMServerApp::OptionalProcessing
private

Referenced by parseRunstring().


The documentation for this class was generated from the following files: