GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
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 
19 namespace gr {
20 
21 #ifndef GR_BASIC_BLOCK_H
22 class basic_block;
23 class block;
24 #endif
25 
27 {
28 public:
30 
33 
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 
44 private:
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 
58 
59 #endif /* GR_RUNTIME_BLOCK_REGISTRY_H */
GR_RUNTIME_API gr::block_registry global_block_registry
The abstract base class for all signal processing blocks.
Definition: basic_block.h:63
Definition: block_registry.h:27
std::string register_symbolic_name(basic_block *block)
long block_register(basic_block *block)
void register_symbolic_name(basic_block *block, std::string name)
basic_block_sptr block_lookup(pmt::pmt_t symbol)
void unregister_primitive(std::string blk)
void notify_blk(std::string blk)
void update_symbolic_name(basic_block *block, std::string name)
void block_unregister(basic_block *block)
void register_primitive(std::string blk, gr::block *ref)
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
boost::mutex mutex
Definition: thread.h:37
GNU Radio logging wrapper.
Definition: basic_block.h:29
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:83