Advertisement
imk0tter

Untitled

Aug 2nd, 2021
1,577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1.     template<typename VALUE>
  2.     class List {
  3.  
  4.  
  5.         int                         m_MaxChunkSize;
  6.         int                         m_CurrentChunkSize;
  7.  
  8.         int                         m_EntryCount;
  9.  
  10.         bool                        _CreateChunk();
  11.         VALUE**                     m_ChunkArray;
  12.     public:
  13.         static const int&           DEFAULT_CHUNK_COUNT;
  14.  
  15.                                     List(int DEFAULT_CHUNK_COUNT);
  16.                                     List();
  17.  
  18.                                     ~List();
  19.  
  20.                                     int                         Count();
  21.         void                        Add(const VALUE& value);
  22.  
  23.         bool                        Remove(int index);
  24.         bool                        Remove(const VALUE& value, bool all = false);
  25.  
  26.         bool                        Insert(const VALUE& value, int index);
  27.  
  28.         int                         Find(const VALUE& value, int startPos);
  29.         int                         Find(const VALUE& value);
  30.         VALUE &                     Get(int index);
  31.         //vector<VALUE*>                Get();
  32.  
  33.         void                        Clear();
  34.        
  35.  
  36.         VALUE&                      operator[] (int index);
  37.         int                         operator[] (const VALUE& value);
  38.  
  39.         VALUE&                      operator* () { return **m_ChunkArray; }
  40.         void                        operator++ () { ++m_ChunkArray; }
  41.  
  42.         VALUE**                     begin() { m_ChunkArray[0]; }
  43.         VALUE**                     end() { return m_ChunkArray[m_EntryCount]; }
  44.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement