convert: Modifications to id_type

- Converter ID symbols are exported
- to_string() function for lighter feedback
This commit is contained in:
Martin Braun 2015-01-15 14:37:47 +01:00
parent befbaf97d0
commit bee57ee03f
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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
**********************************************************************/