sipxmedialib  Version 3.3
MpAlsaContainer.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007-2015 SIPez LLC. All rights reserved.
3 //
4 // $$
6 
7 #ifndef _MpALSADeviceWrapperContainer_h_
8 #define _MpALSADeviceWrapperContainer_h_
9 
10 
11 // SYSTEM INCLUDES
12 // APPLICATION INCLUDES
13 #include "utl/UtlString.h"
14 #include "utl/UtlHashMap.h"
15 #include "os/OsMutex.h"
16 
17 // DEFINES
18 // MACROS
19 // EXTERNAL FUNCTIONS
20 // EXTERNAL VARIABLES
21 // CONSTANTS
22 // STRUCTS
23 // TYPEDEFS
24 // FORWARD DECLARATIONS
25 class MpAlsa;
26 
27 class MpAlsaContainer : protected UtlHashMap
28 {
29 /* //////////////////////////// PUBLIC //////////////////////////////////// */
30 public:
31 /* ============================ CREATORS ================================== */
33 
34 
36 
39 
40 /* ============================ MANIPULATORS ============================== */
42 
43  MpAlsa* getALSADeviceWrapper(const UtlString& ossdev);
45 
47  void excludeFromContainer(MpAlsa* pDev);
48 
50 
51 /* ============================ ACCESSORS ================================= */
53 
54 
56 
58  static
60 
62  static
63  void releaseContainer(MpAlsaContainer* pCont);
64 
66  static
67  UtlBoolean excludeWrapperFromContainer(MpAlsa* pDev);
68 
69 /* ============================ INQUIRY =================================== */
71 
72 
74 
75 /* //////////////////////////// PROTECTED ///////////////////////////////// */
76 protected:
78  static int refCount;
79 
80 /* //////////////////////////// PRIVATE /////////////////////////////////// */
81 private:
82  OsMutex mMutex;
83 };
84 
85 /* ============================ INLINE METHODS ============================ */
86 
87 #endif // _MpALSADeviceWrapperContainer_h_
void excludeFromContainer(MpAlsa *pDev)
Excluding wrapper from container.
Definition: MpAlsaContainer.cpp:67
Wrapper for ALSA device that use file descriptor to communicate.
Definition: MpAlsa.h:32
static void releaseContainer(MpAlsaContainer *pCont)
Releasing wrapper if it no longer needed (no references).
Definition: MpAlsaContainer.cpp:149
MpAlsa * getALSADeviceWrapper(const UtlString &ossdev)
Create new wrapper for name haven't founded in container.
Definition: MpAlsaContainer.cpp:100
static int refCount
Number of all MpALSADeviceWrapperContainer members.
Definition: MpAlsaContainer.h:78
OsMutex mMutex
Internal synchronization mutex.
Definition: MpAlsaContainer.h:82
static MpAlsaContainer * mpCont
Pointer to allocated class.
Definition: MpAlsaContainer.h:77
~MpAlsaContainer()
Definition: MpAlsaContainer.cpp:41
MpAlsaContainer()
Definition: MpAlsaContainer.cpp:35
Definition: MpAlsaContainer.h:27
static UtlBoolean excludeWrapperFromContainer(MpAlsa *pDev)
Excluding wrapper from container (static version).
Definition: MpAlsaContainer.cpp:119
static MpAlsaContainer * getContainer()
Creating wrapper and return if it wasn't create yet.
Definition: MpAlsaContainer.cpp:137