3 * Copyright 2006,2007,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_COMMON_H
22 #define INCLUDED_MB_COMMON_H
27 #include <boost/utility.hpp>
28 #include <boost/enable_shared_from_this.hpp>
29 #include <boost/weak_ptr.hpp>
32 * The priority type and valid range
34 typedef unsigned int mb_pri_t;
35 static const mb_pri_t MB_PRI_BEST = 0;
36 static const mb_pri_t MB_PRI_DEFAULT = 4;
37 static const mb_pri_t MB_PRI_WORST = 7;
38 static const mb_pri_t MB_NPRI = MB_PRI_WORST + 1; // number of valid priorities
41 * \brief return true iff priority a is better than priority b
44 mb_pri_better(mb_pri_t a, mb_pri_t b)
50 * \brief return true iff priority a is worse than priority b
53 mb_pri_worse(mb_pri_t a, mb_pri_t b)
59 * \brief ensure that pri is valid
61 inline static mb_pri_t
62 mb_pri_clamp(mb_pri_t p)
64 return p < MB_NPRI ? p : MB_NPRI - 1;
68 typedef boost::shared_ptr<mb_runtime> mb_runtime_sptr;
70 //class mb_runtime_impl;
71 //typedef boost::shared_ptr<mb_runtime_impl> mb_runtime_impl_sptr;
74 typedef boost::shared_ptr<mb_mblock> mb_mblock_sptr;
77 typedef boost::shared_ptr<mb_mblock_impl> mb_mblock_impl_sptr;
80 typedef boost::shared_ptr<mb_port> mb_port_sptr;
82 //class mb_port_detail;
83 //typedef boost::shared_ptr<mb_port_detail> mb_port_detail_sptr;
85 class mb_msg_accepter;
86 typedef boost::shared_ptr<mb_msg_accepter> mb_msg_accepter_sptr;
89 typedef boost::shared_ptr<mb_message> mb_message_sptr;
92 typedef boost::shared_ptr<mb_msg_queue> mb_msg_queue_sptr;
94 #endif /* INCLUDED_MB_COMMON_H */