GNU Radio Manual and C++ API Reference 3.7.14.0
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>
28#include <map>
29
30namespace gr {
31
32#ifndef GR_BASIC_BLOCK_H
33class basic_block;
34class block;
35#endif
36
38{
39public:
41
44
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
55private:
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 */
GR_RUNTIME_API gr::block_registry global_block_registry
The abstract base class for all signal processing blocks.
Definition: basic_block.h:60
Definition: block_registry.h:38
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: block.h:66
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
boost::mutex mutex
Definition: thread.h:48
Include this header to use the message passing features.
Definition: basic_block.h:45
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost....
Definition: pmt.h:56