GNU Radio Manual and C++ API Reference  3.7.13.4
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  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef GR_RUNTIME_BLOCK_REGISTRY_H
24 #define GR_RUNTIME_BLOCK_REGISTRY_H
25 
26 #include <gnuradio/api.h>
27 #include <gnuradio/basic_block.h>
28 #include <map>
29 
30 namespace gr {
31 
32 #ifndef GR_BASIC_BLOCK_H
33  class basic_block;
34  class block;
35 #endif
36 
38  {
39  public:
41 
42  long block_register(basic_block* block);
43  void block_unregister(basic_block* block);
44 
45  std::string register_symbolic_name(basic_block* block);
46  void register_symbolic_name(basic_block* block, std::string name);
47  void update_symbolic_name(basic_block* block, std::string name);
48 
49  basic_block_sptr block_lookup(pmt::pmt_t symbol);
50 
51  void register_primitive(std::string blk, gr::block* ref);
52  void unregister_primitive(std::string blk);
53  void notify_blk(std::string blk);
54 
55  private:
56  //typedef std::map< long, basic_block_sptr > blocksubmap_t;
57  typedef std::map< long, basic_block* > blocksubmap_t;
58  typedef std::map< std::string, blocksubmap_t > blockmap_t;
59 
60  blockmap_t d_map;
61  pmt::pmt_t d_ref_map;
62  std::map< std::string, block*> primitive_map;
63  gr::thread::mutex d_mutex;
64  };
65 
66 } /* namespace gr */
67 
69 
70 #endif /* GR_RUNTIME_BLOCK_REGISTRY_H */
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
Include this header to use the message passing features.
Definition: logger.h:695
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:58
GR_RUNTIME_API gr::block_registry global_block_registry
boost::mutex mutex
Definition: thread.h:48
Definition: block_registry.h:37
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:56
The abstract base class for all &#39;terminal&#39; processing blocks.A signal processing flow is constructed ...
Definition: block.h:65