37 #include <boost/spirit/include/qi.hpp>
80 mInstance->add<
PCIe > (
"ipbuspcie-2.0" ,
"Direct access to hardware via PCIe, using IPbus version 2.0", false );
81 mInstance->add<
Mmap > (
"ipbusmmap-2.0" ,
"Direct access to hardware via mmap, using IPbus version 2.0", false );
92 return getClient(aId, aUri, std::vector<std::string>());
102 grammars::URIGrammar lGrammar;
103 std::string::const_iterator lBegin ( aUri.begin() );
104 std::string::const_iterator lEnd ( aUri.end() );
105 boost::spirit::qi::phrase_parse ( lBegin , lEnd , lGrammar , boost::spirit::ascii::space , lUri );
107 catch (
const std::exception& aExc )
109 exception::FailedToParseURI lExc;
110 log ( lExc ,
"Failed to parse device URI " ,
Quote ( aUri ) );
114 log (
Info() ,
"URI " ,
Quote ( aUri ) ,
" parsed as:\n" , lUri );
115 boost::unordered_map< std::string , ClientInfo >::const_iterator lIt =
mClientMap.find ( lUri.
mProtocol );
119 std::stringstream lStr;
123 lStr <<
"\n > " << lIt->first <<
"\t: " << lIt->second.description;
126 exception::ProtocolDoesNotExist lExc;
127 log ( lExc ,
"Protocol " ,
Quote ( lUri.
mProtocol ) ,
" does not exists in map of creators. Options are:" , lStr.str() );
130 else if (lIt->second.userDefined)
132 std::vector<std::string>::const_iterator lIt2 = std::find(aUserClientActivationList.begin(), aUserClientActivationList.end(), lUri.
mProtocol);
134 if (lIt2 == aUserClientActivationList.end()) {
135 exception::ProtocolNotEnabled lExc;
136 log ( lExc ,
"Protocol " ,
Quote ( lUri.
mProtocol ) ,
" with user-defined client is not activated");
141 return lIt->second.creator->create ( aId , lUri );