| 1 |
#include <string> |
| 2 |
|
| 3 |
class payload { |
| 4 |
public: |
| 5 |
payload(double d = 0.); |
| 6 |
payload(const payload& p); |
| 7 |
payload& operator=(const payload& e); |
| 8 |
~payload(); |
| 9 |
|
| 10 |
double getData(); |
| 11 |
void setData(double d); |
| 12 |
|
| 13 |
public: |
| 14 |
static int count; |
| 15 |
|
| 16 |
private: |
| 17 |
double m_data; |
| 18 |
}; |
| 19 |
|
| 20 |
|
| 21 |
class example01 { |
| 22 |
public: |
| 23 |
example01(); |
| 24 |
example01(int a); |
| 25 |
example01(const example01& e); |
| 26 |
example01& operator=(const example01& e); |
| 27 |
virtual ~example01(); |
| 28 |
|
| 29 |
public: |
| 30 |
static int staticAddOneToInt(int a); |
| 31 |
static int staticAddOneToInt(int a, int b); |
| 32 |
static double staticAddToDouble(double a); |
| 33 |
static int staticAtoi(const char* str); |
| 34 |
static char* staticStrcpy(const char* strin); |
| 35 |
static void staticSetPayload(payload* p, double d); |
| 36 |
static payload* staticCyclePayload(payload* p, double d); |
| 37 |
static payload staticCopyCyclePayload(payload* p, double d); |
| 38 |
static int getCount(); |
| 39 |
static void setCount(int); |
| 40 |
|
| 41 |
public: |
| 42 |
int addDataToInt(int a); |
| 43 |
int addDataToIntConstRef(const int& a); |
| 44 |
int overloadedAddDataToInt(int a, int b); |
| 45 |
int overloadedAddDataToInt(int a); |
| 46 |
int overloadedAddDataToInt(int a, int b, int c); |
| 47 |
double addDataToDouble(double a); |
| 48 |
int addDataToAtoi(const char* str); |
| 49 |
char* addToStringValue(const char* str); |
| 50 |
|
| 51 |
void setPayload(payload* p); |
| 52 |
payload* cyclePayload(payload* p); |
| 53 |
payload copyCyclePayload(payload* p); |
| 54 |
|
| 55 |
public: |
| 56 |
static int count; |
| 57 |
|
| 58 |
public: |
| 59 |
int m_somedata; |
| 60 |
}; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
int globalAddOneToInt(int a); |
| 65 |
namespace ns_example01 { |
| 66 |
int globalAddOneToInt(int a); |
| 67 |
extern int gMyGlobalInt; |
| 68 |
} |
| 69 |
|
| 70 |
int installableAddOneToInt(example01&, int a); |
| 71 |
|
| 72 |
#define itypeValue(itype, tname) \ |
| 73 |
itype tname##Value(itype arg0, int argn=0, itype arg1=1, itype arg2=2) |
| 74 |
|
| 75 |
#define ftypeValue(ftype) \ |
| 76 |
ftype ftype##Value(ftype arg0, int argn=0, ftype arg1=1., ftype arg2=2.) |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
class ArgPasser { |
| 81 |
public: |
| 82 |
itypeValue(short, short); |
| 83 |
itypeValue(unsigned short, ushort); |
| 84 |
itypeValue(int, int); |
| 85 |
itypeValue(unsigned int, uint); |
| 86 |
itypeValue(long, long); |
| 87 |
itypeValue(unsigned long, ulong); |
| 88 |
|
| 89 |
ftypeValue(float); |
| 90 |
ftypeValue(double); |
| 91 |
|
| 92 |
std::string stringValue( |
| 93 |
std::string arg0, int argn=0, std::string arg1 = "default"); |
| 94 |
|
| 95 |
std::string stringRef( |
| 96 |
const std::string& arg0, int argn=0, const std::string& arg1="default"); |
| 97 |
}; |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
typedef example01 example01_t; |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
class z_ { |
| 106 |
public: |
| 107 |
z_& gime_z_(z_& z); |
| 108 |
int myint; |
| 109 |
}; |
| 110 |
|
| 111 |
|
| 112 |
class example01a : public example01 { |
| 113 |
public: |
| 114 |
example01a(int a) : example01(a) {} |
| 115 |
}; |