diff --git a/lib/tdm_datatype.hpp b/lib/tdm_datatype.hpp index 5d48f99..01135ad 100644 --- a/lib/tdm_datatype.hpp +++ b/lib/tdm_datatype.hpp @@ -40,6 +40,9 @@ public: tdmdatatype(eFloat32Usi num): float32_(num), dtidx_(5) {}; tdmdatatype(eFloat64Usi num): float64_(num), dtidx_(6) {}; + // identify type + short int& dtype() { return dtidx_; } + // overall assignment operator tdmdatatype& operator=(const tdmdatatype &num) { @@ -90,14 +93,12 @@ public: } tdmdatatype& operator=(const eFloat32Usi &num) { - std::cout<<"tdmdatatype operator= for eFloat32Usi\n"; this->float32_ = num; this->dtidx_ = 5; return *this; } tdmdatatype& operator=(const eFloat64Usi &num) { - std::cout<<"tdmdatatype operator= for eFloat64Usi\n"; this->float64_ = num; this->dtidx_ = 6; return *this; @@ -105,17 +106,17 @@ public: // define custom stream operator to print the correct type friend std::ostream& operator<<(std::ostream& out, const tdmdatatype& num) - { - std::cout<<"operator<< dtidx_:"< -std::vector tdm_reaper::get_channel(std::string& id) +// template +std::vector tdm_reaper::get_channel(std::string& id) { // check for existence of required channel id (=key) if ( tdmchannels_.count(id) == 1 ) @@ -592,7 +592,7 @@ std::vector tdm_reaper::get_channel(std::string& id) // use "values" id to map to external block block blk = tdx_blocks_.at(loccol.external_id_); - + // // distinguish numeric datatypes // switch ( blk.value_type_ ) // { @@ -634,10 +634,14 @@ std::vector tdm_reaper::get_channel(std::string& id) throw std::invalid_argument(std::string("channel id does not exist: ") + id); } - return std::vector(); + std::vector data; + eFloat32Usi m(4); + data.push_back(m); + // std::vector(); + return data; } -template std::vector tdm_reaper::get_channel(std::string& id); +// template std::vector tdm_reaper::get_channel(std::string& id); // std::vector tdm_reaper::get_channel(std::string &id) // { diff --git a/lib/tdm_reaper.hpp b/lib/tdm_reaper.hpp index edc694b..0614774 100644 --- a/lib/tdm_reaper.hpp +++ b/lib/tdm_reaper.hpp @@ -180,8 +180,8 @@ public: } // extract channel by id - template - std::vector get_channel(std::string& id); + // template + std::vector get_channel(std::string& id); // (TODO introduce template T to reference specific datatype instead of double in general) // std::vector get_channel(std::string &id); diff --git a/src/main.cpp b/src/main.cpp index 8564f11..626e6e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -201,15 +201,14 @@ int main(int argc, char* argv[]) std::cout< chdata = jack.get_channel(chid); - // std::string chid("usi14"); - // std::vector chdata = jack.get_channel(chid); - // - // std::cout<<"channel size: "< chgrids = jack.get_channelgroup_ids(); // for ( auto el: chgrids ) std::cout<