sipxmedialib  Version 3.3
MpOssContainer.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>
12 
13 #ifndef _MpOSSDeviceWrapperContainer_h_
14 #define _MpOSSDeviceWrapperContainer_h_
15 
16 
17 // SYSTEM INCLUDES
18 // APPLICATION INCLUDES
19 #include "utl/UtlString.h"
20 #include "utl/UtlHashMap.h"
21 #include "os/OsMutex.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 // FORWARD DECLARATIONS
31 class MpOss;
32 
33 class MpOssContainer : protected UtlHashMap
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 /* ============================ CREATORS ================================== */
39 
40 
42 
45 
46 /* ============================ MANIPULATORS ============================== */
48 
49  MpOss* getOSSDeviceWrapper(const UtlString& ossdev);
51 
53  void excludeFromContainer(MpOss* pDev);
54 
56 
57 /* ============================ ACCESSORS ================================= */
59 
60 
62 
64  static
66 
68  static
69  void releaseContainer(MpOssContainer* pCont);
70 
72  static
73  UtlBoolean excludeWrapperFromContainer(MpOss* pDev);
74 
75 /* ============================ INQUIRY =================================== */
77 
78 
80 
81 /* //////////////////////////// PROTECTED ///////////////////////////////// */
82 protected:
84  static int refCount;
85 
86 /* //////////////////////////// PRIVATE /////////////////////////////////// */
87 private:
88  OsMutex mMutex;
89 };
90 
91 /* ============================ INLINE METHODS ============================ */
92 
93 #endif // _MpOSSDeviceWrapperContainer_h_
MpOss * getOSSDeviceWrapper(const UtlString &ossdev)
Create new wrapper for name haven&#39;t founded in container.
Definition: MpOssContainer.cpp:96
static int refCount
Number of all MpOSSDeviceWrapperContainer members.
Definition: MpOssContainer.h:84
OsMutex mMutex
Internal synchronization mutex.
Definition: MpOssContainer.h:88
~MpOssContainer()
Definition: MpOssContainer.cpp:46
MpOssContainer()
Definition: MpOssContainer.cpp:40
void excludeFromContainer(MpOss *pDev)
Excluding wrapper from container.
Definition: MpOssContainer.cpp:69
static void releaseContainer(MpOssContainer *pCont)
Releasing wrapper if it no longer needed (no references).
Definition: MpOssContainer.cpp:142
static UtlBoolean excludeWrapperFromContainer(MpOss *pDev)
Excluding wrapper from container (static version).
Definition: MpOssContainer.cpp:115
static MpOssContainer * getContainer()
Creating wrapper and return if it wasn&#39;t create yet.
Definition: MpOssContainer.cpp:130
Definition: MpOssContainer.h:33
Wrapper for OSS device that use file descriptor to communicate.
Definition: MpOss.h:35
static MpOssContainer * mpCont
Pointer to allocated class.
Definition: MpOssContainer.h:83