I tried to use expert help found here: "http://www.experts-exchange.com/Programming/Languages/CPP/Q_23729314.html
" to build on my design.
Listeners 1 will extract the words from an 21S message that is important to Listener 1 and in doing so build an 2S and 3S message. 2S and 3S are messages Listener 1 understands. For example: Words 1,2,4,5,and 6 from a 21S message gets copied into an 2S message. Words 1,3,7 and 9 from a 21S message gets copied
into an 3S message.
Listeners 2 will extract the words from an 21S message that is important to Listener 2 and in doing so build an 4S and 7S message. 4S and 7S are messages Listener 2 understands. Since the 4S and 7S messages aren't shown in the attached I'll ignore the words numbers.
In my current design each Listener gets an 21S message and this is quickly becoming a maintenance nightmare. I'd like to place a message handler/translator in the middle. The message translators job is to translate an 21S message into the appropriate format the Listener understands. The translator will then give the Listener an 2S,3S(Listener1) or 4S,7S(Listener2) message. I believe that a generic solution exists that will accomplish the goal of the translator but I'm not sure how to do this. I'm not sure how to structure the translator and in doing so exploit C++ template facilities to accomplish my objective.