3
* Copyright 2006,2008 Free Software Foundation, Inc.
5
* This file is part of GNU Radio
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)
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.
17
* You should have received a copy of the GNU General Public License along
18
* with this program; if not, write to the Free Software Foundation, Inc.,
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
#ifndef INCLUDED_MB_PORT_H
22
#define INCLUDED_MB_PORT_H
24
#include <mblock/common.h>
27
* \brief Abstract port characteristics
29
class mb_port : boost::noncopyable
33
//! port classification
35
EXTERNAL, //< Externally visible
36
RELAY, //< Externally visible but really connected to a sub-component
37
INTERNAL //< Visible to self only
42
std::string d_port_name;
43
pmt_t d_port_symbol; // the port_name as a pmt symbol
44
pmt_t d_protocol_class;
46
port_type_t d_port_type;
49
mb_mblock *d_mblock; // mblock we're defined in
51
// protected constructor
52
mb_port(mb_mblock *mblock,
53
const std::string &port_name,
54
const std::string &protocol_class_name,
56
mb_port::port_type_t port_type);
58
mb_mblock *mblock() const { return d_mblock; }
61
std::string port_name() const { return d_port_name; }
62
pmt_t port_symbol() const { return d_port_symbol; }
63
pmt_t protocol_class() const { return d_protocol_class; }
64
bool conjugated() const { return d_conjugated; }
65
port_type_t port_type() const { return d_port_type; }
67
pmt_t incoming_message_set() const;
68
pmt_t outgoing_message_set() const;
73
* \brief send a message
75
* \param signal the event name
76
* \param data optional data
77
* \param metadata optional metadata
78
* \param priority the urgency at which the message is sent
83
pmt_t metadata = PMT_F,
84
mb_pri_t priority = MB_PRI_DEFAULT) = 0;
87
* \brief Invalidate any cached peer resolutions
90
virtual void invalidate_cache() = 0;
93
#endif /* INCLUDED_MB_PORT_H */