diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-01-15 14:37:47 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-01-27 09:58:32 +0100 |
commit | bee57ee03fd4b9dac476da7e375ddd8dcc749b1b (patch) | |
tree | 9010455f97ca74c0664ed2fa30d2628f538d7d47 /host | |
parent | befbaf97d09f1c36437bb285d7a1dc70a34ef6ab (diff) | |
download | uhd-bee57ee03fd4b9dac476da7e375ddd8dcc749b1b.tar.gz uhd-bee57ee03fd4b9dac476da7e375ddd8dcc749b1b.tar.bz2 uhd-bee57ee03fd4b9dac476da7e375ddd8dcc749b1b.zip |
convert: Modifications to id_type
- Converter ID symbols are exported
- to_string() function for lighter feedback
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/convert.hpp | 3 | ||||
-rw-r--r-- | host/lib/convert/convert_impl.cpp | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/host/include/uhd/convert.hpp b/host/include/uhd/convert.hpp index d740d80fb..e42123b20 100644 --- a/host/include/uhd/convert.hpp +++ b/host/include/uhd/convert.hpp @@ -63,12 +63,13 @@ namespace uhd{ namespace convert{ typedef int priority_type; //! Identify a conversion routine in the registry - struct id_type : boost::equality_comparable<id_type>{ + struct UHD_API id_type : boost::equality_comparable<id_type>{ std::string input_format; size_t num_inputs; std::string output_format; size_t num_outputs; std::string to_pp_string(void) const; + std::string to_string(void) const; }; //! Implement equality_comparable interface diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp index 329e94a4d..48eb1f8d6 100644 --- a/host/lib/convert/convert_impl.cpp +++ b/host/lib/convert/convert_impl.cpp @@ -43,10 +43,10 @@ bool convert::operator==(const convert::id_type &lhs, const convert::id_type &rh std::string convert::id_type::to_pp_string(void) const{ return str(boost::format( "conversion ID\n" - " Input format: %s\n" - " Num inputs: %d\n" + " Input format: %s\n" + " Num inputs: %d\n" " Output format: %s\n" - " Num outputs: %d\n" + " Num outputs: %d\n" ) % this->input_format % this->num_inputs @@ -55,6 +55,15 @@ std::string convert::id_type::to_pp_string(void) const{ ); } +std::string convert::id_type::to_string(void) const{ + return str(boost::format("%s (%d) -> %s (%d)") + % this->input_format + % this->num_inputs + % this->output_format + % this->num_outputs + ); +} + /*********************************************************************** * Setup the table registry **********************************************************************/ |