MCPcopy Create free account
hub / github.com/TankOs/SFGUI / BazClass

Class BazClass

examples/Signals.cpp:32–38  ·  view source on GitHub ↗

This is the third possibility. You create instances of a class and define their behavior on a per instance basis. Depending on the pointer of object you pass to Connect() the same method gets called on different objects leading to different behavior. You would pass Connect() the method address and a pointer to the object: button->OnLeftClick.Connect( &BazClass::Baz, &baz1 );

Source from the content-addressed store, hash-verified

30// You would pass Connect() the method address and a pointer to the object:
31// button->OnLeftClick.Connect( &BazClass::Baz, &baz1 );
32class BazClass {
33 public:
34 BazClass( int m_type );
35 void Baz();
36
37 int m_type;
38};
39
40// In this example we tell the object how it is to behave by setting
41// it's type in the constructor.

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected