类回调函数

1. fastdelegate

  MyDelegate funclist[10];

// delegates are initialized to empty CBaseClass a("Base A"); CBaseClass b("Base B"); CDerivedClass d; CDerivedClass c;

// Binding a simple member function

 funclist[0].bind(&a, &CBaseClass::SimpleMemberFunction);

if (funclist[i]) {

// Invocation generates optimal assembly code.

 funclist[i](i, msg);

}

else

 {

 printf("Delegate is empty\n");

 };

 

2.

 

你可能感兴趣的:(类回调函数)