- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
//Файл teamWorkFile.h:
static int teamWork(int e)
{
#if N==0
return 0;
#elif N==1
return Work52(e+1);
#elif
return WorkN(N);
#endif
};
//Файл teamWork.h:
//...
#define MaxProc 6
typedef int (*ProcTypeTeamWork)(int e);
ProcTypeTeamWork Proc[MaxProc];
#define N 0
#define teamWork ProcName0
#include "teamWorkFile.h"
#undef teamWork
#undef N
#define N 1
#define teamWork ProcName1
#include "teamWorkFile.h"
#undef teamWork
#undef N
int InitMultiProc()
{
Proc[0]=ProcName0;
Proc[1]=ProcName1;
Proc[2]=ProcName1;
Proc[4]=ProcName0;
Proc[5]=ProcName1;
return 0;
};
//Файл teamWorkLib.cpp:
#include "teamWork.h"
//...
InitMultiProc();
ProcTypeTeamWork SuperProc=Proc[5];
//Дальше в этом файле вызовы в стиле Proc[i](e);, SuperProc(255); и тд...
Follow us!