xref: /AOO41X/main/framework/inc/macros/debug/registration.hxx (revision f8e07b45f7e1fb69563504f404bb0b75210f0be6)
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_DEBUG_REGISTRATION_HXX_
25 #define __FRAMEWORK_MACROS_DEBUG_REGISTRATION_HXX_
26 
27 //*****************************************************************************************************************
28 //  special macros for assertion handling
29 //*****************************************************************************************************************
30 
31 #ifdef  ENABLE_REGISTRATIONDEBUG
32 
33     //_____________________________________________________________________________________________________________
34     //  includes
35     //_____________________________________________________________________________________________________________
36 
37     #ifndef _RTL_STRBUF_HXX_
38     #include <rtl/strbuf.hxx>
39     #endif
40 
41     /*_____________________________________________________________________________________________________________
42         LOGFILE_ASSERTIONS
43 
44         For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
45     _____________________________________________________________________________________________________________*/
46 
47     #ifndef LOGFILE_REGISTRATION
48         #define LOGFILE_REGISTRATION                                                                            \
49                     "registration.log"
50     #endif
51 
52     #define LOG_REGISTRATION_GETFACTORY( SINFOTEXT )                                                            \
53                 {                                                                                               \
54                     ::rtl::OStringBuffer sOut( 1024 );                                                          \
55                     sOut.append( "component_getFactory():" );                                                   \
56                     sOut.append( SINFOTEXT                 );                                                   \
57                     WRITE_LOGFILE( LOGFILE_REGISTRATION, sOut.makeStringAndClear() )                            \
58                 }
59 
60 #else   // #ifdef ENABLE_REGISTRATIONDEBUG
61 
62     /*_____________________________________________________________________________________________________________
63         If right testmode is'nt set - implements these macro empty!
64     _____________________________________________________________________________________________________________*/
65 
66     #undef  LOGFILE_REGISTRATION
67     #define LOG_REGISTRATION_GETFACTORY( SINFOTEXT )
68 
69 #endif  // #ifdef ENABLE_REGISTRATIONDEBUG
70 
71 //*****************************************************************************************************************
72 //  end of file
73 //*****************************************************************************************************************
74 
75 #endif  // #ifndef __FRAMEWORK_MACROS_DEBUG_REGISTRATION_HXX_
76