GNU Radio 3.6.5 C++ API

gr_block_registry.h

Go to the documentation of this file.
00001 #ifndef GR_BLOCK_REGISTRY_H
00002 #define GR_BLOCK_REGISTRY_H
00003 
00004 #include <map>
00005 #include <gr_basic_block.h>
00006 
00007 #ifndef GR_BASIC_BLOCK_H
00008 class gr_basic_block;
00009 class gr_block;
00010 #endif
00011 
00012 class gr_block_registry {
00013     public:
00014         gr_block_registry();
00015 
00016         long block_register(gr_basic_block* block);
00017         void block_unregister(gr_basic_block* block);
00018 
00019         std::string register_symbolic_name(gr_basic_block* block);
00020         void register_symbolic_name(gr_basic_block* block, std::string name);
00021 
00022         gr_basic_block_sptr block_lookup(pmt::pmt_t symbol);
00023  
00024         void register_primitive(std::string blk, gr_block* ref);
00025         void unregister_primitive(std::string blk);
00026         void notify_blk(std::string blk);
00027 
00028     private:
00029      
00030         //typedef std::map< long, gr_basic_block_sptr >   blocksubmap_t;
00031         typedef std::map< long, gr_basic_block* >   blocksubmap_t;
00032         typedef std::map< std::string, blocksubmap_t >  blockmap_t;
00033 
00034         blockmap_t d_map;
00035         pmt::pmt_t d_ref_map;
00036         std::map< std::string, gr_block*> primitive_map;
00037  
00038 };
00039 
00040 extern gr_block_registry global_block_registry;
00041 
00042 #endif
00043