DUDS
Distributed Update of Data from Something
NullDriver.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
10 #include <duds/hardware/InstrumentDriver.hpp>
11 #include <vector>
12 
13 namespace duds { namespace hardware {
14 
15 class NullDriver : public InstrumentDriver { }; // functions do nothing
16 
17 class NullMultiDriver : public InstrumentDriver {
18  std::vector< shared_ptr< InstrumentAdapter > > adapters;
19 public:
20  NullMultiDriver() = default;
21  NullMultiDriver(size_t numadapt) {
22  adapters.reserve(numadapt);
23  }
24  virtual void setAdapter(const shared_ptr<InstrumentAdapter> &adp) {
25  adapters.push(adp);
26  }
27  void clearAdapters() {
28  adapters.clear();
29  }
30 };
31 
32 class RemoteDriverClient : public InstrumentDriver { };
33 class RemoteDriverServer : public InstrumentDriver { };
34 
35 } }
virtual void setAdapter(const shared_ptr< InstrumentAdapter > &adp)
Definition: NullDriver.hpp:24
NullMultiDriver(size_t numadapt)
Definition: NullDriver.hpp:21
std::vector< shared_ptr< InstrumentAdapter > > adapters
Definition: NullDriver.hpp:18