GNU Radio 3.6.3 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 
00006 #ifndef GR_BASIC_BLOCK_H
00007 class gr_basic_block;
00008 class gr_block;
00009 #endif
00010 
00011 class gr_block_registry {
00012     public:
00013         gr_block_registry();
00014 
00015         long block_register(gr_basic_block* block);
00016         void block_unregister(gr_basic_block* block);
00017 
00018         std::string register_symbolic_name(gr_basic_block* block);
00019         void register_symbolic_name(gr_basic_block* block, std::string name);
00020 
00021         gr_basic_block_sptr block_lookup(pmt::pmt_t symbol);
00022  
00023         void register_primitive(std::string blk, gr_block* ref);
00024         void unregister_primitive(std::string blk);
00025         void notify_blk(std::string blk);
00026 
00027     private:
00028      
00029         //typedef std::map< long, gr_basic_block_sptr >   blocksubmap_t;
00030         typedef std::map< long, gr_basic_block* >   blocksubmap_t;
00031         typedef std::map< std::string, blocksubmap_t >  blockmap_t;
00032 
00033         blockmap_t d_map;
00034         pmt::pmt_t d_ref_map;
00035         std::map< std::string, gr_block*> primitive_map;
00036  
00037 };
00038 
00039 extern gr_block_registry global_block_registry;
00040 
00041 #endif
00042