aboutsummaryrefslogtreecommitdiffstats
path: root/include/distortos/DynamicSignalsReceiver.hpp
blob: 386a61237f3c4075a1d50521b5444b58d351a45a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
 * \file
 * \brief DynamicSignalsReceiver class header
 *
 * \author Copyright (C) 2015 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDE_DISTORTOS_DYNAMICSIGNALSRECEIVER_HPP_
#define INCLUDE_DISTORTOS_DYNAMICSIGNALSRECEIVER_HPP_

#include "distortos/SignalInformationQueueWrapper.hpp"
#include "distortos/SignalsCatcher.hpp"
#include "distortos/SignalsReceiver.hpp"

namespace distortos
{

/**
 * \brief DynamicSignalsReceiver class is a templated interface for SignalsReceiver that has dynamic storage for queued
 * signals and SignalAction associations required for catching signals.
 */

class DynamicSignalsReceiver : public SignalsReceiver
{
public:

	/**
	 * \brief DynamicSignalsReceiver's constructor
	 *
	 * \param [in] queuedSignals is the max number of queued signals, 0 to disable queuing of signals for this receiver
	 * \param [in] signalActions is the max number of different SignalAction objects, 0 to disable catching of signals
	 * for this receiver
	 */

	DynamicSignalsReceiver(size_t queuedSignals, size_t signalActions);

private:

	/// internal SignalInformationQueueWrapper object
	SignalInformationQueueWrapper signalInformationQueueWrapper_;

	/// internal SignalsCatcher object
	SignalsCatcher signalsCatcher_;
};

}	// namespace distortos

#endif	// INCLUDE_DISTORTOS_DYNAMICSIGNALSRECEIVER_HPP_