diff options
author | Josh Blum <josh@joshknows.com> | 2011-01-05 11:37:12 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-01-05 11:37:12 -0800 |
commit | 03f4ce0fb260b8ebf7982a896fbd2ce8ab4c9c5a (patch) | |
tree | 539bc15dfa2708f55f3e78e10bb19155f6687d29 /host/lib | |
parent | d5aef80d35bfef42c6050d76fb9d0441a1af1cb4 (diff) | |
download | uhd-03f4ce0fb260b8ebf7982a896fbd2ce8ab4c9c5a.tar.gz uhd-03f4ce0fb260b8ebf7982a896fbd2ce8ab4c9c5a.tar.bz2 uhd-03f4ce0fb260b8ebf7982a896fbd2ce8ab4c9c5a.zip |
uhd: renamed and tweaked some of the convert files
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/convert/CMakeLists.txt | 10 | ||||
-rw-r--r-- | host/lib/convert/convert_impl.cpp (renamed from host/lib/convert/convert.cpp) | 2 | ||||
-rw-r--r-- | host/lib/convert/gen_convert_pred.py (renamed from host/lib/convert/gen_convert_impl.py) | 9 |
3 files changed, 11 insertions, 10 deletions
diff --git a/host/lib/convert/CMakeLists.txt b/host/lib/convert/CMakeLists.txt index 9324a94b0..06f7ba12a 100644 --- a/host/lib/convert/CMakeLists.txt +++ b/host/lib/convert/CMakeLists.txt @@ -45,14 +45,14 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) LIBUHD_PYTHON_GEN_SOURCE( - ${CMAKE_CURRENT_SOURCE_DIR}/gen_convert_impl.py - ${CMAKE_CURRENT_BINARY_DIR}/convert_impl.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/gen_convert_pred.py + ${CMAKE_CURRENT_BINARY_DIR}/convert_pred.hpp ) INCLUDE(AddFileDependencies) ADD_FILE_DEPENDENCIES( - ${CMAKE_CURRENT_SOURCE_DIR}/convert.cpp - ${CMAKE_CURRENT_BINARY_DIR}/convert_impl.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/convert_impl.cpp + ${CMAKE_CURRENT_BINARY_DIR}/convert_pred.hpp ) LIBUHD_PYTHON_GEN_SOURCE( @@ -61,6 +61,6 @@ LIBUHD_PYTHON_GEN_SOURCE( ) LIBUHD_APPEND_SOURCES( - ${CMAKE_CURRENT_SOURCE_DIR}/convert.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/convert_impl.cpp ${CMAKE_CURRENT_BINARY_DIR}/convert_general.cpp ) diff --git a/host/lib/convert/convert.cpp b/host/lib/convert/convert_impl.cpp index f635a1040..74837cc51 100644 --- a/host/lib/convert/convert.cpp +++ b/host/lib/convert/convert_impl.cpp @@ -22,7 +22,7 @@ using namespace uhd; -#include "convert_impl.hpp" +#include "convert_pred.hpp" static const bool debug = false; diff --git a/host/lib/convert/gen_convert_impl.py b/host/lib/convert/gen_convert_pred.py index 70d437ba2..800897589 100644 --- a/host/lib/convert/gen_convert_impl.py +++ b/host/lib/convert/gen_convert_pred.py @@ -23,11 +23,13 @@ TMPL_TEXT = """ **********************************************************************/ typedef size_t pred_type; -\#include <uhd/utils/algorithm.hpp> +\#include <boost/tokenizer.hpp> \#include <boost/lexical_cast.hpp> \#include <boost/detail/endian.hpp> \#include <boost/cstdint.hpp> \#include <stdexcept> +\#include <string> +\#include <vector> enum dir_type{ DIR_OTW_TO_CPU = 0, @@ -45,7 +47,8 @@ pred_type make_pred(const std::string &markup, dir_type &dir){ pred_type pred = 0; try{ - std::vector<std::string> tokens = std::split_string(markup, "_"); + boost::tokenizer<boost::char_separator<char> > tokenizer(markup, boost::char_separator<char>("_")); + std::vector<std::string> tokens(tokenizer.begin(), tokenizer.end()); //token 0 is <convert> std::string inp_type = tokens.at(1); std::string num_inps = tokens.at(2); @@ -154,8 +157,6 @@ class ph: chan3_p = 0b01000 chan4_p = 0b01100 - nbits = 4 #see above - if __name__ == '__main__': import sys, os file = os.path.basename(__file__) |