| 78 | } |
| 79 | |
| 80 | void Resource::set_method_handler( const string& method, const function< void ( const shared_ptr< Session > ) >& callback ) |
| 81 | { |
| 82 | if ( method.empty( ) ) |
| 83 | { |
| 84 | throw invalid_argument( "Attempt to set resource handler to an empty protocol method." ); |
| 85 | } |
| 86 | |
| 87 | if ( callback not_eq nullptr ) |
| 88 | { |
| 89 | m_pimpl->m_methods.insert( method ); |
| 90 | m_pimpl->m_method_handlers.insert( make_pair( method, callback ) ); |
| 91 | } |
| 92 | } |
| 93 | } |
no outgoing calls
no test coverage detected