sipxmedialib  Version 3.3
MpResourceSortAlg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 
15 #ifndef _MpResourceSortAlg_h_
16 #define _MpResourceSortAlg_h_
17 
18 // SYSTEM INCLUDES
19 
20 // APPLICATION INCLUDES
21 #include "os/OsStatus.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 
31 // FORWARD DECLARATIONS
32 class MpResource;
33 
34 //:Algorithm for performing a topological sort on the MpResource objects in
35 //:a flow graph.
37 {
38 /* //////////////////////////// PUBLIC //////////////////////////////////// */
39 public:
40 
41 /* ============================ CREATORS ================================== */
43 
45  //:Constructor
46 
47  virtual
49  //:Destructor
50 
52 
53 /* ============================ MANIPULATORS ============================== */
55 
56  OsStatus doSort(MpResource* unsorted[],
57  MpResource* sorted[], int numResources);
58  //:Use a topological sort to order the resource pointers passed in via
59  //:the "unsorted" array. The sorted pointers are returned via the
60  //:"sorted" array.
66 
68 
69 /* ============================ ACCESSORS ================================= */
71 
72 
74 
75 /* ============================ INQUIRY =================================== */
77 
78 
80 
81 /* //////////////////////////// PROTECTED ///////////////////////////////// */
82 protected:
83 
84 /* //////////////////////////// PRIVATE /////////////////////////////////// */
85 private:
89 
90  OsStatus visitResource(MpResource* pResource);
91  //:Visits the indicated flow graph resource.
92  // Returns OS_SUCCESS if the visit was successful, OS_LOOP_DETECTED if
93  // we looped back to a resource that we are already visiting.
94 
95  MpResourceSortAlg(const MpResourceSortAlg& rMpResourceSortAlg);
96  //:Copy constructor (not implemented for this class)
97 
99  //:Assignment operator (not implemented for this class)
100 
101 };
102 
103 /* ============================ INLINE METHODS ============================ */
104 
105 #endif // _MpResourceSortAlg_h_
int mNextSortedIndex
Definition: MpResourceSortAlg.h:88
MpResource ** mUnsorted
Definition: MpResourceSortAlg.h:86
OsStatus visitResource(MpResource *pResource)
Definition: MpResourceSortAlg.cpp:95
OsStatus doSort(MpResource *unsorted[], MpResource *sorted[], int numResources)
Definition: MpResourceSortAlg.cpp:46
Definition: MpResourceSortAlg.h:36
virtual ~MpResourceSortAlg()
Definition: MpResourceSortAlg.cpp:34
MpResourceSortAlg & operator=(const MpResourceSortAlg &rhs)
MpResourceSortAlg()
Definition: MpResourceSortAlg.cpp:29
MpResource ** mSorted
Definition: MpResourceSortAlg.h:87
Abstract base class for all media processing objects.
Definition: MpResource.h:56