c6a294c996175b7932c0554ccd2c3e1c7cbec756
[platform/core/uifw/dali-core.git] / dali / internal / common / message.h
1 #ifndef DALI_INTERNAL_MESSAGE_H
2 #define DALI_INTERNAL_MESSAGE_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/common/buffer-index.h>
23 #include <dali/internal/common/type-abstraction.h>
24 #include <dali/internal/update/common/scene-graph-buffers.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 /**
33  * An abstract base class for messages queued across threads.
34  * Messages are only allowed to contain value objects, either copies of the parameters or pointers
35  * If message parameter type is & or const& the message will try to take a copy of the actual type
36  */
37 class MessageBase
38 {
39 public:
40
41   /**
42    * Construct the message base.
43    */
44   MessageBase( )
45   {
46   }
47
48   /**
49    * Virtual destructor
50    */
51   virtual ~MessageBase()
52   {
53   }
54
55   /**
56    * Called to process the message.
57    * @param [in] bufferIndex The current update/render buffer index (depending on which thread processes the message).
58    */
59   virtual void Process( BufferIndex bufferIndex ) = 0;
60
61 private:
62 };
63
64 /**
65  * Templated message which calls a member function of an object.
66  * This allows nodes etc. to be modified in a thread-safe manner, when the update occurs in a separate thread.
67  * The object lifetime must controlled i.e. not destroyed before the message is processed.
68  */
69 template< typename T >
70 class Message : public MessageBase
71 {
72 public:
73
74   typedef void(T::*MemberFunction)();
75
76   /**
77    * Create a message.
78    * @note The object is expected to be const in the thread which sends this message.
79    * However it can be modified when Process() is called in a different thread.
80    * @param[in] obj The object to be updated in a separate thread.
81    * @param[in] member The member function of the object.
82    */
83   Message( const T* obj, MemberFunction member )
84   : MessageBase(),
85     object( const_cast< T* >( obj ) ),
86     memberFunction( member )
87   {
88     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
89   }
90
91   /**
92    * Virtual destructor
93    */
94   virtual ~Message()
95   {
96   }
97
98   /**
99    * @copydoc MessageBase::Process
100    */
101   virtual void Process( BufferIndex /*bufferIndex*/ )
102   {
103     (object->*memberFunction)();
104   }
105
106 private:
107
108   T* object;
109   MemberFunction memberFunction;
110
111 };
112
113 /**
114  * Templated message which calls a member function of an object.
115  * This overload passes one value-type parameter.
116  * Template parameters need to match the MemberFunction!
117  * The message will contain copy of the value (in case of & or const&)
118  */
119 template< typename T, typename P >
120 class MessageValue1 : public MessageBase
121 {
122 public:
123
124   typedef void(T::*MemberFunction)( typename ParameterType< P >::PassingType );
125
126   /**
127    * Create a message.
128    * @note The object is expected to be const in the thread which sends this message.
129    * However it can be modified when Process() is called in a different thread.
130    * @param[in] obj The object.
131    * @param[in] member The member function of the object.
132    * @param[in] p1 The first value-type parameter to pass to the member function.
133    */
134   MessageValue1( const T* obj,
135                  MemberFunction member,
136                  typename ParameterType< P >::PassingType p1 )
137   : MessageBase(),
138     object( const_cast< T* >( obj ) ),
139     memberFunction( member ),
140     param1( p1 )
141   {
142     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
143   }
144
145   /**
146    * Virtual destructor
147    */
148   virtual ~MessageValue1()
149   {
150   }
151
152   /**
153    * @copydoc MessageBase::Process
154    */
155   virtual void Process( BufferIndex /*bufferIndex*/ )
156   {
157     (object->*memberFunction)( param1 );
158   }
159
160 private:
161
162   T* object;
163   MemberFunction memberFunction;
164   typename ParameterType< P >::HolderType param1;
165
166 };
167
168 /**
169  * Templated message which calls a member function of an object.
170  * This overload passes two value-type parameters.
171  * Template parameters need to match the MemberFunction!
172  * The message will contain copy of the value (in case of & or const&)
173  */
174
175 template< typename T, typename P1, typename P2 >
176 class MessageValue2 : public MessageBase
177 {
178 public:
179
180   typedef void(T::*MemberFunction)(
181       typename ParameterType< P1 >::PassingType,
182       typename ParameterType< P2 >::PassingType );
183
184   /**
185    * Create a message.
186    * @note The object is expected to be const in the thread which sends this message.
187    * However it can be modified when Process() is called in a different thread.
188    * @param[in] obj The object.
189    * @param[in] member The member function of the object.
190    * @param[in] p1 The first parameter to pass to the member function.
191    * @param[in] p2 The second parameter to pass to the member function.
192    */
193   MessageValue2( const T* obj,
194                  MemberFunction member,
195                  typename ParameterType< P1 >::PassingType p1,
196                  typename ParameterType< P2 >::PassingType p2 )
197   : MessageBase(),
198     object( const_cast< T* >( obj ) ),
199     memberFunction( member ),
200     param1( p1 ),
201     param2( p2 )
202   {
203     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
204   }
205
206   /**
207    * Virtual destructor
208    */
209   virtual ~MessageValue2()
210   {
211   }
212
213   /**
214    * @copydoc MessageBase::Process
215    */
216   virtual void Process( BufferIndex /*bufferIndex*/ )
217   {
218     (object->*memberFunction)( param1, param2 );
219   }
220
221 private:
222
223   T* object;
224   MemberFunction memberFunction;
225   typename ParameterType< P1 >::HolderType param1;
226   typename ParameterType< P2 >::HolderType param2;
227
228 };
229
230 /**
231  * Templated message which calls a member function of an object.
232  * This overload passes three value-type parameters.
233  * Template parameters need to match the MemberFunction!
234  * The message will contain copy of the value (in case of & or const&)
235  */
236 template< typename T, typename P1, typename P2, typename P3 >
237 class MessageValue3 : public MessageBase
238 {
239 public:
240
241   typedef void(T::*MemberFunction)(
242       typename ParameterType< P1 >::PassingType,
243       typename ParameterType< P2 >::PassingType,
244       typename ParameterType< P3 >::PassingType );
245
246   /**
247    * Create a message.
248    * @note The object is expected to be const in the thread which sends this message.
249    * However it can be modified when Process() is called in a different thread.
250    * @param[in] obj The object.
251    * @param[in] member The member function of the object.
252    * @param[in] p1 The first parameter to pass to the member function.
253    * @param[in] p2 The second parameter to pass to the member function.
254    * @param[in] p3 The third parameter to pass to the member function.
255    */
256   MessageValue3( const T* obj,
257                  MemberFunction member,
258                  typename ParameterType< P1 >::PassingType p1,
259                  typename ParameterType< P2 >::PassingType p2,
260                  typename ParameterType< P3 >::PassingType p3 )
261   : MessageBase(),
262     object( const_cast< T* >( obj ) ),
263     memberFunction( member ),
264     param1( p1 ),
265     param2( p2 ),
266     param3( p3 )
267   {
268     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
269   }
270
271   /**
272    * Virtual destructor
273    */
274   virtual ~MessageValue3()
275   {
276   }
277
278   /**
279    * @copydoc MessageBase::Process
280    */
281   virtual void Process( BufferIndex /*bufferIndex*/ )
282   {
283     (object->*memberFunction)( param1, param2, param3 );
284   }
285
286 private:
287
288   T* object;
289   MemberFunction memberFunction;
290   typename ParameterType< P1 >::HolderType param1;
291   typename ParameterType< P2 >::HolderType param2;
292   typename ParameterType< P3 >::HolderType param3;
293
294 };
295
296 /**
297  * Templated message which calls a member function of an object.
298  * This overload passes four value-type parameters.
299  * Template parameters need to match the MemberFunction!
300  * The message will contain copy of the value (in case of & or const&)
301  */
302 template< typename T, typename P1, typename P2, typename P3, typename P4 >
303 class MessageValue4 : public MessageBase
304 {
305 public:
306
307   typedef void(T::*MemberFunction)(
308       typename ParameterType< P1 >::PassingType,
309       typename ParameterType< P2 >::PassingType,
310       typename ParameterType< P3 >::PassingType,
311       typename ParameterType< P4 >::PassingType );
312
313   /**
314    * Create a message.
315    * @note The object is expected to be const in the thread which sends this message.
316    * However it can be modified when Process() is called in a different thread.
317    * @param[in] obj The object.
318    * @param[in] member The member function of the object.
319    * @param[in] p1 The first parameter to pass to the member function.
320    * @param[in] p2 The second parameter to pass to the member function.
321    * @param[in] p3 The third parameter to pass to the member function.
322    * @param[in] p4 The fourth parameter to pass to the member function.
323    */
324   MessageValue4( const T* obj,
325                  MemberFunction member,
326                  typename ParameterType< P1 >::PassingType p1,
327                  typename ParameterType< P2 >::PassingType p2,
328                  typename ParameterType< P3 >::PassingType p3,
329                  typename ParameterType< P4 >::PassingType p4 )
330   : MessageBase(),
331     object( const_cast< T* >( obj ) ),
332     memberFunction( member ),
333     param1( p1 ),
334     param2( p2 ),
335     param3( p3 ),
336     param4( p4 )
337   {
338     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
339   }
340
341   /**
342    * Virtual destructor
343    */
344   virtual ~MessageValue4()
345   {
346   }
347
348   /**
349    * @copydoc MessageBase::Process
350    */
351   virtual void Process( BufferIndex /*bufferIndex*/ )
352   {
353     (object->*memberFunction)( param1, param2, param3, param4 );
354   }
355
356 private:
357
358   T* object;
359   MemberFunction memberFunction;
360   typename ParameterType< P1 >::HolderType param1;
361   typename ParameterType< P2 >::HolderType param2;
362   typename ParameterType< P3 >::HolderType param3;
363   typename ParameterType< P4 >::HolderType param4;
364
365 };
366
367 /**
368  * Templated message which calls a member function of an object.
369  * This overload passes five value-type parameters.
370  * Template parameters need to match the MemberFunction!
371  * The message will contain copy of the value (in case of & or const&)
372  */
373 template< typename T, typename P1, typename P2, typename P3, typename P4, typename P5 >
374 class MessageValue5 : public MessageBase
375 {
376 public:
377
378   typedef void(T::*MemberFunction)(
379       typename ParameterType< P1 >::PassingType,
380       typename ParameterType< P2 >::PassingType,
381       typename ParameterType< P3 >::PassingType,
382       typename ParameterType< P4 >::PassingType,
383       typename ParameterType< P5 >::PassingType );
384
385   /**
386    * Create a message.
387    * @note The object is expected to be const in the thread which sends this message.
388    * However it can be modified when Process() is called in a different thread.
389    * @param[in] obj The object.
390    * @param[in] member The member function of the object.
391    * @param[in] p1 The first parameter to pass to the member function.
392    * @param[in] p2 The second parameter to pass to the member function.
393    * @param[in] p3 The third parameter to pass to the member function.
394    * @param[in] p4 The fourth parameter to pass to the member function.
395    * @param[in] p5 The fifth parameter to pass to the member function.
396    */
397   MessageValue5( const T* obj,
398                  MemberFunction member,
399                  typename ParameterType< P1 >::PassingType p1,
400                  typename ParameterType< P2 >::PassingType p2,
401                  typename ParameterType< P3 >::PassingType p3,
402                  typename ParameterType< P4 >::PassingType p4,
403                  typename ParameterType< P5 >::PassingType p5 )
404   : MessageBase(),
405     object( const_cast< T* >( obj ) ),
406     memberFunction( member ),
407     param1( p1 ),
408     param2( p2 ),
409     param3( p3 ),
410     param4( p4 ),
411     param5( p5 )
412   {
413     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
414   }
415
416   /**
417    * Virtual destructor
418    */
419   virtual ~MessageValue5()
420   {
421   }
422
423   /**
424    * @copydoc MessageBase::Process
425    */
426   virtual void Process( BufferIndex /*bufferIndex*/ )
427   {
428     (object->*memberFunction)( param1, param2, param3, param4, param5 );
429   }
430
431 private:
432
433   T* object;
434   MemberFunction memberFunction;
435   typename ParameterType< P1 >::HolderType param1;
436   typename ParameterType< P2 >::HolderType param2;
437   typename ParameterType< P3 >::HolderType param3;
438   typename ParameterType< P4 >::HolderType param4;
439   typename ParameterType< P5 >::HolderType param5;
440
441 };
442
443 /**
444  * Templated message which calls a member function of an object.
445  * This overload passes six value-type parameters.
446  * Template parameters need to match the MemberFunction!
447  * The message will contain copy of the value (in case of & or const&)
448  */
449 template< typename T, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6 >
450 class MessageValue6 : public MessageBase
451 {
452 public:
453
454   typedef void(T::*MemberFunction)(
455       typename ParameterType< P1 >::PassingType,
456       typename ParameterType< P2 >::PassingType,
457       typename ParameterType< P3 >::PassingType,
458       typename ParameterType< P4 >::PassingType,
459       typename ParameterType< P5 >::PassingType,
460       typename ParameterType< P6 >::PassingType );
461
462   /**
463    * Create a message.
464    * @note The object is expected to be const in the thread which sends this message.
465    * However it can be modified when Process() is called in a different thread.
466    * @param[in] obj The object.
467    * @param[in] member The member function of the object.
468    * @param[in] p1 The first parameter to pass to the member function.
469    * @param[in] p2 The second parameter to pass to the member function.
470    * @param[in] p3 The third parameter to pass to the member function.
471    * @param[in] p4 The fourth parameter to pass to the member function.
472    * @param[in] p5 The fifth parameter to pass to the member function.
473    * @param[in] p6 The sixth parameter to pass to the member function.
474    */
475   MessageValue6( const T* obj,
476                  MemberFunction member,
477                  typename ParameterType< P1 >::PassingType p1,
478                  typename ParameterType< P2 >::PassingType p2,
479                  typename ParameterType< P3 >::PassingType p3,
480                  typename ParameterType< P4 >::PassingType p4,
481                  typename ParameterType< P5 >::PassingType p5,
482                  typename ParameterType< P6 >::PassingType p6 )
483   : MessageBase(),
484     object( const_cast< T* >( obj ) ),
485     memberFunction( member ),
486     param1( p1 ),
487     param2( p2 ),
488     param3( p3 ),
489     param4( p4 ),
490     param5( p5 ),
491     param6( p6 )
492   {
493     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
494   }
495
496   /**
497    * Virtual destructor
498    */
499   virtual ~MessageValue6()
500   {
501   }
502
503   /**
504    * @copydoc MessageBase::Process
505    */
506   virtual void Process( BufferIndex /*bufferIndex*/ )
507   {
508     (object->*memberFunction)( param1, param2, param3, param4, param5, param6 );
509   }
510
511 private:
512
513   T* object;
514   MemberFunction memberFunction;
515   typename ParameterType< P1 >::HolderType param1;
516   typename ParameterType< P2 >::HolderType param2;
517   typename ParameterType< P3 >::HolderType param3;
518   typename ParameterType< P4 >::HolderType param4;
519   typename ParameterType< P5 >::HolderType param5;
520   typename ParameterType< P6 >::HolderType param6;
521
522 };
523
524 /**
525  * Templated message which calls a member function of an object.
526  * This overload passes just the buffer index to the method, no parameters.
527  */
528 template< typename T >
529 class MessageDoubleBuffered0 : public MessageBase
530 {
531 public:
532
533   typedef void(T::*MemberFunction)( BufferIndex );
534
535   /**
536    * Create a message.
537    * @note The object is expected to be const in the thread which sends this message.
538    * However it can be modified when Process() is called in a different thread.
539    * @param[in] obj The object.
540    * @param[in] member The member function of the object.
541    */
542   MessageDoubleBuffered0( const T* obj, MemberFunction member )
543   : MessageBase(),
544     object( const_cast< T* >( obj ) ),
545     memberFunction( member )
546   {
547     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
548   }
549
550   /**
551    * Virtual destructor
552    */
553   virtual ~MessageDoubleBuffered0()
554   {
555   }
556
557   /**
558    * @copydoc MessageBase::Process
559    */
560   virtual void Process( BufferIndex bufferIndex )
561   {
562     (object->*memberFunction)( bufferIndex );
563   }
564
565 private:
566
567   T* object;
568   MemberFunction memberFunction;
569
570 };
571
572
573 /**
574  * Templated message which calls a member function of an object.
575  * This overload passes a value-type to set a double-buffered property.
576  * Template parameters need to match the MemberFunction!
577  * The message will contain copy of the value (in case of & or const&)
578  */
579 template< typename T, typename P >
580 class MessageDoubleBuffered1 : public MessageBase
581 {
582 public:
583
584   typedef void(T::*MemberFunction)(
585       BufferIndex,
586       typename ParameterType< P >::PassingType );
587
588   /**
589    * Create a message.
590    * @note The object is expected to be const in the thread which sends this message.
591    * However it can be modified when Process() is called in a different thread.
592    * @param[in] obj The object.
593    * @param[in] member The member function of the object.
594    * @param[in] p The second parameter to pass.
595    */
596   MessageDoubleBuffered1( const T* obj,
597                           MemberFunction member,
598                           typename ParameterType< P >::PassingType p )
599   : MessageBase(),
600     object( const_cast< T* >( obj ) ),
601     memberFunction( member ),
602     param( p )
603   {
604     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
605   }
606
607   /**
608    * Virtual destructor
609    */
610   virtual ~MessageDoubleBuffered1()
611   {
612   }
613
614   /**
615    * @copydoc MessageBase::Process
616    */
617   virtual void Process( BufferIndex bufferIndex )
618   {
619     (object->*memberFunction)( bufferIndex,  param );
620   }
621
622 private:
623
624   T* object;
625   MemberFunction memberFunction;
626   typename ParameterType< P >::HolderType param;
627
628 };
629
630 /**
631  * Templated message which calls a member function of an object.
632  * This overload passes two value-types to set double-buffered properties.
633  * Template parameters need to match the MemberFunction!
634  * The message will contain copy of the value (in case of & or const&)
635  */
636 template< typename T, typename P2, typename P3 >
637 class MessageDoubleBuffered2 : public MessageBase
638 {
639 public:
640
641   typedef void(T::*MemberFunction)(
642       BufferIndex,
643       typename ParameterType< P2 >::PassingType,
644       typename ParameterType< P3 >::PassingType );
645
646   /**
647    * Create a message.
648    * @note The object is expected to be const in the thread which sends this message.
649    * However it can be modified when Process() is called in a different thread.
650    * @param[in] obj The object.
651    * @param[in] member The member function of the object.
652    * @param[in] p2 The second parameter to pass to the function.
653    * @param[in] p3 The third parameter to pass to the function.
654    */
655   MessageDoubleBuffered2( const T* obj,
656                           MemberFunction member,
657                           typename ParameterType< P2 >::PassingType p2,
658                           typename ParameterType< P3 >::PassingType p3 )
659   : MessageBase(),
660     object( const_cast< T* >( obj ) ),
661     memberFunction( member ),
662     param2( p2 ),
663     param3( p3 )
664   {
665     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
666   }
667
668   /**
669    * Virtual destructor
670    */
671   virtual ~MessageDoubleBuffered2()
672   {
673   }
674
675   /**
676    * @copydoc MessageBase::Process
677    */
678   virtual void Process( BufferIndex bufferIndex )
679   {
680     (object->*memberFunction)( bufferIndex, param2, param3 );
681   }
682
683 private:
684
685   T* object;
686   MemberFunction memberFunction;
687   typename ParameterType< P2 >::HolderType param2;
688   typename ParameterType< P3 >::HolderType param3;
689
690 };
691
692
693 /**
694  * Templated message which calls a member function of an object.
695  * This overload passes three value-types to set double-buffered properties.
696  * Template parameters need to match the MemberFunction!
697  * The message will contain copy of the value (in case of & or const&)
698  */
699 template< typename T, typename P2, typename P3, typename P4 >
700 class MessageDoubleBuffered3 : public MessageBase
701 {
702 public:
703
704   typedef void(T::*MemberFunction)(
705       BufferIndex,
706       typename ParameterType< P2 >::PassingType,
707       typename ParameterType< P3 >::PassingType,
708       typename ParameterType< P4 >::PassingType );
709
710   /**
711    * Create a message.
712    * @note The object is expected to be const in the thread which sends this message.
713    * However it can be modified when Process() is called in a different thread.
714    * @param[in] obj The object.
715    * @param[in] member The member function of the object.
716    * @param[in] p2 The second parameter to pass.
717    * @param[in] p3 The third parameter to pass.
718    * @param[in] p4 The forth parameter to pass.
719    */
720   MessageDoubleBuffered3( const T* obj,
721                           MemberFunction member,
722                           typename ParameterType< P2 >::PassingType p2,
723                           typename ParameterType< P3 >::PassingType p3,
724                           typename ParameterType< P4 >::PassingType p4 )
725   : MessageBase(),
726     object( const_cast< T* >( obj ) ),
727     memberFunction( member ),
728     param2( p2 ),
729     param3( p3 ),
730     param4( p4 )
731   {
732     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
733   }
734
735   /**
736    * Virtual destructor
737    */
738   virtual ~MessageDoubleBuffered3()
739   {
740   }
741
742   /**
743    * @copydoc MessageBase::Process
744    */
745   virtual void Process( BufferIndex bufferIndex )
746   {
747     (object->*memberFunction)( bufferIndex, param2, param3, param4 );
748   }
749
750 private:
751
752   T* object;
753   MemberFunction memberFunction;
754   typename ParameterType< P2 >::HolderType param2;
755   typename ParameterType< P3 >::HolderType param3;
756   typename ParameterType< P4 >::HolderType param4;
757
758 };
759
760 /**
761  * Templated message which calls a member function of an object.
762  * This overload passes four value-types to set double-buffered properties.
763  * Template parameters need to match the MemberFunction!
764  * The message will contain copy of the value (in case of & or const&)
765  */
766 template< typename T, typename P2, typename P3, typename P4, typename P5 >
767 class MessageDoubleBuffered4 : public MessageBase
768 {
769 public:
770
771   typedef void(T::*MemberFunction)(
772       BufferIndex,
773       typename ParameterType< P2 >::PassingType,
774       typename ParameterType< P3 >::PassingType,
775       typename ParameterType< P4 >::PassingType,
776       typename ParameterType< P5 >::PassingType );
777
778   /**
779    * Create a message.
780    * @note The object is expected to be const in the thread which sends this message.
781    * However it can be modified when Process() is called in a different thread.
782    * @param[in] obj The object.
783    * @param[in] member The member function of the object.
784    * @param[in] p2 The second parameter to pass.
785    * @param[in] p3 The third parameter to pass.
786    * @param[in] p4 The forth parameter to pass.
787    * @param[in] p5 The fifth parameter to pass.
788    */
789   MessageDoubleBuffered4( const T* obj,
790                           MemberFunction member,
791                           typename ParameterType< P2 >::PassingType p2,
792                           typename ParameterType< P3 >::PassingType p3,
793                           typename ParameterType< P4 >::PassingType p4,
794                           typename ParameterType< P5 >::PassingType p5 )
795   : MessageBase(),
796     object( const_cast< T* >( obj ) ),
797     memberFunction( member ),
798     param2( p2 ),
799     param3( p3 ),
800     param4( p4 ),
801     param5( p5 )
802   {
803     DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
804   }
805
806   /**
807    * Virtual destructor
808    */
809   virtual ~MessageDoubleBuffered4()
810   {
811   }
812
813   /**
814    * @copydoc MessageBase::Process
815    */
816   virtual void Process( BufferIndex bufferIndex )
817   {
818     (object->*memberFunction)( bufferIndex, param2, param3, param4, param5 );
819   }
820
821 private:
822
823   T* object;
824   MemberFunction memberFunction;
825   typename ParameterType< P2 >::HolderType param2;
826   typename ParameterType< P3 >::HolderType param3;
827   typename ParameterType< P4 >::HolderType param4;
828   typename ParameterType< P5 >::HolderType param5;
829
830 };
831
832 } // namespace Internal
833
834 } // namespace Dali
835
836 #endif // DALI_INTERNAL_MESSAGE_H