multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesrvstreamiterator.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef TMCESRVSTREAMITERATOR_H
       
    22 #define TMCESRVSTREAMITERATOR_H
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 #include "mcesrvstream.h"
       
    27 #include "mcesrv.h"
       
    28 class CMceComMediaStream;
       
    29 class CMceComEndpoint;
       
    30 
       
    31 const TBool KMceComUseProxyMatch = ETrue;
       
    32 const TBool KMceComNoProxyMatch = EFalse;
       
    33 
       
    34 /**
       
    35  * 
       
    36  *
       
    37  * @lib 
       
    38  */
       
    39 class TMceSrvStreamIterator
       
    40     {
       
    41 
       
    42 
       
    43 public: // enums
       
    44 
       
    45     enum TDirection
       
    46         {
       
    47         EZero,
       
    48         EAny,
       
    49         ESendOrReceive,
       
    50         ESend,
       
    51         EReceive,
       
    52         ESendOrLocal,
       
    53         EReceiveOrLocal,
       
    54         ELocal
       
    55         };
       
    56     
       
    57 
       
    58     enum TStreamStateMatchType
       
    59         {
       
    60         ExactMatch,
       
    61         ExactReverseMatch,
       
    62         GreaterOrEqualMatch,
       
    63         GreaterOrEqualReverseMatch      
       
    64         };
       
    65         
       
    66 public: // Constructors & Destructor
       
    67 
       
    68 
       
    69     /**
       
    70      * C++ default constructor.
       
    71      */
       
    72     TMceSrvStreamIterator( const RPointerArray<CMceSrvStream>& aStreams );
       
    73 
       
    74     /**
       
    75      * C++ default constructor.
       
    76      */
       
    77     TMceSrvStreamIterator( const RPointerArray<CMceSrvStream>& aStreams,
       
    78                            TDirection aDirection );
       
    79 
       
    80     /**
       
    81      * C++ default constructor.
       
    82      */
       
    83     TMceSrvStreamIterator( const RPointerArray<CMceSrvStream>& aStreams,
       
    84                            const CMceComMediaStream& aStream );
       
    85 
       
    86     /**
       
    87      * C++ default constructor.
       
    88      */
       
    89     TMceSrvStreamIterator( const RPointerArray<CMceSrvStream>& aStreams,
       
    90                            const CMceComEndpoint& aEndpoint,
       
    91                            TBool aUseProxyMatch = KMceComNoProxyMatch,
       
    92                            TDirection aDirection = EZero,
       
    93                            const CMceComCodec* aCodec = NULL );
       
    94 
       
    95     /**
       
    96      * C++ default constructor.
       
    97      */
       
    98     TMceSrvStreamIterator( const RPointerArray<CMceSrvStream>& aStreams,
       
    99                            const CMceComCodec& aCodec );
       
   100 
       
   101 
       
   102     
       
   103     
       
   104 public: // new functions
       
   105 
       
   106     //next based on filter
       
   107     TBool Next( CMceSrvStream*& aCandidate,
       
   108                 TStreamStateMatchType aMatchType = ExactMatch );
       
   109 
       
   110     //next based on filter and matches recipient
       
   111     TBool Next( CMceSrvStream*& aCandidate,
       
   112                 TMceMccComEvent& aRecipient,
       
   113                 TStreamStateMatchType aMatchType = ExactMatch );
       
   114 
       
   115     //next based on filter and matches clone
       
   116     TBool Next( CMceSrvStream*& aCandidate,
       
   117                 CMceSrvStream& aClone,
       
   118                 TStreamStateMatchType aMatchType = ExactMatch );
       
   119 
       
   120     
       
   121 
       
   122     //iterates intersection of this and aSet
       
   123     //return value is intersected stream from this set 
       
   124     //and aIntersectCandidate is intersected stream from aSet
       
   125     TBool NextIntersect( CMceSrvStream*& aCandidate,
       
   126                           TMceSrvStreamIterator& aSet,
       
   127                           CMceSrvStream*& aIntersectCandidate );
       
   128 
       
   129     //iterates intersection of this and aSet
       
   130     TBool NextComplement( CMceSrvStream*& aCandidate,
       
   131                            TMceSrvStreamIterator& aSet );
       
   132                                   
       
   133 
       
   134 
       
   135     //next based on filter and aState, if aNegation is ETrue, which all
       
   136     //streams which are NOT in state aState
       
   137      TBool Next( CMceSrvStream*& aCandidate,
       
   138                 CMceSrvStream::TState aState, 
       
   139                 TStreamStateMatchType aMatchType = ExactMatch );
       
   140     
       
   141     void Reset();
       
   142     TInt Current();
       
   143     TBool IsEof();
       
   144     TInt Remove( RPointerArray<CMceSrvStream>& aStreams );    
       
   145     TDirection Direction();
       
   146     
       
   147     TBool DoDirectionMatch( CMceSrvStream& aSrvStream );
       
   148 
       
   149 private: // NOT owned data
       
   150 
       
   151 
       
   152     const RPointerArray<CMceSrvStream>& iStreams;
       
   153     TDirection iDirection;
       
   154     const CMceComMediaStream* iStream;
       
   155     const CMceComEndpoint* iEndpoint;
       
   156     const CMceComCodec* iCodec;
       
   157 
       
   158     TInt iCurrentIndex;
       
   159     
       
   160     TBool iUseProxyMatch;
       
   161     
       
   162 	//definitions for unit testing
       
   163 	MCEMM_UT_DEFINITIONS
       
   164     
       
   165     };
       
   166 
       
   167 
       
   168 
       
   169 #endif //TMCESRVSTREAMITERATOR_H