Revision 0f90ae17 gruel/src/lib/pmt/pmt.cc
| b/gruel/src/lib/pmt/pmt.cc | ||
|---|---|---|
| 26 | 26 |
#include <vector> |
| 27 | 27 |
#include <gruel/pmt.h> |
| 28 | 28 |
#include "pmt_int.h" |
| 29 |
#include <stdio.h>
|
|
| 29 |
#include <gruel/msg_accepter.h>
|
|
| 30 | 30 |
#include <gruel/pmt_pool.h> |
| 31 |
#include <stdio.h> |
|
| 31 | 32 |
#include <string.h> |
| 32 | 33 |
|
| 33 | 34 |
namespace pmt {
|
| ... | ... | |
| 882 | 883 |
} |
| 883 | 884 |
|
| 884 | 885 |
//////////////////////////////////////////////////////////////////////////// |
| 886 |
// msg_accepter -- built from "any" |
|
| 887 |
//////////////////////////////////////////////////////////////////////////// |
|
| 888 |
|
|
| 889 |
bool |
|
| 890 |
pmt_is_msg_accepter(const pmt_t &obj) |
|
| 891 |
{
|
|
| 892 |
if (!pmt_is_any(obj)) |
|
| 893 |
return false; |
|
| 894 |
|
|
| 895 |
boost::any r = pmt_any_ref(obj); |
|
| 896 |
return boost::any_cast<gruel::msg_accepter_sptr>(&r) != 0; |
|
| 897 |
} |
|
| 898 |
|
|
| 899 |
//! make a msg_accepter |
|
| 900 |
pmt_t |
|
| 901 |
pmt_make_msg_accepter(gruel::msg_accepter_sptr ma) |
|
| 902 |
{
|
|
| 903 |
return pmt_make_any(ma); |
|
| 904 |
} |
|
| 905 |
|
|
| 906 |
//! Return underlying msg_accepter |
|
| 907 |
gruel::msg_accepter_sptr |
|
| 908 |
pmt_msg_accepter_ref(const pmt_t &obj) |
|
| 909 |
{
|
|
| 910 |
return boost::any_cast<gruel::msg_accepter_sptr>(pmt_any_ref(obj)); |
|
| 911 |
} |
|
| 912 |
|
|
| 913 |
|
|
| 914 |
|
|
| 915 |
//////////////////////////////////////////////////////////////////////////// |
|
| 885 | 916 |
// General Functions |
| 886 | 917 |
//////////////////////////////////////////////////////////////////////////// |
| 887 | 918 |
|
Also available in: Unified diff