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