Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. //DynamicCollection.h
  2. #ifndef DynamicCollection_h
  3. #define DynamicCollection_h
  4. #include "Arduino.h"
  5.  
  6. template <class T>
  7. class DynamicCollection
  8. {
  9. public:
  10.     ~DynamicCollection();
  11.     DynamicCollection();
  12.     DynamicCollection(int length);
  13.     DynamicCollection(int length, T _default);
  14.  
  15.     typedef unsigned int uint;
  16.  
  17.     void Add(T object);
  18.  
  19.     void Remove(T object);
  20.  
  21.     void RemoveAt(uint index);
  22.  
  23.     int Length();
  24.  
  25.     T &operator[] (uint index);
  26.     const T &operator[] (uint index) const;
  27.  
  28. private:
  29.     static T* resize(T *pArray, uint OldSize, uint NewSize);
  30.  
  31.     T* _pInnerCollection;
  32.     int _InnerCollLength;
  33. };
  34.  
  35. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement