source: 3DVCSoftware/trunk/source/Lib/TLibCommon/TComList.h @ 2

Last change on this file since 2 was 2, checked in by hhi, 13 years ago

inital import

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1
2
3/** \file     TComList.h
4    \brief    general list class (header)
5*/
6
7#ifndef _TCOMLIST_
8#define _TCOMLIST_
9
10#if _MSC_VER > 1000
11#pragma once
12#endif // _MSC_VER > 1000
13
14#include <list>
15#include <assert.h>
16#include "CommonDef.h"
17
18#include <cstdlib>
19using namespace std;
20
21// ====================================================================================================================
22// Class definition
23// ====================================================================================================================
24
25/// list template
26template< class C >
27class TComList : public std::list< C >
28{
29public:
30  typedef typename std::list<C>::iterator TComIterator;
31 
32  TComList& operator += ( const TComList& rcTComList)
33  {
34    if( ! rcTComList.empty() )
35    {
36      insert( this->end(), rcTComList.begin(), rcTComList.end());
37    }
38    return *this;
39  } // leszek
40 
41  C popBack()
42  {
43    C cT = this->back();
44    this->pop_back();
45    return cT;
46  }
47 
48  C popFront()
49  {
50    C cT = this->front();
51    this->pop_front();
52    return cT;
53  }
54 
55  Void pushBack( const C& rcT )
56  {
57    /*assert( sizeof(C) == 4);*/
58    if( rcT != NULL )
59    {
60      this->push_back( rcT);
61    }
62  }
63 
64  Void pushFront( const C& rcT )
65  {
66    /*assert( sizeof(C) == 4);*/
67    if( rcT != NULL )
68    {
69      this->push_front( rcT);
70    }
71  }
72 
73  TComIterator find( const C& rcT ) // leszek
74  {
75    return find( this->begin(), this->end(), rcT );
76  }
77};
78
79#endif
80
Note: See TracBrowser for help on using the repository browser.