addConverter.patch
src/rsb/ParticipantConfig.cpp | ||
---|---|---|
68 | 68 |
return this->converters; |
69 | 69 |
} |
70 | 70 | |
71 |
void ParticipantConfig::Transport::addConverter(const string &wireschema, const string &datatype) |
|
72 |
{ |
|
73 |
this->converters.insert(make_pair(wireschema, datatype)); |
|
74 |
} |
|
75 | ||
76 |
void ParticipantConfig::Transport::addConverters(const ParticipantConfig::Transport::ConverterNames &converters) |
|
77 |
{ |
|
78 |
this->converters.insert(converters.begin(), converters.end()); |
|
79 |
} |
|
80 | ||
71 | 81 |
rsc::runtime::Properties ParticipantConfig::Transport::getOptions() const { |
72 | 82 |
return this->options; |
73 | 83 |
} |
... | ... | |
103 | 113 |
"Option key `%1%' has invalid number of components; converter-related keys for transports has to have three components") |
104 | 114 |
% key)); |
105 | 115 |
} |
106 |
this->converters.insert(make_pair(key[2], value));
|
|
116 |
this->addConverter(key[2], value);
|
|
107 | 117 |
} else if ((key.size() >= 2) && (key[0] == "converter")) { |
108 | 118 |
// ignore converters for other languages |
109 | 119 |
} else { |
src/rsb/ParticipantConfig.h | ||
---|---|---|
74 | 74 |
public rsc::config::OptionHandler, |
75 | 75 |
public rsc::runtime::Printable { |
76 | 76 |
public: |
77 |
/** |
|
78 |
* The set of preferred converters lists (wire-schema, data-type) pairs. |
|
79 |
*/ |
|
77 | 80 |
typedef std::set<std::pair<std::string, std::string> > ConverterNames; |
78 | 81 | |
79 | 82 |
/** |
... | ... | |
95 | 98 |
*/ |
96 | 99 |
std::string getName() const; |
97 | 100 | |
101 |
/** |
|
102 |
* Return the set of preferred converters. |
|
103 |
* This list is typically initialized from options. See @a handleOption(). |
|
104 |
*/ |
|
98 | 105 |
ConverterNames getConverters() const; |
99 | 106 | |
100 | 107 |
/** |
108 |
* add a preferred converter |
|
109 |
*/ |
|
110 |
void addConverter(const std::string &wireschema, const std::string &datatype); |
|
111 | ||
112 |
/** |
|
113 |
* add preferred converters |
|
114 |
*/ |
|
115 |
void addConverters(const ConverterNames& converters); |
|
116 | ||
117 |
/** |
|
101 | 118 |
* Returns the specified options for the transport. |
102 | 119 |
* |
103 | 120 |
* @return copy of options for the transport |