nidas v1.2.3
StatusHandler.h
Go to the documentation of this file.
1// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2// vim: set shiftwidth=4 softtabstop=4 expandtab:
3/*
4 ********************************************************************
5 ** NIDAS: NCAR In-situ Data Acquistion Software
6 **
7 ** 2005, Copyright University Corporation for Atmospheric Research
8 **
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
18 **
19 ** The LICENSE.txt file accompanying this software contains
20 ** a copy of the GNU General Public License. If it is not found,
21 ** write to the Free Software Foundation, Inc.,
22 ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 **
24 ********************************************************************
25*/
26#ifndef NIDAS_CORE_STATUSHANDLER_H
27#define NIDAS_CORE_STATUSHANDLER_H
28
29#include <xercesc/sax2/XMLReaderFactory.hpp> // provides SAX2XMLReader
30#include <xercesc/sax2/DefaultHandler.hpp>
32#include <string>
33
34namespace nidas { namespace core {
35
36class StatusListener;
37
41class StatusHandler:public xercesc::DefaultHandler
42{
43public:
45 _listener(lstn), _element(NONE),_src()
46 {
47 }
48
49 // -----------------------------------------------------------------------
50 // Implementations of the SAX ErrorHandler interface
51 // -----------------------------------------------------------------------
52 void warning(const xercesc::SAXParseException & exc);
53 void error(const xercesc::SAXParseException & exc);
54 void fatalError(const xercesc::SAXParseException & exc);
55
56 // -----------------------------------------------------------------------
57 // Implementations of the SAX DocumentHandler interface
58 // -----------------------------------------------------------------------
59 void startElement(const XMLCh * const uri,
60 const XMLCh * const localname,
61 const XMLCh * const qname,
62 const xercesc::Attributes & attributes);
63
64 void endElement(const XMLCh * const uri,
65 const XMLCh * const localname,
66 const XMLCh * const qname);
67
68 void characters(const XMLCh * const chars,
69 const XMLSize_t length);
70
72
73private:
74
77
79
81 std::string _src;
82
85
88};
89
90}} // namespace nidas namespace core
91
92#endif
This class implements handling routines for the SAX2 parser.
Definition StatusHandler.h:42
StatusHandler & operator=(const StatusHandler &)
No assignment.
void fatalError(const xercesc::SAXParseException &exc)
Definition StatusHandler.cc:61
enum elementType _element
Definition StatusHandler.h:78
StatusListener * _listener
reference to listener thread
Definition StatusHandler.h:76
StatusHandler(StatusListener *lstn)
Definition StatusHandler.h:44
void warning(const xercesc::SAXParseException &exc)
Definition StatusHandler.cc:45
StatusHandler(const StatusHandler &)
No copying.
void characters(const XMLCh *const chars, const XMLSize_t length)
Definition StatusHandler.cc:103
elementType
Definition StatusHandler.h:71
@ STATUS
Definition StatusHandler.h:71
@ SAMPLEPOOL
Definition StatusHandler.h:71
@ NONE
Definition StatusHandler.h:71
@ TIME
Definition StatusHandler.h:71
@ SOURCE
Definition StatusHandler.h:71
std::string _src
host name of socket source
Definition StatusHandler.h:81
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const xercesc::Attributes &attributes)
Definition StatusHandler.cc:73
void error(const xercesc::SAXParseException &exc)
Definition StatusHandler.cc:53
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
Definition StatusHandler.cc:96
thread that listens to multicast messages from all of the DSMs.
Definition StatusListener.h:46
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31