nidas v1.2.3
SensorOpener.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
27
28#ifndef NIDAS_CORE_SENSOROPENER_H
29#define NIDAS_CORE_SENSOROPENER_H
30
31#include <nidas/util/Thread.h>
34
35namespace nidas { namespace core {
36
37class SensorHandler;
38
43public:
44
50
52
63 void openSensor(DSMSensor *sensor);
64
72 void reopenSensor(DSMSensor *sensor);
73
77 int run();
78
79 void interrupt();
80
81protected:
82
84
85 std::list<DSMSensor*> _sensors;
86
87 std::list<DSMSensor*> _problemSensors;
88
90
91 /* Copy not needed */
93
94 /* Assignment not needed */
96};
97
98}} // namespace nidas namespace core
99
100#endif
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition DSMSensor.h:88
SensorHandler implements a DSMSensor event loop.
Definition SensorHandler.h:88
Thread which opens DSMSensors.
Definition SensorOpener.h:42
nidas::util::Cond _sensorCond
Definition SensorOpener.h:89
void interrupt()
Interrupt this SensorOpener.
Definition SensorOpener.cc:82
void reopenSensor(DSMSensor *sensor)
A SensorHandler calls this method to schedule a sensor to be reopened.
Definition SensorOpener.cc:70
int run()
Thread function, open sensors.
Definition SensorOpener.cc:110
SensorOpener(const SensorOpener &)
SensorHandler * _selector
Definition SensorOpener.h:83
SensorOpener & operator=(const SensorOpener &)
std::list< DSMSensor * > _sensors
Definition SensorOpener.h:85
void openSensor(DSMSensor *sensor)
A SensorHandler calls this method to schedule a sensor to be opened.
Definition SensorOpener.cc:59
~SensorOpener()
Note that SensorOpener does not own the sensors, and does not delete them.
Definition SensorOpener.cc:52
std::list< DSMSensor * > _problemSensors
Definition SensorOpener.h:87
SensorOpener(SensorHandler *)
Constructor.
Definition SensorOpener.cc:41
A wrapper class for a Posix condition variable.
Definition ThreadSupport.h:258
Definition Thread.h:83
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31