Runnable.h:
1 #ifndef RUNNABL_H_
2 #define RUNNABL_H_
3
4 class Runnable
5 {
6
7
8 public:
9
10 virtual void* run (void * v) = 0;
11
12
13 };
14 #endif
Runnable.cpp
1 #include "Runnable.h"
TaskRunnable.h:
1 #ifndef TASK_RUNNABLE_h
2 #define TASK_RUNNABLE_h
3 #include "Runnable.h"
4
5 class TaskRunnable: public Runnable
6 {
7
8 public:
9
10 virtual void* run(void *v);
11
12
13 };
14 #endif
TaskRunnable.cpp:
1 #include<iostream>
2 #include "TaskRunnable.h"
3 using namespace std;
4
5 void * TaskRunnable::run (void * v){
6
7
8 cout<<" exe a run! "<<endl;
9
10
11 }
~
1 #ifndef RUNNABL_H_
2 #define RUNNABL_H_
3
4 class Runnable
5 {
6
7
8 public:
9
10 virtual void* run (void * v) = 0;
11
12
13 };
14 #endif
Runnable.cpp
1 #include "Runnable.h"
TaskRunnable.h:
1 #ifndef TASK_RUNNABLE_h
2 #define TASK_RUNNABLE_h
3 #include "Runnable.h"
4
5 class TaskRunnable: public Runnable
6 {
7
8 public:
9
10 virtual void* run(void *v);
11
12
13 };
14 #endif
TaskRunnable.cpp:
1 #include<iostream>
2 #include "TaskRunnable.h"
3 using namespace std;
4
5 void * TaskRunnable::run (void * v){
6
7
8 cout<<" exe a run! "<<endl;
9
10
11 }
~