search for: _apis

Displaying 1 result from an estimated 1 matches for "_apis".

Did you mean: apis
2010 May 27
1
[PATCH matahari] Introduces a multiplexer for taking requests and mapping them to APIs.
...ngleton +Multiplexer* Multiplexer::_instance = new Multiplexer(); + +typedef map<string, t_apifunction> APIMAP; + +Multiplexer::Multiplexer() +{} + +Multiplexer* +Multiplexer::instance() +{ + return _instance; +} + +void +Multiplexer::registerAPI(string name, t_apifunction apifunction) +{ + _apis.insert(APIMAP::value_type(string(name), apifunction)); +} + +t_apifunction +Multiplexer::getAPI(string name) +{ + return (*_apis.find(name)).second; +} + +string +Multiplexer::invokeAPI(string name, string input) +{ + string result = string(""); + t_apifunction funcptr = (*_api...