Vultraz

Untitled

Feb 6th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. template <typename T>
  2. void tgroup::execute_group_actions(T& caller_widget)
  3. {
  4.     FOREACH(AUTO * widget, members_)
  5.     {
  6.         if(widget == NULL) {
  7.             continue;
  8.         }
  9.  
  10.         //
  11.         // NOTE: optimally, we would use virtual functions to enforce the
  12.         // function mame, but since this is only used by one widget so far,
  13.         // it seems a waste to add a pure virtual method to twidget and override
  14.         // it in every widget class save one.
  15.         //
  16.         // TODO: investigate cleaner usecase in future
  17.         //
  18.         caller_widget->group_operator(dynamic_cast<T>(widget));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment