123456789101112131415161718192021222324252627 |
- #pragma once
- #include "myString.h"
- class MyString;
- class Counter
- {
- Counter* pNext;
- char* m_pStr;
- size_t m_owners;
- static Counter* Head;//ýòî òîëüêî îïðåäåëåíèå íóæíî åùå îáúÿâëåíèå
- static size_t m_curCounters;
- Counter(const char* );//êîíñòðóêòîð(êîíñòðóêòîðû)
- // Counter(MyString&);
- // Counter(char*);
- //???
- static Counter* CreateCounter(const char*); //
- void AddOwner();//äîáàâèòü ïîëüçîâàòåëÿ
- void RemoveOwner(); // óáðàòü ïîëüçîâàòåëÿ(åñëè ïîëüçîâàòåëü ïîñëåäíèé, òî ñòðîêà áîëüøå íå íóæíà
- ~Counter(); //äåñòðóêòîð
- void Swap(Counter*); //ïîìåíÿòü ïîñëåäîâàòåëüíîñòü
- friend class MyString;
- friend std::ostream& operator<<(std::ostream& os, const MyString& str);
- };
|