- genericthunk_source_sample_executable.zip
- GenericThunk_source_sample
- include
- sample
- Thunk
- CdeclToCdecl
- CdeclToCdecl.vcproj
- CdeclToCdecl.vcproj.OWNCOMPUTER.OwnWaterloo.user
- CdeclToStd
- CdeclToStd.vcproj
- CdeclToStd.vcproj.OWNCOMPUTER.OwnWaterloo.user
- release
- CdeclToCdecl.exe
- StdToCdecl.exe
- StdToStd.exe
- ThisToCdecl.exe
- ThisToStd.exe
- StdToCdecl
- StdToCdecl.vcproj
- StdToCdecl.vcproj.OWNCOMPUTER.OwnWaterloo.user
- StdToStd
- StdToStd.vcproj
- StdToStd.vcproj.OWNCOMPUTER.OwnWaterloo.user
- TestSrc
- ThisToCdecl
- ThisToCdecl.vcproj
- ThisToCdecl.vcproj.OWNCOMPUTER.OwnWaterloo.user
- ThisToStd
- ThisToStd.vcproj
- ThisToStd.vcproj.OWNCOMPUTER.OwnWaterloo.user
- Thunk.sln
- src
- genericthunk_source_sample.zip
- genericthunk_source.zip
- GenericThunk_source
- include
- src
|
#include "TestClass.h"
#include <Thunk/ThunkBase.h>
#include <iostream>
using namespace Thunk;
using namespace std;
double C1::Fun1(int v1,int v2) const
{
cout<<m_name<<".Fun1("<<v1<<","<<v2<<"); this->m_v="<<m_v<<endl;
double result = m_v*1+v1*2+v2*3;
cout<<m_v<<"*1+"<<v1<<"*2+"<<v2<<"*3="<<result<<endl;
cout<<"after calling m_v="<<m_v<<endl;
return result;
}
int C1::Fun2(int v1,int v2,int v3) const
{
cout<<m_name<<".Fun2("<<v1<<","<<v2<<","<<v3<<"); this->m_v="<<m_v<<endl;
int result = m_v+v1+v2+v3;
cout<<m_v<<"+"<<v1<<"+"<<v2<<"+"<<v3<<"="<<result<<endl;
cout<<"after calling m_v="<<m_v<<endl;
return result;
}
void C1::Fun3(int v)
{
cout<<m_name<<".Fun3("<<v<<"); m_v="<<m_v<<endl;
m_v = v;
cout<<"after calling m_v="<<m_v<<endl<<endl;
}
ostream& operator<<(ostream &os,const CLarge &obj)
{
//os<<"char = "<<obj.m_c<<" short = "<<obj.m_s<<" int = "<<obj.m_i
// <<"long = "obj.m_l<<" double = "<<obj.m_d;
obj.Print(os);
return os;
}
void CLarge::Print(std::ostream &os) const
{
os<<"char = "<<m_c<<" short = "<<m_s<<" int = "<<m_i
<<" long = "<<m_l<<" double = "<<m_d;
}
CLarge C1::Fun4(char c,short s,long l,double d) const
{
return CLarge(c,s,m_v,l,d);
}
int C1::Fun5(int factor) const
{
cout<<m_name<<".Fun5("<<factor<<"); this->m_v="<<m_v<<endl;
int i = m_v;
i*=factor;
cout<<m_v<<"*"<<factor<<"="<<i<<endl;
cout<<"after calling m_v="<<m_v<<endl;
return i;
}
int C1::Fun6() const
{
cout<<m_name<<".Fun6"<<"(); this->m_v="<<m_v<<endl;
cout<<"after calling m_v="<<m_v<<endl;
return m_v;
}
CBFun1 CB1 = NULL;
CBFun2 CB2 = NULL;
CBFun3 CB3 = NULL;
CBFun4 CB4 = NULL;
CBFun5 CB5 = NULL;
const int MF1 = Thunk::Helper::PointerToInt32(&C1::Fun1);
const int MF2 = Thunk::Helper::PointerToInt32(&C1::Fun2);
const int MF3 = Thunk::Helper::PointerToInt32(&C1::Fun3);
const int MF4 = Thunk::Helper::PointerToInt32(&C1::Fun4);
const int MF5 = Thunk::Helper::PointerToInt32(&C1::Fun5);
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.