1 /**
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /** \addtogroup  RTP_Stack
18  *  @{
19  */
20 
21 #ifndef __RTP_ACTIVE_SESSIONDB_H__
22 #define __RTP_ACTIVE_SESSIONDB_H__
23 
24 #include <RtpGlobal.h>
25 #include <list>
26 
27 /**
28  * @class    RtpSessionManager
29  * @brief    Maintains the active rtp sessions in list
30  */
31 class RtpSessionManager
32 {
33 private:
34     // RtpSessionManager pointer.
35     static RtpSessionManager* m_pInstance;
36 
37     // maintains the list of active rtp sessions
38     std::list<RtpDt_Void*> m_objActiveSessionList;
39 
40     // constructor
41     RtpSessionManager();
42 
43     // destructor
44     ~RtpSessionManager();
45 
46 public:
47     // creates RtpSessionManager instance.
48     static RtpSessionManager* getInstance();
49 
50     // adds rtp session to the list
51     RtpDt_Void addRtpSession(IN RtpDt_Void* pvData);
52 
53     // removes rtp session from the list
54     RtpDt_Void removeRtpSession(IN RtpDt_Void* pvData);
55 
56     // returns true if rtp session exists in list
57     eRtp_Bool isValidRtpSession(IN RtpDt_Void* pvData);
58 };
59 
60 #endif /* __RTP_ACTIVE_SESSIONDB_H__*/
61 
62 /** @}*/
63