-
Notifications
You must be signed in to change notification settings - Fork 0
/
Derive1.h
43 lines (38 loc) · 952 Bytes
/
Derive1.h
1
2
3
4
5
6
7
8
9
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
#ifndef __DERIVE1_H___
#define __DERIVE1_H___
#include "Derive2.h"
#include <iostream>
class Base1 {
private:
public:
Base1(){};
virtual ~Base1(){};
virtual void request(Base2 *p) {
std::cout << "Base1::"
<< "this is request" << std::endl;
p->response();
}
virtual void method(char *str){};
};
class Derive1 : public Base1 {
private:
void l2_method(char *str) { std::cout << __func__ << "\n"; };
public:
Derive1(){};
virtual ~Derive1(){};
void request(Base2 *p) {
std::cout << "Derive1::"
<< "this is request" << std::endl;
p->response();
}
void method(char *str) {
int a = 1;
// unsigned long ad = (unsigned long)__builtin_frame_address(0);
// std::cout << "method::" << ad << std::endl;
std::cout << "method"
<< "::" << str << std::endl;
std::cout << a << std::endl;
l2_method(str);
};
};
#endif /* end of include guard: __DERIVE1_H___ */