GNU Radio 3.7.3 C++ API
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 
48  basic_block_sptr block_lookup(pmt::pmt_t symbol);
49 
50  void register_primitive(std::string blk, gr::block* ref);
51  void unregister_primitive(std::string blk);
52  void notify_blk(std::string blk);
53 
54  private:
55  //typedef std::map< long, basic_block_sptr > blocksubmap_t;
56  typedef std::map< long, basic_block* > blocksubmap_t;
57  typedef std::map< std::string, blocksubmap_t > blockmap_t;
58 
59  blockmap_t d_map;
60  pmt::pmt_t d_ref_map;
61  std::map< std::string, block*> primitive_map;
62  gr::thread::mutex d_mutex;
63  };
64 
65 } /* namespace gr */
66 
68 
69 #endif /* GR_RUNTIME_BLOCK_REGISTRY_H */
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
The abstract base class for all signal processing blocks.Basic blocks are the bare abstraction of an ...
Definition: basic_block.h:58
VOLK_API $kern pname $kern name
A function pointer to the dispatcher implementation.
GR_RUNTIME_API gr::block_registry global_block_registry
boost::mutex mutex
Definition: thread.h:46
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 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60