Counter.h 733 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "myString.h"
  3. class MyString;
  4. class Counter
  5. {
  6. Counter* pNext;
  7. char* m_pStr;
  8. size_t m_owners;
  9. static Counter* Head;//ýòî òîëüêî îïðåäåëåíèå íóæíî åùå îáúÿâëåíèå
  10. static size_t m_curCounters;
  11. Counter(const char* );//êîíñòðóêòîð(êîíñòðóêòîðû)
  12. // Counter(MyString&);
  13. // Counter(char*);
  14. //???
  15. static Counter* CreateCounter(const char*); //
  16. void AddOwner();//äîáàâèòü ïîëüçîâàòåëÿ
  17. void RemoveOwner(); // óáðàòü ïîëüçîâàòåëÿ(åñëè ïîëüçîâàòåëü ïîñëåäíèé, òî ñòðîêà áîëüøå íå íóæíà
  18. ~Counter(); //äåñòðóêòîð
  19. void Swap(Counter*); //ïîìåíÿòü ïîñëåäîâàòåëüíîñòü
  20. friend class MyString;
  21. friend std::ostream& operator<<(std::ostream& os, const MyString& str);
  22. };