KiCad PCB EDA Suite
delegate_example.cpp File Reference
#include <cstdio>
#include <string>
#include <tool/delegate.h>

Go to the source code of this file.

Classes

class  MyClass
 

Typedefs

typedef DELEGATE< int, const string & > MyDelegate
 

Functions

 main ()
 

Typedef Documentation

◆ MyDelegate

typedef DELEGATE<int, const string&> MyDelegate

Definition at line 15 of file delegate_example.cpp.

Function Documentation

◆ main()

main ( )

Definition at line 17 of file delegate_example.cpp.

18 {
19  MyClass t1;
20  MyClass t2;
21 
22  MyDelegate ptr1( &t1, &MyClass::MyMethod );
23  MyDelegate ptr2( &t2, &MyClass::MyMethod );
24 
25  int retval1, retval2;
26 
27  retval1 = ptr1( "apples" );
28  retval2 = ptr2( "cherries" );
29 
30  return 0;
31 }
int MyMethod(const string &arg)
DELEGATE< int, const string & > MyDelegate

References MyClass::MyMethod().

Referenced by EC_LINE::Apply(), and EC_PERPLINE::Apply().