1 /** @file
2  *
3  *  A brief file description
4  *
5  *  @section license License
6  *
7  *  Licensed to the Apache Software Foundation (ASF) under one
8  *  or more contributor license agreements.  See the NOTICE file
9  *  distributed with this work for additional information
10  *  regarding copyright ownership.  The ASF licenses this file
11  *  to you under the Apache License, Version 2.0 (the
12  *  "License"); you may not use this file except in compliance
13  *  with the License.  You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  *  Unless required by applicable law or agreed to in writing, software
18  *  distributed under the License is distributed on an "AS IS" BASIS,
19  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  *  See the License for the specific language governing permissions and
21  *  limitations under the License.
22  */
23 
24 #include <QUICApplicationMap.h>
25 
26 QUICApplication *
get(QUICStreamId id)27 QUICApplicationMap::get(QUICStreamId id)
28 {
29   auto it = this->_map.find(id);
30   if (it == this->_map.end()) {
31     return this->_default_app;
32   } else {
33     return it->second;
34   }
35 }
36 
37 void
set(QUICStreamId id,QUICApplication * app)38 QUICApplicationMap::set(QUICStreamId id, QUICApplication *app)
39 {
40   this->_map[id] = app;
41 }
42 
43 void
set_default(QUICApplication * app)44 QUICApplicationMap::set_default(QUICApplication *app)
45 {
46   this->_default_app = app;
47 }
48