• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18// Class OsclDoubleList
19template <class T>
20OSCL_INLINE OsclDoubleList<T>::OsclDoubleList()
21{}
22template <class T>
23OSCL_INLINE OsclDoubleList<T>::OsclDoubleList(int32 anOffset)
24        : OsclDoubleListBase(anOffset)
25{}
26template <class T>
27OSCL_INLINE void OsclDoubleList<T>::InsertHead(T &aRef)
28{
29    OsclDoubleListBase::InsertHead(&aRef);
30}
31template <class T>
32OSCL_INLINE void OsclDoubleList<T>::InsertTail(T &aRef)
33{
34    OsclDoubleListBase::InsertTail(&aRef);
35}
36template <class T>
37OSCL_INLINE bool OsclDoubleList<T>::IsHead(const T *aPtr) const
38{
39    return(OsclPtrAdd(aPtr, iOffset) == (T *)&iHead);
40}
41template <class T>
42OSCL_INLINE bool OsclDoubleList<T>::IsTail(const T *aPtr) const
43{
44    return(OsclPtrAdd(aPtr, iOffset) == (T *)iHead.iPrev);
45}
46template <class T>
47OSCL_INLINE T *OsclDoubleList<T>::Head() const
48{
49    OSCL_ASSERT(!IsEmpty());
50    return(OsclPtrSub((T *)iHead.iNext, iOffset));
51}
52template <class T>
53OSCL_INLINE T *OsclDoubleList<T>::Tail() const
54{
55    OSCL_ASSERT(!IsEmpty());
56    return(OsclPtrSub((T *)iHead.iPrev, iOffset));
57}
58
59// Class OsclPriorityList
60template <class T>
61OSCL_INLINE OsclPriorityList<T>::OsclPriorityList()
62{}
63template <class T>
64OSCL_INLINE OsclPriorityList<T>::OsclPriorityList(int32 anOffset)
65        : OsclDoubleListBase(anOffset)
66{}
67template <class T>
68OSCL_INLINE void OsclPriorityList<T>::Insert(T &aRef)
69{
70    OsclDoubleListBase::Insert(&aRef);
71}
72template <class T>
73OSCL_INLINE bool OsclPriorityList<T>::IsHead(const T *aPtr) const
74{
75    return(OsclPtrAdd(aPtr, iOffset) == (T *)&iHead);
76}
77template <class T>
78OSCL_INLINE bool OsclPriorityList<T>::IsTail(const T *aPtr) const
79{
80    return(OsclPtrAdd(aPtr, iOffset) == (T *)iHead.iPrev);
81}
82template <class T>
83OSCL_INLINE T *OsclPriorityList<T>::Head() const
84{
85    OSCL_ASSERT(!IsEmpty());
86    return(OsclPtrSub((T *)iHead.iNext, iOffset));
87}
88template <class T>
89OSCL_INLINE T *OsclPriorityList<T>::Tail() const
90{
91    OSCL_ASSERT(!IsEmpty());
92    return(PtrSub((T *)iHead.iPrev, iOffset));
93}
94
95
96
97
98
99
100