sipxmedialib  Version 3.3
MprNullConstructor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2007 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2006-2007 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 // Author: Dan Petrie <dpetrie AT SIPez DOT com>
12 
13 #ifndef _MprNullConstructor_h_
14 #define _MprNullConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprNull.h>
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
35 {
36 /* //////////////////////////// PUBLIC //////////////////////////////////// */
37 public:
38 
39 /* ============================ CREATORS ================================== */
40 
43  MprNullConstructor(int maxInOutputs = 5)
45  0, maxInOutputs, //minInputs, maxInputs,
46  0, maxInOutputs) //minOutputs, maxOutputs
47  {
48  };
49 
52  virtual ~MprNullConstructor(){};
53 
54 /* ============================ MANIPULATORS ============================== */
55 
57  virtual OsStatus newResource(const UtlString& resourceName,
58  int maxResourcesToCreate,
59  int& numResourcesCreated,
60  MpResource* resourceArray[])
61  {
62  assert(maxResourcesToCreate >= 1);
63  numResourcesCreated = 1;
64  resourceArray[0] = new MprNull(resourceName,
65  mMaxInputs);
66  resourceArray[0]->disable();
67  return(OS_SUCCESS);
68  }
69 
70 /* ============================ ACCESSORS ================================= */
71 
72 /* ============================ INQUIRY =================================== */
73 
74 /* //////////////////////////// PROTECTED ///////////////////////////////// */
75 protected:
76 
77 /* //////////////////////////// PRIVATE /////////////////////////////////// */
78 private:
79 
82  MprNullConstructor(const MprNullConstructor& rMprNullConstructor);
83 
84 
88 
89 };
90 
91 /* ============================ INLINE METHODS ============================ */
92 
93 #endif // _MprNullConstructor_h_
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprNullConstructor.h:57
#define DEFAULT_NULL_RESOURCE_TYPE
Definition: MpResourceFactory.h:27
virtual UtlBoolean disable()
Disable this resource.
Definition: MpResource.cpp:121
MprNullConstructor & operator=(const MprNullConstructor &rhs)
virtual ~MprNullConstructor()
Definition: MprNullConstructor.h:52
int mMaxInputs
Definition: MpResourceConstructor.h:92
Abstract base class for all media processing objects.
Definition: MpResource.h:56
MpAudioResourceConstructor is used to construct a specific audio resource type.
Definition: MpAudioResourceConstructor.h:36
MprNullConstructor(int maxInOutputs=5)
Definition: MprNullConstructor.h:43
The "Null" media processing resource is ground or /dev/null equivalent.
Definition: MprNull.h:35
MprNullConstructor is used to construct a Null resource (e.g. /dev/null)
Definition: MprNullConstructor.h:34