itwasntpete - 2014-02-22

Hello,

I've patched the current trunk (revisoin 818) with a small gimmick. To supply the processor classes/ callback functions/ signals with some user specific data, i added a void pointer to the methods. By using a default value (0) it is downward compatibility.

It is usable like the following example:

class foo {
public:
  uint32_t frame_ctr;

  static void bar(CigiBasePacket* p, void* d) {
    CigiSOFV3_2* pkt = dynamic_cast<CigiSOFV3_2*>(p);
    foo* this_ = reinterpret_cast<foo*>(d);

    this_->frame_ctr = pkt->GetFrameCntr();
  }

  foo() {
    im_.RegisterCallBack(CIGI_SOF_PACKET_ID_V3_2, (CigiCBProcessor) &foo::bar, this);
  }
};

This will decrease the amount of static/global functions.

you can find the patch here.

Cheers.

 

Last edit: itwasntpete 2014-02-24