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