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

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

Loading...
Searching...
No Matches
block_registry.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012-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_RUNTIME_BLOCK_REGISTRY_H
12#define GR_RUNTIME_BLOCK_REGISTRY_H
13
14#include <gnuradio/api.h>
15#include <gnuradio/basic_block.h>
16#include <gnuradio/thread/thread.h>
17#include <map>
18
19namespace gr {
20
21#ifndef GR_BASIC_BLOCK_H
22class basic_block;
23class block;
24#endif
25
26 class GR_RUNTIME_API block_registry
27{
28public:
29 block_registry();
30
31 long block_register(basic_block* block);
32 void block_unregister(basic_block* block);
33
34 std::string register_symbolic_name(basic_block* block);
35 void register_symbolic_name(basic_block* block, std::string name);
36 void update_symbolic_name(basic_block* block, std::string name);
37
38 basic_block_sptr block_lookup(pmt::pmt_t symbol);
39
40 void register_primitive(std::string blk, gr::block* ref);
41 void unregister_primitive(std::string blk);
42 void notify_blk(std::string blk);
43
44private:
45 // typedef std::map< long, basic_block_sptr > blocksubmap_t;
46 typedef std::map<long, basic_block*> blocksubmap_t;
47 typedef std::map<std::string, blocksubmap_t> blockmap_t;
48
49 blockmap_t d_map;
50 pmt::pmt_t d_ref_map;
51 std::map<std::string, block*> primitive_map;
52 gr::thread::mutex d_mutex;
53};
54
55} /* namespace gr */
56
57 GR_RUNTIME_API extern gr::block_registry global_block_registry;
58
59#endif /* GR_RUNTIME_BLOCK_REGISTRY_H */
basic_block.h
global_block_registry
GR_RUNTIME_API gr::block_registry global_block_registry
gr::basic_block
The abstract base class for all signal processing blocks.
Definition basic_block.h:63
gr::block_registry
Definition block_registry.h:27
gr::block_registry::register_symbolic_name
std::string register_symbolic_name(basic_block *block)
gr::block_registry::block_register
long block_register(basic_block *block)
gr::block_registry::block_registry
block_registry()
gr::block_registry::register_symbolic_name
void register_symbolic_name(basic_block *block, std::string name)
gr::block_registry::block_lookup
basic_block_sptr block_lookup(pmt::pmt_t symbol)
gr::block_registry::unregister_primitive
void unregister_primitive(std::string blk)
gr::block_registry::notify_blk
void notify_blk(std::string blk)
gr::block_registry::update_symbolic_name
void update_symbolic_name(basic_block *block, std::string name)
gr::block_registry::block_unregister
void block_unregister(basic_block *block)
gr::block_registry::register_primitive
void register_primitive(std::string blk, gr::block *ref)
gr::block
The abstract base class for all 'terminal' processing blocks.
Definition gnuradio-runtime/include/gnuradio/block.h:63
api.h
GR_RUNTIME_API
#define GR_RUNTIME_API
Definition gnuradio-runtime/include/gnuradio/api.h:18
gr::thread::mutex
boost::mutex mutex
Definition thread.h:37
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
pmt::pmt_t
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition pmt.h:83
thread.h