]> git.gag.com Git - debian/gnuradio/blob - mblock/src/lib/mb_message.h
ee88d79f74eed46462fb83846ed4be9519699bd8
[debian/gnuradio] / mblock / src / lib / mb_message.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006 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 2, 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 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.
20  */
21 #ifndef INCLUDED_MB_MESSAGE_H
22 #define INCLUDED_MB_MESSAGE_H
23
24 #include <mb_common.h>
25
26 class mb_message;
27 typedef boost::shared_ptr<mb_message> mb_message_sptr;
28
29 /*!
30  * \brief construct a message and return boost::shared_ptr
31  *
32  * \param signal        identifier of the message
33  * \param data          the data to be operated on
34  * \param metadata      information about the data
35  * \param priority      urgency
36  */
37 mb_message_sptr 
38 mb_make_message(pmt_t signal,
39                 pmt_t data = PMT_NIL,
40                 pmt_t metadata = PMT_NIL,
41                 mb_pri_t priority = MB_PRI_DEFAULT);
42
43 class mb_message {
44   pmt_t         d_signal;
45   pmt_t         d_data;
46   pmt_t         d_metadata;
47   mb_pri_t      d_priority;
48   // foo        d_rcvd_port_id;
49
50   friend mb_message_sptr
51   mb_make_message(pmt_t signal, pmt_t data, pmt_t metadata, mb_pri_t priority);
52
53   // private constructor
54   mb_message(pmt_t signal, pmt_t data, pmt_t metadata, mb_pri_t priority);
55
56 public:
57   ~mb_message();
58
59   pmt_t signal() const { return d_signal; }
60   pmt_t data() const { return d_data; }
61   pmt_t metadata() const { return d_metadata; }
62   mb_pri_t priority() const { return d_priority; }
63   // foo rcvd_port_id const { return d_rcvd_port_id; }
64 };
65
66 #endif /* INCLUDED_MB_MESSAGE_H */