MultiCam Boards Documentation > MultiCam Documentation > MultiCam C++ Reference > Classes > Channel Class > Channel::RegisterCallback Method

Channel::RegisterCallback Method

Registers the callback function for a MultiCam signal.

[C++]

void Channel::RegisterCallback(
  T *owner,
  void (T::*callbackMethod)(Channel&, SignalInfo&),
  MCSIGNAL signal
);

Parameters

owner

Reference to the object that contains the callback method.

(T::*callbackMethod)(Channel& ch, SignalInfo& info)

Address of the callback method.

ch: the Channel object that caused the signal.

info: SignalInfo object holding signal information.

signal

Identifier of the signal.

Description

The callback method from the object owner will be called by MultiCam each time a given signal is issued.

The callback method is executed in a dedicated thread.

Example

class Foo {

// ...

Channel *pChannel;

public:

void OnSurfaceProcessing(Channel &channel, SignalInfo &info);

// ...

};

void Foo::OnSurfaceProcessing(Channel &channel, SignalInfo &info) {

cout << "Signal " << info.Signal << endl;

// ...

UpdateImageConfig(*info.Surf, someEImage);

// ...

}

BOOL Foo::Init() {

// ...

pChannel->RegisterCallback(this, &OnSurfaceProcessing, MC_SIG_SURFACE_PROCESSING);

// ...

}

See Also

Channel Class | Channel::UnRegisterCallback