00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2007,2008 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License along 00018 * with this program; if not, write to the Free Software Foundation, Inc., 00019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00020 */ 00021 #ifndef INCLUDED_MB_PORT_SIMPLE_H 00022 #define INCLUDED_MB_PORT_SIMPLE_H 00023 00024 #include <mblock/port.h> 00025 00026 /*! 00027 * \brief Concrete port realization 00028 */ 00029 class mb_port_simple : public mb_port 00030 { 00031 bool d_cache_valid; 00032 mb_msg_accepter_sptr d_cached_accepter; 00033 00034 protected: 00035 static mb_msg_accepter_sptr 00036 find_accepter(mb_port_simple *start); 00037 00038 mb_msg_accepter_sptr 00039 make_accepter(); 00040 00041 public: 00042 mb_port_simple(mb_mblock *mblock, 00043 const std::string &port_name, 00044 const std::string &protocol_class_name, 00045 bool conjugated, 00046 mb_port::port_type_t port_type); 00047 00048 ~mb_port_simple(); 00049 00050 /*! 00051 * \brief send a message 00052 * 00053 * \param signal the event name 00054 * \param data optional data 00055 * \param metadata optional metadata 00056 * \param priority the urgency at which the message is sent 00057 */ 00058 void 00059 send(pmt_t signal, 00060 pmt_t data = PMT_NIL, 00061 pmt_t metadata = PMT_NIL, 00062 mb_pri_t priority = MB_PRI_DEFAULT); 00063 00064 /* 00065 * \brief Invalidate any cached peer resolutions 00066 * \internal 00067 */ 00068 void invalidate_cache(); 00069 00070 }; 00071 00072 #endif /* INCLUDED_MB_PORT_SIMPLE_H */