GNU Radio C++ API Reference: and_const.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
and_const.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012,2018 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11
12#ifndef AND_CONST_H
13#define AND_CONST_H
14
15#include <gnuradio/blocks/api.h>
16#include <gnuradio/sync_block.h>
17#include <cstdint>
18
19namespace gr {
20namespace blocks {
21
22/*!
23 * \brief output[m] = input[m] & value for all M streams.
24 * \ingroup boolean_operators_blk
25 *
26 * \details
27 * Bitwise boolean AND of constant \p k with the data stream.
28 */
29template <class T>
30 class BLOCKS_API and_const : virtual public sync_block
31{
32
33public:
34 // gr::blocks::and_const::sptr
35 typedef std::shared_ptr<and_const<T>> sptr;
36
37 /*!
38 * \brief Create an instance of and_const
39 * \param k AND constant
40 */
41 static sptr make(T k);
42
43 /*!
44 * \brief Return AND constant
45 */
46 virtual T k() const = 0;
47
48 /*!
49 * \brief Set AND constant
50 */
51 virtual void set_k(T k) = 0;
52};
53
54 typedef and_const<std::uint8_t> and_const_bb;
55 typedef and_const<std::int16_t> and_const_ss;
56 typedef and_const<std::int32_t> and_const_ii;
57} /* namespace blocks */
58} /* namespace gr */
59
60#endif /* AND_CONST_H */
gr::blocks::and_const
output[m] = input[m] & value for all M streams.
Definition and_const.h:31
gr::blocks::and_const::sptr
std::shared_ptr< and_const< T > > sptr
Definition and_const.h:35
gr::blocks::and_const::set_k
virtual void set_k(T k)=0
Set AND constant.
gr::blocks::and_const< std::uint8_t >::k
virtual std::uint8_t k() const=0
gr::blocks::and_const::make
static sptr make(T k)
Create an instance of and_const.
gr::sync_block::sync_block
sync_block(void)
Definition sync_block.h:28
api.h
BLOCKS_API
#define BLOCKS_API
Definition gr-blocks/include/gnuradio/blocks/api.h:18
gr::blocks
Definition abs_blk.h:20
gr::blocks::and_const_bb
and_const< std::uint8_t > and_const_bb
Definition and_const.h:54
gr::blocks::and_const_ii
and_const< std::int32_t > and_const_ii
Definition and_const.h:56
gr::blocks::and_const_ss
and_const< std::int16_t > and_const_ss
Definition and_const.h:55
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_block.h