Добавил:
bagiwow
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Программирование / си++ / 2Semestr / Lab_3 / Class
.h#ifndef CLASS
#define CLASS
//-------------------------------------------------------------------------------
void Rus(char *);
//-------------------------------------------------------------------------------
class tObject
{
public:
virtual void Show()=0;
};
//-------------------------------------------------------------------------------
class Org: public tObject
{
private:
protected:
char name[20];
public:
int kol_sotr;
static void Print();
Org ();
Org (char* ,int);
Org (const Org&);
~Org();
virtual void Show ()=0;
};
//-------------------------------------------------------------------------------
class StrCom: public Org
{
private:
int kol_zastr;
protected:
public:
StrCom();
StrCom(char*,int,int);
StrCom(const StrCom&);
~StrCom();
void Show();
};
//-------------------------------------------------------------------------------
class Zavod: public Org
{
private:
int kol_stan;
protected:
public:
Zavod ();
Zavod(char*,int,int);
Zavod(const Zavod&);
~Zavod();
void Show();
};
//-------------------------------------------------------------------------------
class SudCom: public Org
{
private:
int kol_kor;
protected:
public:
SudCom();
SudCom(char*, int, int);
SudCom(const SudCom&);
~SudCom();
void Show();
};
//-------------------------------------------------------------------------------
struct tItem
{
tObject* obj;
tItem* next;
};
//-------------------------------------------------------------------------------
typedef bool(*PF)(tObject*,int);
//-------------------------------------------------------------------------------
class List:public tObject
{
protected:
char name[30];
tItem* item;
public:
List();
List(char*);
~List();
void Insert(tObject*);
virtual void Show()=0;
};
//-------------------------------------------------------------------------------
class AllOrgList:public List
{
public:
AllOrgList();
AllOrgList(char*);
~AllOrgList();
void Show();
};
//-------------------------------------------------------------------------------
class OrgList:public List
{
public:
OrgList();
OrgList(char*);
~OrgList();
void Show();
void ForEach (PF action,int KolSotr);
};
//-------------------------------------------------------------------------------
#endif