rlstate.h
Upload User: zhongxx05
Upload Date: 2007-06-06
Package Size: 33641k
Code Size: 3k
Category:

Symbian

Development Platform:

C/C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef __RLSTATA_H__
  36. #define __RLSTATE_H__
  37. class CASMRuleState
  38. {
  39. private:
  40.     UINT16  m_nNumRules;
  41.     BOOL*   m_bNeedSwitchOff;
  42.     BOOL*   m_bSubscribePending;
  43.     BOOL*   m_bSubscribed;
  44.     BOOL*   m_bUnsubscribePending;
  45.     UINT8*  m_lastASMFlagsForThisRule;
  46.     UINT16** m_OffDepends;
  47.     UINT16** m_OnDepends;
  48.     void ParseRuleBookForDirectives(UINT16 num_rules,
  49.     char* pRuleBook,
  50.     UINT16 usBookSize,
  51.     BOOL* pNeedSwitchOff,
  52.     UINT16** pOffDepends,
  53.     UINT16** pOnDepends);
  54.     char* ParseDependsList(char* pDependsText, UINT16* pDependsList);
  55. public:
  56.     CASMRuleState(UINT16 nNumRules, char* pRuleBook, UINT16 usBookSize);
  57.     ~CASMRuleState();
  58.     void StartSubscribePending(UINT16 usRuleNum);
  59.     BOOL CanSubscribeNow(UINT16 usRuleNum);
  60.     void CompleteSubscribe(UINT16 usRuleNum);
  61.     void StartUnsubscribePending(UINT16 usRuleNum);
  62.     BOOL CanUnsubscribeNow(UINT16 usRuleNum);
  63.     void CompleteUnsubscribe(UINT16 usRuleNum);
  64.     BOOL CanSwitchStreamsNow();
  65.     void CompleteStreamSwitch();
  66.     void CancelStreamSwitch();
  67.     void CompleteAllUnsubscribes();
  68.     BOOL AnyPendingUnsubscribes();
  69.     UINT16 GetNextPendingUnsubscribe();
  70.     BOOL IsRuleSubscribed(UINT16 usRuleNum) 
  71. {return m_bSubscribed[usRuleNum];}
  72.     BOOL IsUnsubscribePending(UINT16 usRuleNum)
  73. {return m_bUnsubscribePending[usRuleNum];}
  74.     BOOL IsSubscribePending(UINT16 usRuleNum)
  75. {return m_bSubscribePending[usRuleNum];}
  76.     void SetASMFlags(UINT16 usRuleNum, UINT8 asmFlags)
  77. {m_lastASMFlagsForThisRule[usRuleNum] = asmFlags;}
  78.     UINT8 GetASMFlags(UINT16 usRuleNum)
  79. {return m_lastASMFlagsForThisRule[usRuleNum];}
  80.     BOOL WaitForSwitchOff(UINT16 usRuleNum)
  81. {return m_bNeedSwitchOff[usRuleNum];}
  82. };
  83. #endif /* __RLSTATE_H__ */