diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-30 16:14:22 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-30 16:14:22 +0200 |
commit | 7e55cb9224fb7f1586a829f7321ef5b1bded88f5 (patch) | |
tree | 42eb1dbd4d55538bf4e5207d69211c6b01b00375 /include | |
parent | 3e6a24e5d9e81878ac57281e7a9d3b23d3dbc6e8 (diff) |
introduce osmosdr namespace, remove _c suffix
- the namespace conversion adopts the common gnuradio coding guidelines
- suffix removal is a preparation to support 8/16 bit complex data types
Diffstat (limited to 'include')
-rw-r--r-- | include/osmosdr/CMakeLists.txt | 12 | ||||
-rw-r--r-- | include/osmosdr/api.h (renamed from include/osmosdr/osmosdr_api.h) | 0 | ||||
-rw-r--r-- | include/osmosdr/device.h (renamed from include/osmosdr/osmosdr_device.h) | 4 | ||||
-rw-r--r-- | include/osmosdr/pimpl.h (renamed from include/osmosdr/osmosdr_pimpl.h) | 2 | ||||
-rw-r--r-- | include/osmosdr/ranges.h (renamed from include/osmosdr/osmosdr_ranges.h) | 4 | ||||
-rw-r--r-- | include/osmosdr/sink.h (renamed from include/osmosdr/osmosdr_sink_c.h) | 52 | ||||
-rw-r--r-- | include/osmosdr/source.h (renamed from include/osmosdr/osmosdr_source_c.h) | 52 |
7 files changed, 59 insertions, 67 deletions
diff --git a/include/osmosdr/CMakeLists.txt b/include/osmosdr/CMakeLists.txt index 3616384..ecdf792 100644 --- a/include/osmosdr/CMakeLists.txt +++ b/include/osmosdr/CMakeLists.txt @@ -21,11 +21,11 @@ # Install public header files ######################################################################## install(FILES - osmosdr_api.h - osmosdr_pimpl.h - osmosdr_ranges.h - osmosdr_device.h - osmosdr_source_c.h - osmosdr_sink_c.h + api.h + pimpl.h + ranges.h + device.h + source.h + sink.h DESTINATION include/osmosdr ) diff --git a/include/osmosdr/osmosdr_api.h b/include/osmosdr/api.h index d3adbf0..d3adbf0 100644 --- a/include/osmosdr/osmosdr_api.h +++ b/include/osmosdr/api.h diff --git a/include/osmosdr/osmosdr_device.h b/include/osmosdr/device.h index 1f59751..b43bef0 100644 --- a/include/osmosdr/osmosdr_device.h +++ b/include/osmosdr/device.h @@ -21,8 +21,8 @@ #ifndef INCLUDED_OSMOSDR_DEVICE_H #define INCLUDED_OSMOSDR_DEVICE_H -#include <osmosdr/osmosdr_api.h> -#include <osmosdr/osmosdr_pimpl.h> +#include <osmosdr/api.h> +#include <osmosdr/pimpl.h> #include <boost/noncopyable.hpp> #include <boost/lexical_cast.hpp> #include <stdexcept> diff --git a/include/osmosdr/osmosdr_pimpl.h b/include/osmosdr/pimpl.h index b06e0d8..e1985b4 100644 --- a/include/osmosdr/osmosdr_pimpl.h +++ b/include/osmosdr/pimpl.h @@ -20,7 +20,7 @@ #include <boost/shared_ptr.hpp> -/*! \file osmosdr_pimpl.h +/*! \file pimpl.h * "Pimpl idiom" (pointer to implementation idiom). * The OSMOSDR_PIMPL_* macros simplify code overhead for declaring and making pimpls. * diff --git a/include/osmosdr/osmosdr_ranges.h b/include/osmosdr/ranges.h index e085661..ccb2dbc 100644 --- a/include/osmosdr/osmosdr_ranges.h +++ b/include/osmosdr/ranges.h @@ -18,8 +18,8 @@ #ifndef INCLUDED_OSMOSDR_RANGES_H #define INCLUDED_OSMOSDR_RANGES_H -#include <osmosdr/osmosdr_api.h> -#include <osmosdr/osmosdr_pimpl.h> +#include <osmosdr/api.h> +#include <osmosdr/pimpl.h> #include <string> #include <vector> diff --git a/include/osmosdr/osmosdr_sink_c.h b/include/osmosdr/sink.h index fa03300..f6f304f 100644 --- a/include/osmosdr/osmosdr_sink_c.h +++ b/include/osmosdr/sink.h @@ -17,36 +17,16 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_OSMOSDR_SINK_C_H -#define INCLUDED_OSMOSDR_SINK_C_H +#ifndef INCLUDED_OSMOSDR_SINK_H +#define INCLUDED_OSMOSDR_SINK_H -#include <osmosdr/osmosdr_api.h> -#include <osmosdr/osmosdr_ranges.h> +#include <osmosdr/api.h> +#include <osmosdr/ranges.h> #include <gnuradio/hier_block2.h> -class osmosdr_sink_c; +namespace osmosdr { -/* - * We use boost::shared_ptr's instead of raw pointers for all access - * to gr::blocks (and many other data structures). The shared_ptr gets - * us transparent reference counting, which greatly simplifies storage - * management issues. This is especially helpful in our hybrid - * C++ / Python system. - * - * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm - * - * As a convention, the _sptr suffix indicates a boost::shared_ptr - */ -typedef boost::shared_ptr<osmosdr_sink_c> osmosdr_sink_c_sptr; - -/*! - * \brief Return a shared_ptr to a new instance of osmosdr_sink_c. - * - * To avoid accidental use of raw pointers, osmosdr_sink_c's - * constructor is private. osmosdr_make_sink_c is the public - * interface for creating new instances. - */ -OSMOSDR_API osmosdr_sink_c_sptr osmosdr_make_sink_c ( const std::string & args = "" ); +class sink; /*! * \brief Takes a stream of complex samples. @@ -54,9 +34,23 @@ OSMOSDR_API osmosdr_sink_c_sptr osmosdr_make_sink_c ( const std::string & args = * * This uses the preferred technique: subclassing gr::hier_block2. */ -class OSMOSDR_API osmosdr_sink_c : virtual public gr::hier_block2 +class OSMOSDR_API sink : virtual public gr::hier_block2 { public: + typedef boost::shared_ptr< sink > sptr; + + /*! + * \brief Return a shared_ptr to a new instance of sink. + * + * To avoid accidental use of raw pointers, sink's + * constructor is private. osmosdr::sink::make is the public + * interface for creating new instances. + * + * \param args the address to identify the hardware + * \return a new osmosdr sink block object + */ + static sptr make( const std::string & args = "" ); + /*! * Get the number of channels the underlying radio hardware offers. * \return the number of available channels @@ -287,4 +281,6 @@ public: virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 ) = 0; }; -#endif /* INCLUDED_OSMOSDR_SINK_C_H */ +} /* namespace osmosdr */ + +#endif /* INCLUDED_OSMOSDR_SINK_H */ diff --git a/include/osmosdr/osmosdr_source_c.h b/include/osmosdr/source.h index 9b506df..2d0da3b 100644 --- a/include/osmosdr/osmosdr_source_c.h +++ b/include/osmosdr/source.h @@ -17,36 +17,16 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_OSMOSDR_SOURCE_C_H -#define INCLUDED_OSMOSDR_SOURCE_C_H +#ifndef INCLUDED_OSMOSDR_SOURCE_H +#define INCLUDED_OSMOSDR_SOURCE_H -#include <osmosdr/osmosdr_api.h> -#include <osmosdr/osmosdr_ranges.h> +#include <osmosdr/api.h> +#include <osmosdr/ranges.h> #include <gnuradio/hier_block2.h> -class osmosdr_source_c; +namespace osmosdr { -/* - * We use boost::shared_ptr's instead of raw pointers for all access - * to gr::blocks (and many other data structures). The shared_ptr gets - * us transparent reference counting, which greatly simplifies storage - * management issues. This is especially helpful in our hybrid - * C++ / Python system. - * - * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm - * - * As a convention, the _sptr suffix indicates a boost::shared_ptr - */ -typedef boost::shared_ptr<osmosdr_source_c> osmosdr_source_c_sptr; - -/*! - * \brief Return a shared_ptr to a new instance of osmosdr_source_c. - * - * To avoid accidental use of raw pointers, osmosdr_source_c's - * constructor is private. osmosdr_make_source_c is the public - * interface for creating new instances. - */ -OSMOSDR_API osmosdr_source_c_sptr osmosdr_make_source_c ( const std::string & args = "" ); +class source; /*! * \brief Provides a stream of complex samples. @@ -54,9 +34,23 @@ OSMOSDR_API osmosdr_source_c_sptr osmosdr_make_source_c ( const std::string & ar * * This uses the preferred technique: subclassing gr::hier_block2. */ -class OSMOSDR_API osmosdr_source_c : virtual public gr::hier_block2 +class OSMOSDR_API source : virtual public gr::hier_block2 { public: + typedef boost::shared_ptr< source > sptr; + + /*! + * \brief Return a shared_ptr to a new instance of source. + * + * To avoid accidental use of raw pointers, source's + * constructor is private. osmosdr::source::make is the public + * interface for creating new instances. + * + * \param args the address to identify the hardware + * \return a new osmosdr source block object + */ + static sptr make( const std::string & args = "" ); + /*! * Get the number of channels the underlying radio hardware offers. * \return the number of available channels @@ -287,4 +281,6 @@ public: virtual osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 ) = 0; }; -#endif /* INCLUDED_OSMOSDR_SOURCE_C_H */ +} /* namespace osmosdr */ + +#endif /* INCLUDED_OSMOSDR_SOURCE_H */ |