Advertisement
Tyler_Elric

SmartArray.h

Dec 21st, 2011
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #pragma once
  2. #include "Iterable.h"
  3. #include "SmartObject.h"
  4.  
  5. class SmartArray:public Iterable,public SmartObject
  6. {
  7. protected:
  8.     void Allocate(unsigned int) throw(Iterable::UnneededAllocation);
  9. public:
  10.     class Callback
  11.     {
  12.         public:
  13.             virtual void operator ()(SmartObject::Reference&,unsigned int) const = 0;
  14.     };
  15.     SmartArray(void);
  16.     SmartArray( const SmartArray& );
  17.     ~SmartArray(void);
  18.     SmartArray& ForEach( const Callback& );
  19.     SmartArray& Append( SmartObject* );
  20.     SmartArray& Append( SmartObject::Reference& );
  21.     SmartArray& Insert( SmartObject*, int );
  22.     SmartArray& Prepend( SmartObject* );
  23.     const SmartArray operator [] ( const Slice& );
  24. private:
  25.     SmartObject::Reference* mItems;
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement