Constructor warning.
[shibboleth/cpp-xmltooling.git] / xmltooling / internal.h
1 /*
2  *  Copyright 2001-2005 Internet2
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  *  internal.h - internally visible classes
19  */
20
21 #ifndef __xmltooling_internal_h__
22 #define __xmltooling_internal_h__
23
24 #ifdef WIN32
25 # define _CRT_SECURE_NO_DEPRECATE 1
26 # define _CRT_NONSTDC_NO_DEPRECATE 1
27 #endif
28
29 // eventually we might be able to support autoconf via cygwin...
30 #if defined (_MSC_VER) || defined(__BORLANDC__)
31 # include "config_win32.h"
32 #else
33 # include "config.h"
34 #endif
35
36 #include "base.h"
37 #include "XMLToolingConfig.h"
38 #include "util/ParserPool.h"
39
40 #include <vector>
41 #ifndef XMLTOOLING_NO_XMLSEC
42     #include <xsec/framework/XSECProvider.hpp>
43 #endif
44
45 #define XMLTOOLING_LOGCAT "XMLTooling"
46
47 namespace xmltooling {
48     
49     /// @cond OFF
50     class XMLToolingInternalConfig : public xmltooling::XMLToolingConfig
51     {
52     public:
53         XMLToolingInternalConfig() : m_parserPool(NULL), m_lock(NULL) {
54 #ifndef XMLTOOLING_NO_XMLSEC
55             m_xsecProvider=NULL;
56 #endif
57         }
58
59         static XMLToolingInternalConfig& getInternalConfig();
60
61         // global per-process setup and shutdown of runtime
62         bool init();
63         void term();
64
65         // global mutex available to library applications
66         xmltooling::ILockable& lock();
67         void unlock();
68
69         // configuration
70         bool load_library(const char* path, void* context=NULL);
71         bool log_config(const char* config=NULL);
72
73         // internal parser pool
74         xmltooling::ParserPool* m_parserPool;
75 #ifndef XMLTOOLING_NO_XMLSEC
76         XSECProvider* m_xsecProvider;
77 #endif
78
79     private:
80         std::vector<void*> m_libhandles;
81         void* m_lock;
82         //PlugManager m_plugMgr;
83     };
84     /// @endcond
85
86 };
87
88 #endif /* __xmltooling_internal_h__ */