Hello all,

I was wondering if Boost Asio has any plans to have a structure such as Apache MINA's xxxEncoder/xxxDecoder (which are for Java).

This kind of interface (for those who don't know them yet) allow you to write code such as:

(Warning: very bad {and simplistic} example ahead)

class commands::echo : public message_decoder { somewhere("echo"); }
class commands::cls : public message_decoder { somewhere("cls"); }
...
class commands::exit : public message_decoder { somewhere("exit"); }

class my_protocol_decoder : public protocol_decoder {
    ctor() {
        add(echo);
        add(cls);
        ...
        add(exit);
    }
};

And that would give us a nice protocol decoder that we can plug into a family of "decoding-friendly" classes.

Apache MINA does a great job doing this and maybe there is something that can be extracted into Boost Asio.

Please tell me what you think or if I'm completely mad to want this or even if I'm asking on the wrong place.

Thank you all!!
Rodrigo Madera =o)