#include "decoder.h" #include "decoders/mpg123_decoder.h" #include namespace decoder { typedef boost::function DecoderFactory; std::map decoder_factories; void init() { mpg123_init(); // initialize the mpg123 library decoder_factories["mpg123"] = boost::factory(); } DecoderBase *get_decoder(const std::string& name) { return decoder_factories[name](); } };