51 typedef std::map<std::string,
Poller *(*)()> PollerMap;
53 pollerMap[
"built-in"] = createBuiltIn;
58 PollerMap::iterator it;
59 std::string available;
60 for( it = pollerMap.begin(); it != pollerMap.end(); ++it )
62 available += it->first; available +=
", ";
64 if( !available.empty() )
65 available.erase( available.length()-2, 2 );
66 log->
Debug(
PollerMsg,
"Available pollers: %s", available.c_str() );
71 if( preference.empty() )
76 log->
Debug(
PollerMsg,
"Attempting to create a poller according to "
77 "preference: %s", preference.c_str() );
79 std::vector<std::string> prefs;
80 std::vector<std::string>::iterator itP;
82 for( itP = prefs.begin(); itP != prefs.end(); ++itP )
84 it = pollerMap.find( *itP );
85 if( it == pollerMap.end() )
92 return (*it->second)();
static Log * GetLog()
Get default log.
void Error(uint64_t topic, const char *format,...)
Report an error.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
A poller implementation using the build-in XRootD poller.
static Poller * CreatePoller(const std::string &preference)
Interface for socket pollers.
static void splitString(Container &result, const std::string &input, const std::string &delimiter)
Split a string.