GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
count_bits.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2003,2013 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 #ifndef _GR_COUNT_BITS_H_
12 #define _GR_COUNT_BITS_H_
13 
14 #include <gnuradio/blocks/api.h>
15 
16 #include <cstdint>
17 
18 namespace gr {
19 namespace blocks {
20 
21 //! return number of set bits in the low 8 bits of x
22 BLOCKS_API unsigned int count_bits8(unsigned int x);
23 
24 //! return number of set bits in the low 16 bits of x
25 BLOCKS_API unsigned int count_bits16(unsigned int x);
26 
27 //! return number of set bits in the low 32 bits of x
28 BLOCKS_API unsigned int count_bits32(unsigned int x);
29 
30 //! return number of set bits in a 64-bit word
31 BLOCKS_API unsigned int count_bits64(uint64_t x);
32 
33 } /* namespace blocks */
34 } /* namespace gr */
35 
36 #endif /* _GR_COUNT_BITS_H_ */
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
BLOCKS_API unsigned int count_bits64(uint64_t x)
return number of set bits in a 64-bit word
BLOCKS_API unsigned int count_bits16(unsigned int x)
return number of set bits in the low 16 bits of x
BLOCKS_API unsigned int count_bits32(unsigned int x)
return number of set bits in the low 32 bits of x
BLOCKS_API unsigned int count_bits8(unsigned int x)
return number of set bits in the low 8 bits of x
GNU Radio logging wrapper.
Definition: basic_block.h:29