1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
#define __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Type.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
namespace framework{
/*_________________________________________________________________________________________________________________
macros for declaration and definition of XTypeProvider
Please use follow public macros only!
1) DEFINE_XTYPEPROVIDER => use it in header to declare XTypeProvider and his methods
2) DECLARE_TYPEPROVIDER_0( CLASS ) => use it to define implementation of XTypeProvider for 0 supported type
DECLARE_TYPEPROVIDER_1( CLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 supported type
...
DECLARE_TYPEPROVIDER_16( CLASS, TYPE1, ... , TYPE16 )
3) DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) => use it to define implementation of XTypeProvider for 1 additional supported type to baseclass
...
DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, ..., TYPE5 )
_________________________________________________________________________________________________________________*/
//*****************************************************************************************************************
// private
// implementation of XTypeProvider::getImplementationId()
//*****************************************************************************************************************
#define PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CLASS::getImplementationId() throw( ::com::sun::star::uno::RuntimeException ) \
{ \
/* Create one Id for all instances of this class. */ \
/* Use ethernet address to do this! (sal_True) */ \
/* Optimize this method */ \
/* We initialize a static variable only one time. And we don't must use a mutex at every call! */ \
/* For the first call; pID is NULL - for the second call pID is different from NULL! */ \
static ::cppu::OImplementationId* pID = NULL ; \
if ( pID == NULL ) \
{ \
/* Ready for multithreading; get global mutex for first call of this method only! see before */ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
/* Control these pointer again ... it can be, that another instance will be faster then these! */ \
if ( pID == NULL ) \
{ \
/* Create a new static ID ... */ \
static ::cppu::OImplementationId aID( sal_False ); \
/* ... and set his address to static pointer! */ \
pID = &aID ; \
} \
} \
return pID->getImplementationId(); \
}
//*****************************************************************************************************************
// private
// implementation of XTypeProvider::getTypes() with max. 12 interfaces!
//*****************************************************************************************************************
#define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES ) \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
{ \
/* Optimize this method ! */ \
/* We initialize a static variable only one time. */ \
/* And we don't must use a mutex at every call! */ \
/* For the first call; pTypeCollection is NULL - */ \
/* for the second call pTypeCollection is different from NULL! */ \
static ::cppu::OTypeCollection* pTypeCollection = NULL ; \
if ( pTypeCollection == NULL ) \
{ \
/* Ready for multithreading; get global mutex for first call of this method only! see before */ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
/* Control these pointer again ... it can be, that another instance will be faster then these! */ \
if ( pTypeCollection == NULL ) \
{ \
/* Create a static typecollection ... */ \
/* Attention: "TYPES" will expand to "(...)"! */ \
static ::cppu::OTypeCollection aTypeCollection TYPES ; \
/* ... and set his address to static pointer! */ \
pTypeCollection = &aTypeCollection ; \
} \
} \
return pTypeCollection->getTypes(); \
}
//*****************************************************************************************************************
// private
// implementation of XTypeProvider::getTypes() with more then 12 interfaces!
//*****************************************************************************************************************
#define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
{ \
/* Optimize this method ! */ \
/* We initialize a static variable only one time. */ \
/* And we don't must use a mutex at every call! */ \
/* For the first call; pTypeCollection is NULL - */ \
/* for the second call pTypeCollection is different from NULL! */ \
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
if ( pTypeCollection == NULL ) \
{ \
/* Ready for multithreading; get global mutex for first call of this method only! see before */ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
/* Control these pointer again ... it can be, that another instance will be faster then these! */ \
if ( pTypeCollection == NULL ) \
{ \
/* Create two typecollections */ \
/* (cppuhelper support 12 items per collection only!) */ \
::cppu::OTypeCollection aTypeCollection1 TYPES_FIRST ; \
::cppu::OTypeCollection aTypeCollection2 TYPES_SECOND ; \
/* Copy all items from both sequences to one result list! */ \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection1.getTypes(); \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = aTypeCollection2.getTypes(); \
sal_Int32 nCount1 = seqTypes1.getLength(); \
sal_Int32 nCount2 = seqTypes2.getLength(); \
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
sal_Int32 nSource = 0; \
sal_Int32 nDestination= 0; \
while( nSource<nCount1 ) \
{ \
seqResult[nDestination] = seqTypes1[nSource]; \
++nSource; \
++nDestination; \
} \
nSource = 0; \
while( nSource<nCount2 ) \
{ \
seqResult[nDestination] = seqTypes2[nSource]; \
++nSource; \
++nDestination; \
} \
/* ... and set his address to static pointer! */ \
pTypeCollection = &seqResult; \
} \
} \
return *pTypeCollection; \
}
//*****************************************************************************************************************
// private
// implementation of XTypeProvider::getTypes() with using max. 12 interfaces + baseclass!
//*****************************************************************************************************************
#define PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES ) \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL CLASS::getTypes() throw( ::com::sun::star::uno::RuntimeException ) \
{ \
/* Optimize this method ! */ \
/* We initialize a static variable only one time. */ \
/* And we don't must use a mutex at every call! */ \
/* For the first call; pTypeCollection is NULL - */ \
/* for the second call pTypeCollection is different from NULL! */ \
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >* pTypeCollection = NULL ; \
if ( pTypeCollection == NULL ) \
{ \
/* Ready for multithreading; get global mutex for first call of this method only! see before */ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
/* Control these pointer again ... it can be, that another instance will be faster then these! */ \
if ( pTypeCollection == NULL ) \
{ \
/* Create static typecollection for my own interfaces! */ \
static ::cppu::OTypeCollection aTypeCollection TYPES ; \
/* Copy all items from my list sequences and from my baseclass */ \
/* to one result list! */ \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes1 = aTypeCollection.getTypes(); \
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqTypes2 = BASECLASS::getTypes(); \
sal_Int32 nCount1 = seqTypes1.getLength(); \
sal_Int32 nCount2 = seqTypes2.getLength(); \
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > seqResult ( nCount1+nCount2 ); \
sal_Int32 nSource = 0; \
sal_Int32 nDestination= 0; \
while( nSource<nCount1 ) \
{ \
seqResult[nDestination] = seqTypes1[nSource]; \
++nSource; \
++nDestination; \
} \
nSource = 0; \
while( nSource<nCount2 ) \
{ \
seqResult[nDestination] = seqTypes2[nSource]; \
++nSource; \
++nDestination; \
} \
/* ... and set his address to static pointer! */ \
pTypeCollection = &seqResult; \
} \
} \
return *pTypeCollection; \
}
//*****************************************************************************************************************
// private
// help macros to replace TYPES in getTypes() [see before]
//*****************************************************************************************************************
#define PRIVATE_DEFINE_TYPE_1( TYPE1 ) \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE1 >*)NULL )
#define PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ) \
PRIVATE_DEFINE_TYPE_1( TYPE1 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE2 >*)NULL )
#define PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ) \
PRIVATE_DEFINE_TYPE_2( TYPE1, TYPE2 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE3 >*)NULL )
#define PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ) \
PRIVATE_DEFINE_TYPE_3( TYPE1, TYPE2, TYPE3 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE4 >*)NULL )
#define PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
PRIVATE_DEFINE_TYPE_4( TYPE1, TYPE2, TYPE3, TYPE4 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE5 >*)NULL )
#define PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
PRIVATE_DEFINE_TYPE_5( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE6 >*)NULL )
#define PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
PRIVATE_DEFINE_TYPE_6( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE7 >*)NULL )
#define PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
PRIVATE_DEFINE_TYPE_7( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE8 >*)NULL )
#define PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
PRIVATE_DEFINE_TYPE_8( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE9 >*)NULL )
#define PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
PRIVATE_DEFINE_TYPE_9( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE10 >*)NULL )
#define PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
PRIVATE_DEFINE_TYPE_10( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE11 >*)NULL )
#define PRIVATE_DEFINE_TYPE_12( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
PRIVATE_DEFINE_TYPE_11( TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ), \
::getCppuType(( const ::com::sun::star::uno::Reference< TYPE12 >*)NULL )
//*****************************************************************************************************************
// private
// complete implementation of XTypeProvider
//*****************************************************************************************************************
#define PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, ::getCppuType(( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider >*)NULL ) )
#define PRIVATE_DEFINE_XTYPEPROVIDER( CLASS, TYPES ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES( CLASS, TYPES )
#define PRIVATE_DEFINE_XTYPEPROVIDER_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_LARGE( CLASS, TYPES_FIRST, TYPES_SECOND )
#define PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS( CLASS, BASECLASS, TYPES ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETIMPLEMENTATIONID( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_GETTYPES_BASECLASS( CLASS, BASECLASS, TYPES )
//*****************************************************************************************************************
// public
// declaration of XTypeProvider
//*****************************************************************************************************************
#define FWK_DECLARE_XTYPEPROVIDER \
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes () throw( ::com::sun::star::uno::RuntimeException );\
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( ::com::sun::star::uno::RuntimeException );
//*****************************************************************************************************************
// public
// implementation of XTypeProvider
//*****************************************************************************************************************
// implementation of XTypeProvider without additional interface for getTypes()
// XTypeProvider is used as the only one interface automaticly.
// Following defines don't use XTypeProvider automaticly!!!!
#define DEFINE_XTYPEPROVIDER_0( CLASS ) \
PRIVATE_DEFINE_XTYPEPROVIDER_PURE( CLASS )
// implementation of XTypeProvider with 1 additional interface for getTypes()
#define DEFINE_XTYPEPROVIDER_1( CLASS, TYPE1 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
)) \
)
// implementation of XTypeProvider with 2 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_2( CLASS, TYPE1, TYPE2 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
TYPE2 \
)) \
)
// implementation of XTypeProvider with 3 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_3( CLASS, TYPE1, TYPE2, TYPE3 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
TYPE2 , \
TYPE3 \
)) \
)
// implementation of XTypeProvider with 4 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_4( CLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 \
)) \
)
// implementation of XTypeProvider with 5 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_5( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 \
)) \
)
// implementation of XTypeProvider with 6 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_6( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_6 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 \
)) \
)
// implementation of XTypeProvider with 7 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_7( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_7 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 \
)) \
)
// implementation of XTypeProvider with 8 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_8( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_8 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 \
)) \
)
// implementation of XTypeProvider with 9 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_9( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_9 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 \
)) \
)
// implementation of XTypeProvider with 10 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_10( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_10 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 \
)) \
)
// implementation of XTypeProvider with 11 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_11( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_11 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 \
)) \
)
// implementation of XTypeProvider with 12 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_12( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12 ) \
PRIVATE_DEFINE_XTYPEPROVIDER ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)) \
)
// implementation of XTypeProvider with 13 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_13( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_1 ( TYPE13 \
)) \
)
// implementation of XTypeProvider with 14 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_14( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_2 ( TYPE13 , \
TYPE14 \
)) \
)
// implementation of XTypeProvider with 15 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_15( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_3 ( TYPE13 , \
TYPE14 , \
TYPE15 \
)) \
)
// implementation of XTypeProvider with 16 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_16( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_4 ( TYPE13 , \
TYPE14 , \
TYPE15 , \
TYPE16 \
)) \
)
// implementation of XTypeProvider with 17 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_17( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_5 ( TYPE13 , \
TYPE14 , \
TYPE15 , \
TYPE16 , \
TYPE17 \
)) \
)
// implementation of XTypeProvider with 18 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_18( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_6 ( TYPE13 , \
TYPE14 , \
TYPE15 , \
TYPE16 , \
TYPE17 , \
TYPE18 \
)) \
)
// implementation of XTypeProvider with 19 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_19( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_7 ( TYPE13 , \
TYPE14 , \
TYPE15 , \
TYPE16 , \
TYPE17 , \
TYPE18 , \
TYPE19 \
)) \
)
// implementation of XTypeProvider with 20 additional interfaces for getTypes()
#define DEFINE_XTYPEPROVIDER_20( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19, TYPE20 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
(PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 , \
TYPE6 , \
TYPE7 , \
TYPE8 , \
TYPE9 , \
TYPE10 , \
TYPE11 , \
TYPE12 \
)), \
(PRIVATE_DEFINE_TYPE_8 ( TYPE13 , \
TYPE14 , \
TYPE15 , \
TYPE16 , \
TYPE17 , \
TYPE18 , \
TYPE19 , \
TYPE20 \
)) \
)
// implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
BASECLASS, \
(PRIVATE_DEFINE_TYPE_1 ( TYPE1 \
)) \
)
// implementation of XTypeProvider with 2 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_2_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
BASECLASS, \
(PRIVATE_DEFINE_TYPE_2 ( TYPE1 , \
TYPE2 \
)) \
)
// implementation of XTypeProvider with 3 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_3_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
BASECLASS, \
(PRIVATE_DEFINE_TYPE_3 ( TYPE1 , \
TYPE2 , \
TYPE3 \
)) \
)
// implementation of XTypeProvider with 4 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_4_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
BASECLASS, \
(PRIVATE_DEFINE_TYPE_4 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 \
)) \
)
// implementation of XTypeProvider with 5 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_5_WITH_BASECLASS( CLASS, BASECLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
BASECLASS, \
(PRIVATE_DEFINE_TYPE_5 ( TYPE1 , \
TYPE2 , \
TYPE3 , \
TYPE4 , \
TYPE5 \
)) \
)
} // namespace framework
#endif // #ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|