diff --git a/lib/imc_channel.hpp b/lib/imc_channel.hpp index 77450ec..111fe5e 100644 --- a/lib/imc_channel.hpp +++ b/lib/imc_channel.hpp @@ -88,6 +88,9 @@ namespace imc template std::string joinvec(std::vector
myvec, unsigned long int limit = 10) { + // include entire list for limit = - 1 + limit = (limit == 0) ? myvec.size() : limit; + std::stringstream ss; ss<<"["; if ( myvec.size() <= limit ) @@ -341,7 +344,7 @@ namespace imc } // provide JSON string of metadata - std::string get_json() + std::string get_json(bool include_data = false) { std::stringstream ss; ss<<"{"<<"\"uuid\":\""<(ydata_) - <<"\",\"xdata\":\""<(xdata_) - <<"\",\"aff. blocks\":\""<(ydata_,0) + <<"\",\"xdata\":\""<(xdata_,0); + } + // ss<<"\",\"aff. blocks\":\""< get_channels() + std::vector get_channels(bool json = false, bool include_data = false) { std::vector chns; for ( std::map::iterator it = channels_.begin(); it != channels_.end(); ++it) { - chns.push_back(it->second.get_info()); + if ( !json ) + { + chns.push_back(it->second.get_info()); + } + else + { + chns.push_back(it->second.get_json(include_data)); + } } return chns; }