GNU Radio Manual and C++ API Reference 3.8.5.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 * 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>
29#include <map>
30
31namespace gr {
32
33#ifndef GR_BASIC_BLOCK_H
34class basic_block;
35class block;
36#endif
37
39{
40public:
42
45
47 void register_symbolic_name(basic_block* block, std::string name);
48 void update_symbolic_name(basic_block* block, std::string name);
49
50 basic_block_sptr block_lookup(pmt::pmt_t symbol);
51
52 void register_primitive(std::string blk, gr::block* ref);
53 void unregister_primitive(std::string blk);
54 void notify_blk(std::string blk);
55
56private:
57 // typedef std::map< long, basic_block_sptr > blocksubmap_t;
58 typedef std::map<long, basic_block*> blocksubmap_t;
59 typedef std::map<std::string, blocksubmap_t> blockmap_t;
60
61 blockmap_t d_map;
62 pmt::pmt_t d_ref_map;
63 std::map<std::string, block*> primitive_map;
64 gr::thread::mutex d_mutex;
65};
66
67} /* namespace gr */
68
70
71#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:39
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:72
#define GR_RUNTIME_API
Definition gnuradio-runtime/include/gnuradio/api.h:30
boost::mutex mutex
Definition thread.h:48
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46
boost::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost....
Definition pmt.h:96