From 5d69a524f81f234b3fbc41d49ba18d6f6886baba Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 3 Aug 2006 04:51:51 +0000 Subject: Houston, we have a trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/lib/runtime/gr_message.h | 89 ++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 gnuradio-core/src/lib/runtime/gr_message.h (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h new file mode 100644 index 000000000..272a82ee4 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -0,0 +1,89 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef INCLUDED_GR_MESSAGE_H +#define INCLUDED_GR_MESSAGE_H + +#include +#include + +class gr_message; +typedef boost::shared_ptr gr_message_sptr; + +/*! + * \brief public constructor for gr_message + */ +gr_message_sptr +gr_make_message(long type = 0, double arg1 = 0, double arg2 = 0, size_t length = 0); + +gr_message_sptr +gr_make_message_from_string(const std::string s, long type = 0, double arg1 = 0, double arg2 = 0); + +/*! + * \brief Message. + * + * The ideas and method names for adjustable message length were + * lifted from the click modular router "Packet" class. + */ +class gr_message { + gr_message_sptr d_next; // link field for msg queue + long d_type; // type of the message + double d_arg1; // optional arg1 + double d_arg2; // optional arg2 + + unsigned char *d_buf_start; // start of allocated buffer + unsigned char *d_msg_start; // where the msg starts + unsigned char *d_msg_end; // one beyond end of msg + unsigned char *d_buf_end; // one beyond end of allocated buffer + + gr_message (long type, double arg1, double arg2, size_t length); + + friend gr_message_sptr + gr_make_message (long type, double arg1, double arg2, size_t length); + + friend gr_message_sptr + gr_make_message_from_string (const std::string s, long type, double arg1, double arg2); + + friend class gr_msg_queue; + + unsigned char *buf_data() const { return d_buf_start; } + size_t buf_len() const { return d_buf_end - d_buf_start; } + +public: + ~gr_message (); + + long type() const { return d_type; } + double arg1() const { return d_arg1; } + double arg2() const { return d_arg2; } + + void set_type(long type) { d_type = type; } + void set_arg1(double arg1) { d_arg1 = arg1; } + void set_arg2(double arg2) { d_arg2 = arg2; } + + unsigned char *msg() const { return d_msg_start; } + size_t length() const { return d_msg_end - d_msg_start; } + std::string to_string() const; + +}; + +long gr_message_ncurrently_allocated (); + +#endif /* INCLUDED_GR_MESSAGE_H */ -- cgit From 86f5c92427b3f4bb30536d76cf63c3fca388fb2f Mon Sep 17 00:00:00 2001 From: eb Date: Wed, 13 Sep 2006 21:30:04 +0000 Subject: Updated FSF address in all files. Fixes ticket:51 git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3534 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/lib/runtime/gr_message.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h index 272a82ee4..cae599da1 100644 --- a/gnuradio-core/src/lib/runtime/gr_message.h +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -16,8 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_MESSAGE_H #define INCLUDED_GR_MESSAGE_H -- cgit From 937b719d2e57d0497293d603da10cac2532346f6 Mon Sep 17 00:00:00 2001 From: eb Date: Sat, 21 Jul 2007 03:44:38 +0000 Subject: Updated license from GPL version 2 or later to GPL version 3 or later. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6044 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/lib/runtime/gr_message.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h index cae599da1..e3c52a581 100644 --- a/gnuradio-core/src/lib/runtime/gr_message.h +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -6,7 +6,7 @@ * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) + * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, -- cgit From cda71d951ef0cb2126719fed029d459b23a02fe9 Mon Sep 17 00:00:00 2001 From: eb Date: Thu, 24 Jan 2008 16:29:09 +0000 Subject: Doc fixes from Firas. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7504 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/lib/runtime/gr_message.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h index e3c52a581..179f7d9bc 100644 --- a/gnuradio-core/src/lib/runtime/gr_message.h +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -38,8 +38,9 @@ gr_message_sptr gr_make_message_from_string(const std::string s, long type = 0, double arg1 = 0, double arg2 = 0); /*! - * \brief Message. + * \brief Message class. * + * \ingroup misc * The ideas and method names for adjustable message length were * lifted from the click modular router "Packet" class. */ -- cgit From f914499f4a96fe69ab9cd8dba48f8e3bfc7a54e5 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 20 Jul 2011 18:38:36 -0700 Subject: core: API declaration macros for core class and function symbols --- gnuradio-core/src/lib/runtime/gr_message.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h index 179f7d9bc..ead002616 100644 --- a/gnuradio-core/src/lib/runtime/gr_message.h +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -22,6 +22,7 @@ #ifndef INCLUDED_GR_MESSAGE_H #define INCLUDED_GR_MESSAGE_H +#include #include #include @@ -31,10 +32,10 @@ typedef boost::shared_ptr gr_message_sptr; /*! * \brief public constructor for gr_message */ -gr_message_sptr +GR_CORE_API gr_message_sptr gr_make_message(long type = 0, double arg1 = 0, double arg2 = 0, size_t length = 0); -gr_message_sptr +GR_CORE_API gr_message_sptr gr_make_message_from_string(const std::string s, long type = 0, double arg1 = 0, double arg2 = 0); /*! @@ -44,7 +45,7 @@ gr_make_message_from_string(const std::string s, long type = 0, double arg1 = 0, * The ideas and method names for adjustable message length were * lifted from the click modular router "Packet" class. */ -class gr_message { +class GR_CORE_API gr_message { gr_message_sptr d_next; // link field for msg queue long d_type; // type of the message double d_arg1; // optional arg1 @@ -57,10 +58,10 @@ class gr_message { gr_message (long type, double arg1, double arg2, size_t length); - friend gr_message_sptr + friend GR_CORE_API gr_message_sptr gr_make_message (long type, double arg1, double arg2, size_t length); - friend gr_message_sptr + friend GR_CORE_API gr_message_sptr gr_make_message_from_string (const std::string s, long type, double arg1, double arg2); friend class gr_msg_queue; @@ -85,6 +86,6 @@ public: }; -long gr_message_ncurrently_allocated (); +GR_CORE_API long gr_message_ncurrently_allocated (); #endif /* INCLUDED_GR_MESSAGE_H */ -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- gnuradio-core/src/lib/runtime/gr_message.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core/src/lib/runtime/gr_message.h') diff --git a/gnuradio-core/src/lib/runtime/gr_message.h b/gnuradio-core/src/lib/runtime/gr_message.h index ead002616..d386ca009 100644 --- a/gnuradio-core/src/lib/runtime/gr_message.h +++ b/gnuradio-core/src/lib/runtime/gr_message.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2005 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, @@ -32,7 +32,7 @@ typedef boost::shared_ptr gr_message_sptr; /*! * \brief public constructor for gr_message */ -GR_CORE_API gr_message_sptr +GR_CORE_API gr_message_sptr gr_make_message(long type = 0, double arg1 = 0, double arg2 = 0, size_t length = 0); GR_CORE_API gr_message_sptr @@ -55,7 +55,7 @@ class GR_CORE_API gr_message { unsigned char *d_msg_start; // where the msg starts unsigned char *d_msg_end; // one beyond end of msg unsigned char *d_buf_end; // one beyond end of allocated buffer - + gr_message (long type, double arg1, double arg2, size_t length); friend GR_CORE_API gr_message_sptr -- cgit