📄 rsmbmusicaplibmap.inl
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*--------------------------------------------------------------------*/
// FileName:
// RSmbMusicAPLibMap.inl
//
// Description:
// PTX810 Music傾僾儕 儈儏乕僕僢僋嫟捠儔僀僽儔儕
/*--------------------------------------------------------------------*/
//曄峏棜楌
//擔晅 |曄峏幰 |撪梕
//--------------+---------------+--------------------------------------
//2006/09/23 |SEMC崃绮 |僼傽僀儖僔僗僥儉嫟捠儔僀僽儔儕偐傜愗傝弌偟
/**
* $Revision: 1.3 $ $Date: 2006/05/13 09:47:40 $
*/
SEMCJ_NAMESPACE_BEGIN
MUSICAPLIB_NAMESPACE_BEGIN
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::RSmbMusicAPLibMap()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline RSmbMusicAPLibMap<K, T, C, DP>::RSmbMusicAPLibMap( const key_compare& aCmp/*=key_compare()*/ )
: iCmp( aCmp )
, iVec()
{
// nothing to do.
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::RSmbMusicAPLibMap()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline RSmbMusicAPLibMap<K, T, C, DP>::RSmbMusicAPLibMap( const RSmbMusicAPLibMap& aRhs )
: iCmp( aRhs.iCmp )
, iVec( aRhs.iVec )
{
// nothing to do.
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::RSmbMusicAPLibMap()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
template<typename InputIterator>
inline RSmbMusicAPLibMap<K, T, C, DP>::RSmbMusicAPLibMap( InputIterator aFirst, InputIterator aLast, const key_compare& aCmp/*=key_compare()*/ )
: iCmp( aCmp )
, iVec()
{
TRAPD( err, InsertL(aFirst, aLast) );
if (err)
{
// 僆僽僕僃僋僩抋惗枹枮側偺偱丄棙梡幰懁偱偺leave TRAP 偼晄壜擻丅儕乕僋懳嶔屻偵嵞throw丅
Release();
// :leavescan off:
User::Leave( err );
// :leavescan on:
}
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::~RSmbMusicAPLibMap()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline RSmbMusicAPLibMap<K, T, C, DP>::~RSmbMusicAPLibMap()
{
Release();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::operator=()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline RSmbMusicAPLibMap<K, T, C, DP>& RSmbMusicAPLibMap<K, T, C, DP>::operator=( const RSmbMusicAPLibMap& aRhs )
{
RSmbMusicAPLibMap( aRhs ).Swap( *this );
return *this;
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Begin()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::iterator RSmbMusicAPLibMap<K, T, C, DP>::Begin()
{
return iVec.Begin();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Begin()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::const_iterator RSmbMusicAPLibMap<K, T, C, DP>::Begin() const
{
return iVec.Begin();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::End()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::iterator RSmbMusicAPLibMap<K, T, C, DP>::End()
{
return iVec.End();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::End()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::const_iterator RSmbMusicAPLibMap<K, T, C, DP>::End() const
{
return iVec.End();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::RBegin()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::reverse_iterator RSmbMusicAPLibMap<K, T, C, DP>::RBegin()
{
return iVec.RBegin();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::RBegin()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::const_reverse_iterator RSmbMusicAPLibMap<K, T, C, DP>::RBegin() const
{
return iVec.RBegin();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::REnd()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::reverse_iterator RSmbMusicAPLibMap<K, T, C, DP>::REnd()
{
return iVec.REnd();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::REnd()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::const_reverse_iterator RSmbMusicAPLibMap<K, T, C, DP>::REnd() const
{
return iVec.REnd();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Empty()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline TBool RSmbMusicAPLibMap<K, T, C, DP>::Empty() const
{
return iVec.Empty();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Size()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::size_type RSmbMusicAPLibMap<K, T, C, DP>::Size() const
{
return iVec.Size();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Max_size()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::size_type RSmbMusicAPLibMap<K, T, C, DP>::Max_size() const
{
return iVec.Max_size();
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::operator[]()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::mapped_type& RSmbMusicAPLibMap<K, T, C, DP>::operator[]( const key_type& aKey )
{
// :leavescan off:
return InsertL( value_type(aKey, mapped_type()) ).iFirst->iSecond;
// :leavescan on:
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::InsertL()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline TSmbMusicAPLibPair<typename RSmbMusicAPLibMap<K, T, C, DP>::iterator, TBool> RSmbMusicAPLibMap<K, T, C, DP>::InsertL( const value_type& aVal )
{
iterator i = this->Lower_bound( aVal.iFirst );
if (i == End() || iCmp( aVal.iFirst, i->iFirst ))
{
i = iVec.InsertL( i, aVal );
return Make_pair( i, ETrue );
}
else
return Make_pair( i, EFalse );
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::InsertL()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
inline typename RSmbMusicAPLibMap<K, T, C, DP>::iterator RSmbMusicAPLibMap<K, T, C, DP>::InsertL( iterator aPos, const value_type& aVal )
{
if (aPos != End() &&
iCmp( aPos->iFirst, aVal.iFirst ) &&
(aPos == End() - 1 || !iCmp( aVal.iFirst, aPos[1]->iFirst ) && iCmp(aPos[1]->iFirst, aVal.iFirst)))
return iVec.InsertL( aPos, aVal );
return InsertL( aVal ).iFirst;
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::InsertL()
// ----------------------------------------------------------------------------
template<typename K, typename T, class C, class DP>
template<typename InputIterator>
inline void RSmbMusicAPLibMap<K, T, C, DP>::InsertL( InputIterator aFirst, InputIterator aLast )
{
for (; aFirst != aLast; ++aFirst)
InsertL( *aFirst );
}
// ----------------------------------------------------------------------------
// RSmbMusicAPLibMap::Erase()
// ----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -