nidas v1.2.3
SampleOutputRequestThread.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 ** 2009, 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#ifndef NIDAS_CORE_SAMPLEOUTPUTREQUESTTHREAD_H
28#define NIDAS_CORE_SAMPLEOUTPUTREQUESTTHREAD_H
29
30#include <list>
31
32#include "SampleOutput.h"
33#include <nidas/util/Thread.h>
34
35namespace nidas { namespace core {
36
41{
42public:
43
49
53 static void destroyInstance();
54
58 int run();
59
63 void interrupt();
64
68 void clear();
69
74
80
91
92private:
93
95
97
99
101
102 std::list<ConnectRequest> _connectRequests;
103
104 std::list<SampleOutput*> _disconnectRequests;
105
107
108};
109
110}} // namespace nidas namespace core
111
112#endif
113
Interface for an object that requests connections SampleOutputs.
Definition ConnectionRequester.h:43
Definition SampleOutputRequestThread.h:81
time_t _when
Definition SampleOutputRequestThread.h:89
SampleOutput * _output
Definition SampleOutputRequestThread.h:87
ConnectRequest(SampleOutput *o, SampleConnectionRequester *r, time_t when)
Definition SampleOutputRequestThread.h:83
SampleConnectionRequester * _requester
Definition SampleOutputRequestThread.h:88
Interface of an output stream of samples.
Definition SampleOutputRequestThread.h:41
SampleOutputRequestThread()
Definition SampleOutputRequestThread.cc:74
void interrupt()
Interrupt the thread.
Definition SampleOutputRequestThread.cc:118
nidas::util::Cond _requestCond
Definition SampleOutputRequestThread.h:106
static SampleOutputRequestThread * getInstance()
Return pointer to instance of singleton, creating instance if necessary.
Definition SampleOutputRequestThread.cc:44
int run()
Definition SampleOutputRequestThread.cc:127
void addConnectRequest(SampleOutput *, SampleConnectionRequester *, int delaySecs)
Add an connect request of a SampleOutput.
Definition SampleOutputRequestThread.cc:80
std::list< SampleOutput * > _disconnectRequests
Definition SampleOutputRequestThread.h:104
static nidas::util::Mutex _instanceLock
Definition SampleOutputRequestThread.h:100
static SampleOutputRequestThread * _instance
Definition SampleOutputRequestThread.h:98
std::list< ConnectRequest > _connectRequests
Definition SampleOutputRequestThread.h:102
~SampleOutputRequestThread()
Definition SampleOutputRequestThread.h:96
static void destroyInstance()
Singleton destructor.
Definition SampleOutputRequestThread.cc:54
void addDeleteRequest(SampleOutput *)
Request that SampleOutputRequestThread delete the output when it can.
Definition SampleOutputRequestThread.cc:93
void clear()
Clear all current requests.
Definition SampleOutputRequestThread.cc:101
Interface of an output stream of samples.
Definition SampleOutput.h:49
A wrapper class for a Posix condition variable.
Definition ThreadSupport.h:258
A C++ wrapper for a POSIX mutex.
Definition ThreadSupport.h:161
Definition Thread.h:83
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31