diff --git a/Util/Makefile b/Util/Makefile
index b5f75d4f6..e46d80779 100644
--- a/Util/Makefile
+++ b/Util/Makefile
@@ -17,8 +17,8 @@ objects = AbstractConfiguration Application ConfigurationMapper \
Validator IntValidator RegExpValidator OptionCallback \
Timer TimerTask
-ifeq ($(POCO_CONFIG),MinGW)
- objects += WinService
+ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW)
+ objects += WinService WinRegistryKey WinRegistryConfiguration
endif
target = PocoUtil
diff --git a/Util/Util_vs100.sln b/Util/Util_vs100.sln
new file mode 100644
index 000000000..2cc064fe6
--- /dev/null
+++ b/Util/Util_vs100.sln
@@ -0,0 +1,60 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Util", "Util_vs100.vcxproj", "{6FF56CDB-787A-4714-A28C-919003F9FA6C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs100.vcxproj", "{E40E738C-447B-40F4-A878-EBA9A2459270}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C} = {6FF56CDB-787A-4714-A28C-919003F9FA6C}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|Win32 = debug_shared|Win32
+ release_shared|Win32 = release_shared|Win32
+ debug_static_mt|Win32 = debug_static_mt|Win32
+ release_static_mt|Win32 = release_static_mt|Win32
+ debug_static_md|Win32 = debug_static_md|Win32
+ release_static_md|Win32 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|Win32.Build.0 = release_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|Win32.Deploy.0 = release_shared|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|Win32.Build.0 = release_static_md|Win32
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|Win32.Build.0 = release_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|Win32.Deploy.0 = release_shared|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|Win32.Build.0 = release_static_md|Win32
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Util/Util_vs100.vcxproj b/Util/Util_vs100.vcxproj
new file mode 100644
index 000000000..2cc06c9ba
--- /dev/null
+++ b/Util/Util_vs100.vcxproj
@@ -0,0 +1,335 @@
+
+
+
+
+ debug_shared
+ Win32
+
+
+ debug_static_md
+ Win32
+
+
+ debug_static_mt
+ Win32
+
+
+ release_shared
+ Win32
+
+
+ release_static_md
+ Win32
+
+
+ release_static_mt
+ Win32
+
+
+
+ Util
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}
+ Util
+ Win32Proj
+
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ DynamicLibrary
+ MultiByte
+
+
+ DynamicLibrary
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ ..\bin\
+ obj\$(Configuration)\
+ true
+ ..\bin\
+ obj\$(Configuration)\
+ false
+ ..\lib\
+ obj\$(Configuration)\
+ ..\lib\
+ obj\$(Configuration)\
+ ..\lib\
+ obj\$(Configuration)\
+ ..\lib\
+ obj\$(Configuration)\
+ PocoUtild
+ PocoUtilmdd
+ PocoUtilmtd
+ PocoUtil
+ PocoUtilmd
+ PocoUtilmt
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;_USRDLL;Util_EXPORTS;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ %(AdditionalDependencies)
+ ..\bin\PocoUtild.dll
+ true
+ true
+ ..\bin\PocoUtild.pdb
+ ..\lib;%(AdditionalLibraryDirectories)
+ Console
+ ..\lib\PocoUtild.lib
+ MachineX86
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;_USRDLL;Util_EXPORTS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ %(AdditionalDependencies)
+ ..\bin\PocoUtil.dll
+ true
+ false
+ ..\lib;%(AdditionalLibraryDirectories)
+ Console
+ true
+ true
+ ..\lib\PocoUtil.lib
+ MachineX86
+
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+ true
+ true
+ true
+ true
+
+ ..\lib\PocoUtilmtd.pdb
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib\PocoUtilmtd.lib
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib\PocoUtilmt.lib
+
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ ..\lib\PocoUtilmdd.pdb
+ Level3
+ EditAndContinue
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib\PocoUtilmdd.lib
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ ..\lib\PocoUtilmd.pdb
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ %(AdditionalDependencies)
+ ..\lib\PocoUtilmd.lib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Util/Util_vs100.vcxproj.filters b/Util/Util_vs100.vcxproj.filters
new file mode 100644
index 000000000..abed39147
--- /dev/null
+++ b/Util/Util_vs100.vcxproj.filters
@@ -0,0 +1,243 @@
+
+
+
+
+ {954c077e-8502-46bc-9e5d-6a0a04b06ae5}
+
+
+ {62047649-cff2-455b-832b-4f24c8450686}
+
+
+ {7a61e44e-9f52-4d61-8a20-7801be6c418f}
+
+
+ {afe05a99-2fc5-4870-a9d6-bccc952c7941}
+
+
+ {f5216668-e437-405a-8173-76516ff92e2b}
+
+
+ {35479b58-5124-40d5-80ff-90a664723f4e}
+
+
+ {59c95c1c-32d1-4264-ae14-4ab7b401c7ca}
+
+
+ {e8e524a5-d5ad-4ab8-903d-3b63152654c5}
+
+
+ {9f526871-5507-4700-b8d2-89302cecba8c}
+
+
+ {99c33ea8-8190-4440-9dc8-0c52fc4a6ee6}
+
+
+ {98fcbd8b-b279-45db-aede-fbb752275716}
+
+
+ {065cc1cd-a7b9-4073-a10c-e72c1d4019a7}
+
+
+ {c291d0f9-0e77-4639-a339-b20f1ebc107a}
+
+
+ {bd042ee0-2586-412b-9307-d8adfb09aefe}
+
+
+ {57e16b61-e11c-4971-bbe0-9f24eca4cf03}
+
+
+ {65ff9757-304a-4e14-9398-ebd3c06df99f}
+
+
+ {351d998a-b239-4b6d-b413-94d75131df19}
+
+
+ {0aab477c-db25-4299-8948-3bda4732f00e}
+
+
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Windows\Header Files
+
+
+ Windows\Header Files
+
+
+ Windows\Header Files
+
+
+ Util\Header Files
+
+
+ Timer\Header Files
+
+
+ Timer\Header Files
+
+
+ Timer\Header Files
+
+
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Windows\Source Files
+
+
+ Windows\Source Files
+
+
+ Windows\Source Files
+
+
+ Timer\Source Files
+
+
+ Timer\Source Files
+
+
+
\ No newline at end of file
diff --git a/Util/Util_vs100.vcxproj.user b/Util/Util_vs100.vcxproj.user
new file mode 100644
index 000000000..ace9a86ac
--- /dev/null
+++ b/Util/Util_vs100.vcxproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Util/Util_x64_vs100.sln b/Util/Util_x64_vs100.sln
new file mode 100644
index 000000000..8a40d5397
--- /dev/null
+++ b/Util/Util_x64_vs100.sln
@@ -0,0 +1,60 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Util", "Util_x64_vs100.vcxproj", "{6FF56CDB-787A-4714-A28C-919003F9FA6C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_x64_vs100.vcxproj", "{E40E738C-447B-40F4-A878-EBA9A2459270}"
+ ProjectSection(ProjectDependencies) = postProject
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C} = {6FF56CDB-787A-4714-A28C-919003F9FA6C}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|x64 = debug_shared|x64
+ release_shared|x64 = release_shared|x64
+ debug_static_mt|x64 = debug_static_mt|x64
+ release_static_mt|x64 = release_static_mt|x64
+ debug_static_md|x64 = debug_static_md|x64
+ release_static_md|x64 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|x64.ActiveCfg = debug_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|x64.Build.0 = debug_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_shared|x64.Deploy.0 = debug_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|x64.ActiveCfg = release_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|x64.Build.0 = release_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_shared|x64.Deploy.0 = release_shared|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|x64.Build.0 = release_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|x64.Build.0 = debug_static_md|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|x64.ActiveCfg = release_static_md|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|x64.Build.0 = release_static_md|x64
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}.release_static_md|x64.Deploy.0 = release_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|x64.ActiveCfg = debug_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|x64.Build.0 = debug_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_shared|x64.Deploy.0 = debug_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|x64.ActiveCfg = release_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|x64.Build.0 = release_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_shared|x64.Deploy.0 = release_shared|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|x64.Build.0 = release_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|x64.Build.0 = debug_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|x64.ActiveCfg = release_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|x64.Build.0 = release_static_md|x64
+ {E40E738C-447B-40F4-A878-EBA9A2459270}.release_static_md|x64.Deploy.0 = release_static_md|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Util/Util_x64_vs100.vcxproj b/Util/Util_x64_vs100.vcxproj
new file mode 100644
index 000000000..a5798e923
--- /dev/null
+++ b/Util/Util_x64_vs100.vcxproj
@@ -0,0 +1,333 @@
+
+
+
+
+ debug_shared
+ x64
+
+
+ debug_static_md
+ x64
+
+
+ debug_static_mt
+ x64
+
+
+ release_shared
+ x64
+
+
+ release_static_md
+ x64
+
+
+ release_static_mt
+ x64
+
+
+
+ Util
+ {6FF56CDB-787A-4714-A28C-919003F9FA6C}
+ Util
+ Win32Proj
+
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ StaticLibrary
+ MultiByte
+
+
+ DynamicLibrary
+ MultiByte
+
+
+ DynamicLibrary
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ ..\bin64\
+ obj64\$(Configuration)\
+ true
+ ..\bin64\
+ obj64\$(Configuration)\
+ false
+ ..\lib64\
+ obj64\$(Configuration)\
+ ..\lib64\
+ obj64\$(Configuration)\
+ ..\lib64\
+ obj64\$(Configuration)\
+ ..\lib64\
+ obj64\$(Configuration)\
+ PocoUtil64d
+ PocoUtilmdd
+ PocoUtilmtd
+ PocoUtil64
+ PocoUtilmd
+ PocoUtilmt
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;_USRDLL;Util_EXPORTS;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ %(AdditionalDependencies)
+ ..\bin64\PocoUtil64d.dll
+ true
+ true
+ ..\bin64\PocoUtil64d.pdb
+ ..\lib64;%(AdditionalLibraryDirectories)
+ Console
+ ..\lib64\PocoUtild.lib
+ MachineX64
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;_USRDLL;Util_EXPORTS;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ %(AdditionalDependencies)
+ ..\bin64\PocoUtil64.dll
+ true
+ false
+ ..\lib64;%(AdditionalLibraryDirectories)
+ Console
+ true
+ true
+ ..\lib64\PocoUtil.lib
+ MachineX64
+
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+ true
+ true
+ true
+ true
+
+ ..\lib64\PocoUtilmtd.pdb
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib64\PocoUtilmtd.lib
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreaded
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib64\PocoUtilmt.lib
+
+
+
+
+ Disabled
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ true
+ EnableFastChecks
+ MultiThreadedDebugDLL
+ true
+ true
+ true
+ true
+
+ ..\lib64\PocoUtilmdd.pdb
+ Level3
+ ProgramDatabase
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib64\PocoUtilmdd.lib
+
+
+
+
+ Disabled
+ OnlyExplicitInline
+ true
+ Speed
+ true
+ .\include;..\Foundation\include;..\XML\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDLL
+ false
+ true
+ true
+ true
+
+ Level3
+
+ Default
+ %(DisableSpecificWarnings)
+
+
+ ..\lib64\PocoUtilmd.lib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Util/Util_x64_vs100.vcxproj.filters b/Util/Util_x64_vs100.vcxproj.filters
new file mode 100644
index 000000000..c3575e433
--- /dev/null
+++ b/Util/Util_x64_vs100.vcxproj.filters
@@ -0,0 +1,243 @@
+
+
+
+
+ {4b1ae9ef-1937-4b46-9f96-2e680732f8e7}
+
+
+ {10f72031-30dc-4d3e-8e95-0d89612a7597}
+
+
+ {24db6433-79cb-4dd7-be53-b4d8aeb81625}
+
+
+ {87fead74-6fcc-41a8-89f8-d47c9039c018}
+
+
+ {e2713bf4-89fd-442b-85c5-a43235aff8dc}
+
+
+ {842b8021-15a5-4d42-9c35-8ef63597dfc5}
+
+
+ {d8ae43e4-a6fd-4a35-8d6f-d7c7cf919504}
+
+
+ {79618ac5-b0d3-46ea-9fb1-ba6e7277bfbc}
+
+
+ {63fb0221-97a3-459a-9749-ae2e241652b2}
+
+
+ {a0b24249-ef36-4d7f-89f1-173834d41c04}
+
+
+ {b6b42389-24c9-43cb-be8b-48d81133de9e}
+
+
+ {bab0b542-c36a-4342-b29e-ca1b252fcdad}
+
+
+ {fbecdba3-e98d-4593-926e-7b6e2fc652bb}
+
+
+ {1363bf91-a15c-482e-bebb-19421b0d6125}
+
+
+ {957c8e7c-6f31-4ea6-9004-0d0b1b81bee8}
+
+
+ {f60b93b6-662c-49d6-8d9d-f3658d226a66}
+
+
+ {bc802df3-5da3-4228-9430-dc3a4a2a1487}
+
+
+ {12fe7d5c-dfac-40e2-8832-c9f3af7f1b2a}
+
+
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Application\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Configuration\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Options\Header Files
+
+
+ Windows\Header Files
+
+
+ Windows\Header Files
+
+
+ Windows\Header Files
+
+
+ Util\Header Files
+
+
+ Timer\Header Files
+
+
+ Timer\Header Files
+
+
+ Timer\Header Files
+
+
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Application\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Configuration\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Options\Source Files
+
+
+ Windows\Source Files
+
+
+ Windows\Source Files
+
+
+ Windows\Source Files
+
+
+ Timer\Source Files
+
+
+ Timer\Source Files
+
+
+
\ No newline at end of file
diff --git a/Util/Util_x64_vs100.vcxproj.user b/Util/Util_x64_vs100.vcxproj.user
new file mode 100644
index 000000000..ace9a86ac
--- /dev/null
+++ b/Util/Util_x64_vs100.vcxproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Util/include/Poco/Util/AbstractConfiguration.h b/Util/include/Poco/Util/AbstractConfiguration.h
index de1aa75a1..b0f6cc9f4 100644
--- a/Util/include/Poco/Util/AbstractConfiguration.h
+++ b/Util/include/Poco/Util/AbstractConfiguration.h
@@ -43,7 +43,9 @@
#include "Poco/Util/Util.h"
#include "Poco/Mutex.h"
#include "Poco/RefCountedObject.h"
+#include "Poco/BasicEvent.h"
#include
+#include
namespace Poco {
@@ -67,6 +69,62 @@ class Util_API AbstractConfiguration: public Poco::RefCountedObject
{
public:
typedef std::vector Keys;
+
+ class KeyValue
+ /// A key-value pair, used as event argument.
+ {
+ public:
+ KeyValue(const std::string& key, std::string& value):
+ _key(key),
+ _value(value)
+ {
+ }
+
+ const std::string& key() const
+ {
+ return _key;
+ }
+
+ const std::string& value() const
+ {
+ return _value;
+ }
+
+ std::string& value()
+ {
+ return _value;
+ }
+
+ private:
+ const std::string& _key;
+ std::string& _value;
+ };
+
+ Poco::BasicEvent propertyChanging;
+ /// Fired before a property value is changed or
+ /// a new property is created.
+ ///
+ /// Can be used to check or fix a property value,
+ /// or to cancel the change by throwing an exception.
+ ///
+ /// The event delegate can use one of the get...() functions
+ /// to obtain the current property value.
+
+ Poco::BasicEvent propertyChanged;
+ /// Fired after a property value has been changed
+ /// or a property has been created.
+
+ Poco::BasicEvent propertyRemoving;
+ /// Fired before a property is removed by a
+ /// call to remove().
+ ///
+ /// Note: This will even be fired if the key
+ /// does not exist and the remove operation will
+ /// fail with an exception.
+
+ Poco::BasicEvent propertyRemoved;
+ /// Fired after a property has been removed by
+ /// a call to remove().
AbstractConfiguration();
/// Creates the AbstractConfiguration.
@@ -76,6 +134,12 @@ public:
bool hasOption(const std::string& key) const;
/// Returns true iff the property with the given key exists.
+ ///
+ /// Same as hasProperty().
+
+ bool has(const std::string& key) const;
+ /// Returns true iff the property with the given key exists.
+ ///
/// Same as hasProperty().
std::string getString(const std::string& key) const;
@@ -135,15 +199,15 @@ public:
/// are expanded.
bool getBool(const std::string& key) const;
- /// Returns the double value of the property with the given name.
+ /// Returns the boolean value of the property with the given name.
/// Throws a NotFoundException if the key does not exist.
/// Throws a SyntaxException if the property can not be converted
- /// to a double.
+ /// to a boolean.
/// If the value contains references to other properties (${}), these
/// are expanded.
bool getBool(const std::string& key, bool defaultValue) const;
- /// If a property with the given key exists, returns the property's bool value,
+ /// If a property with the given key exists, returns the property's boolean value,
/// otherwise returns the given default value.
/// Throws a SyntaxException if the property can not be converted
/// to a boolean.
@@ -190,6 +254,11 @@ public:
///
/// If a circular property reference is detected, a
/// CircularReferenceException will be thrown.
+
+ void remove(const std::string& key);
+ /// Removes the property with the given key.
+ ///
+ /// Does nothing if the key does not exist.
protected:
virtual bool getRaw(const std::string& key, std::string& value) const = 0;
@@ -207,9 +276,18 @@ protected:
virtual void enumerate(const std::string& key, Keys& range) const = 0;
/// Returns in range the names of all subkeys under the given key.
/// If an empty key is passed, all root level keys are returned.
+
+ virtual void removeRaw(const std::string& key);
+ /// Removes the property with the given key.
+ ///
+ /// Does nothing if the key does not exist.
+ ///
+ /// Should be overridden by subclasses; the default
+ /// implementation throws a Poco::NotImplementedException.
static int parseInt(const std::string& value);
static bool parseBool(const std::string& value);
+ void setRawWithEvent(const std::string& key, std::string value);
virtual ~AbstractConfiguration();
diff --git a/Util/include/Poco/Util/Application.h b/Util/include/Poco/Util/Application.h
index 17a6812d0..d6e2bc9a9 100644
--- a/Util/include/Poco/Util/Application.h
+++ b/Util/include/Poco/Util/Application.h
@@ -1,7 +1,7 @@
//
// Application.h
//
-// $Id: //poco/Main/Util/include/Poco/Util/Application.h#17 $
+// $Id: //poco/1.4/Util/include/Poco/Util/Application.h#2 $
//
// Library: Util
// Package: Application
@@ -50,6 +50,9 @@
#include "Poco/Timestamp.h"
#include "Poco/Timespan.h"
#include "Poco/AutoPtr.h"
+#if defined(POCO_VXWORKS)
+#include
+#endif
#include
#include
@@ -145,21 +148,33 @@ public:
/// is okay.
void init(int argc, char* argv[]);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
+ /// Processes the application's command line arguments
+ /// and sets the application's properties (e.g.,
+ /// "application.path", "application.name", etc.).
+ ///
+ /// Note that as of release 1.3.7, init() no longer
+ /// calls initialize(). This is now called from run().
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
void init(int argc, wchar_t* argv[]);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
+ /// Processes the application's command line arguments
+ /// and sets the application's properties (e.g.,
+ /// "application.path", "application.name", etc.).
+ ///
+ /// Note that as of release 1.3.7, init() no longer
+ /// calls initialize(). This is now called from run().
///
/// This Windows-specific version of init is used for passing
/// Unicode command line arguments from wmain().
#endif
void init(const std::vector& args);
- /// Initializes the application and all registered subsystems,
- /// using the given command line arguments.
+ /// Processes the application's command line arguments
+ /// and sets the application's properties (e.g.,
+ /// "application.path", "application.name", etc.).
+ ///
+ /// Note that as of release 1.3.7, init() no longer
+ /// calls initialize(). This is now called from run().
bool initialized() const;
/// Returns true iff the application is in initialized state
@@ -195,13 +210,13 @@ public:
/// Then loadConfiguration() will automatically find a configuration file
/// named "SampleApp.properties" if it exists and if "SampleAppd.properties"
/// cannot be found.
- ///
- /// Returns the number of configuration files loaded, which may be zero.
- ///
- /// This method must not be called before initialize(argc, argv)
- /// has been called.
+ ///
+ /// Returns the number of configuration files loaded, which may be zero.
+ ///
+ /// This method must not be called before init(argc, argv)
+ /// has been called.
- void loadConfiguration(const std::string& path, int priority = PRIO_DEFAULT);
+ void loadConfiguration(const std::string& path, int priority = PRIO_DEFAULT);
/// Loads configuration information from the file specified by
/// the given path. The file type is determined by the file
/// extension. The following extensions are supported:
@@ -210,13 +225,12 @@ public:
/// - .xml - XML file (XMLConfiguration)
///
/// Extensions are not case sensitive.
- ///
- /// The configuration will be added to the application's
- /// LayeredConfiguration with the given priority.
- ///
+ ///
+ /// The configuration will be added to the application's
+ /// LayeredConfiguration with the given priority.
- template C& getSubsystem() const;
- /// Returns a reference to the subsystem of the class
+ template C& getSubsystem() const;
+ /// Returns a reference to the subsystem of the class
/// given as template argument.
///
/// Throws a NotFoundException if such a subsystem has
@@ -225,6 +239,12 @@ public:
virtual int run();
/// Runs the application by performing additional initializations
/// and calling the main() method.
+ ///
+ /// First calls initialize(), then calls main(), and
+ /// finally calls uninitialize(). The latter will be called
+ /// even if main() throws an exception. If initialize() throws
+ /// an exception, main() will not be called and the exception
+ /// will be propagated to the caller.
std::string commandName() const;
/// Returns the command name used to invoke the application.
@@ -365,12 +385,16 @@ private:
OptionSet _options;
bool _unixOptions;
Poco::Logger* _pLogger;
- Poco::Timestamp _startTime;
- bool _stopOptionsProcessing;
+ Poco::Timestamp _startTime;
+ bool _stopOptionsProcessing;
- static Application* _pInstance;
-
- friend class LoggingSubsystem;
+#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
+ std::string _workingDirAtLaunch;
+#endif
+
+ static Application* _pInstance;
+
+ friend class LoggingSubsystem;
Application(const Application&);
Application& operator = (const Application&);
@@ -446,9 +470,9 @@ inline Poco::Timespan Application::uptime() const
// Macro to implement main()
//
#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) && !defined(MINGW32)
- #define POCO_APP_MAIN(App) \
- int wmain(int argc, wchar_t** argv) \
- { \
+ #define POCO_APP_MAIN(App) \
+ int wmain(int argc, wchar_t** argv) \
+ { \
Poco::AutoPtr pApp = new App; \
try \
{ \
@@ -461,6 +485,33 @@ inline Poco::Timespan Application::uptime() const
} \
return pApp->run(); \
}
+#elif defined(POCO_VXWORKS)
+ #define POCO_APP_MAIN(App) \
+ int pocoAppMain(const char* appName, ...) \
+ { \
+ std::vector args; \
+ args.push_back(std::string(appName)); \
+ va_list vargs; \
+ va_start(vargs, appName); \
+ const char* arg = va_arg(vargs, const char*); \
+ while (arg) \
+ { \
+ args.push_back(std::string(arg)); \
+ arg = va_arg(vargs, const char*); \
+ } \
+ va_end(vargs); \
+ Poco::AutoPtr pApp = new App; \
+ try \
+ { \
+ pApp->init(args); \
+ } \
+ catch (Poco::Exception& exc) \
+ { \
+ pApp->logger().log(exc); \
+ return Poco::Util::Application::EXIT_CONFIG;\
+ } \
+ return pApp->run(); \
+ }
#else
#define POCO_APP_MAIN(App) \
int main(int argc, char** argv) \
diff --git a/Util/include/Poco/Util/ConfigurationMapper.h b/Util/include/Poco/Util/ConfigurationMapper.h
index 9dedd97ee..4c1aa50f3 100644
--- a/Util/include/Poco/Util/ConfigurationMapper.h
+++ b/Util/include/Poco/Util/ConfigurationMapper.h
@@ -94,6 +94,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
std::string translateKey(const std::string& key) const;
diff --git a/Util/include/Poco/Util/ConfigurationView.h b/Util/include/Poco/Util/ConfigurationView.h
index 603edff68..eb0053472 100644
--- a/Util/include/Poco/Util/ConfigurationView.h
+++ b/Util/include/Poco/Util/ConfigurationView.h
@@ -83,6 +83,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
std::string translateKey(const std::string& key) const;
diff --git a/Util/include/Poco/Util/FilesystemConfiguration.h b/Util/include/Poco/Util/FilesystemConfiguration.h
index d149e33df..7a7fb71a9 100644
--- a/Util/include/Poco/Util/FilesystemConfiguration.h
+++ b/Util/include/Poco/Util/FilesystemConfiguration.h
@@ -100,6 +100,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
Poco::Path keyToPath(const std::string& key) const;
~FilesystemConfiguration();
diff --git a/Util/include/Poco/Util/IniFileConfiguration.h b/Util/include/Poco/Util/IniFileConfiguration.h
index e83862f76..22537c7a1 100644
--- a/Util/include/Poco/Util/IniFileConfiguration.h
+++ b/Util/include/Poco/Util/IniFileConfiguration.h
@@ -93,6 +93,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
~IniFileConfiguration();
private:
diff --git a/Util/include/Poco/Util/LayeredConfiguration.h b/Util/include/Poco/Util/LayeredConfiguration.h
index f92714d43..3b89abc81 100644
--- a/Util/include/Poco/Util/LayeredConfiguration.h
+++ b/Util/include/Poco/Util/LayeredConfiguration.h
@@ -127,6 +127,12 @@ public:
/// If shared is true, the LayeredConfiguration takes ownership
/// of the given configuration.
+ void removeConfiguration(AbstractConfiguration* pConfig);
+ /// Removes the given configuration from the LayeredConfiguration.
+ ///
+ /// Does nothing if the given configuration is not part of the
+ /// LayeredConfiguration.
+
protected:
typedef Poco::AutoPtr ConfigPtr;
@@ -140,6 +146,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
int lowest() const;
int highest() const;
diff --git a/Util/include/Poco/Util/MapConfiguration.h b/Util/include/Poco/Util/MapConfiguration.h
index d8dae8881..168288b28 100644
--- a/Util/include/Poco/Util/MapConfiguration.h
+++ b/Util/include/Poco/Util/MapConfiguration.h
@@ -66,6 +66,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
~MapConfiguration();
iterator begin() const;
diff --git a/Util/include/Poco/Util/ServerApplication.h b/Util/include/Poco/Util/ServerApplication.h
index 63250d18d..302e740d2 100644
--- a/Util/include/Poco/Util/ServerApplication.h
+++ b/Util/include/Poco/Util/ServerApplication.h
@@ -43,6 +43,9 @@
#include "Poco/Util/Util.h"
#include "Poco/Util/Application.h"
#include "Poco/Event.h"
+#if defined(POCO_OS_FAMILY_WINDOWS)
+#include "Poco/NamedEvent.h"
+#endif
namespace Poco {
@@ -64,6 +67,12 @@ class Util_API ServerApplication: public Application
/// initialize() method.
/// - At the end of the main() method, waitForTerminationRequest()
/// should be called.
+ /// - New threads must only be created in initialize() or main() or
+ /// methods called from there, but not in the application class'
+ /// constructor or in the constructor of instance variables.
+ /// The reason for this is that fork() will be called in order to
+ /// create the daemon process, and threads created prior to calling
+ /// fork() won't be taken over to the daemon process.
/// - The main(argc, argv) function must look as follows:
///
/// int main(int argc, char** argv)
@@ -85,11 +94,14 @@ class Util_API ServerApplication: public Application
/// can be started from the command line, with the /registerService option
/// specified. This causes the application to register itself with the
/// SCM, and then exit. Similarly, an application registered as a service can
- /// be unregistered, by specifying the /unregisterService option.
- /// The file name of the application executable (excluding the .exe suffix)
- /// is used as the service name. Additionally, a more user-friendly name can be
- /// specified, using the /displayName option (e.g., /displayName="Demo Service").
- ///
+ /// be unregistered, by specifying the /unregisterService option.
+ /// The file name of the application executable (excluding the .exe suffix)
+ /// is used as the service name. Additionally, a more user-friendly name can be
+ /// specified, using the /displayName option (e.g., /displayName="Demo Service")
+ /// and a service description can be added with the /description option.
+ /// The startup mode (automatic or manual) for the service can be specified
+ /// with the /startup option.
+ ///
/// An application can determine whether it is running as a service by checking
/// for the "application.runAsService" configuration property.
///
@@ -149,6 +161,10 @@ public:
int run(int argc, char** argv);
/// Runs the application by performing additional initializations
/// and calling the main() method.
+
+ int run(const std::vector& args);
+ /// Runs the application by performing additional initializations
+ /// and calling the main() method.
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
int run(int argc, wchar_t** argv);
@@ -159,18 +175,29 @@ public:
/// Unicode command line arguments from wmain().
#endif
+ static void terminate();
+ /// Sends a friendly termination request to the application.
+ /// If the application's main thread is waiting in
+ /// waitForTerminationRequest(), this method will return
+ /// and the application can shut down.
+
protected:
int run();
void waitForTerminationRequest();
+#if !defined(_WIN32_WCE)
void defineOptions(OptionSet& options);
- void handleOption(const std::string& name, const std::string& value);
- static void terminate();
+#endif
private:
-#if defined(POCO_OS_FAMILY_UNIX)
+#if defined(POCO_VXWORKS)
+ static Poco::Event _terminate;
+#elif defined(POCO_OS_FAMILY_UNIX)
+ void handleDaemon(const std::string& name, const std::string& value);
+ void handlePidFile(const std::string& name, const std::string& value);
bool isDaemon(int argc, char** argv);
void beDaemon();
#elif defined(POCO_OS_FAMILY_WINDOWS)
+#if !defined(_WIN32_WCE)
enum Action
{
SRV_RUN,
@@ -190,13 +217,22 @@ private:
void beService();
void registerService();
void unregisterService();
-
- Action _action;
- std::string _displayName;
+ void handleRegisterService(const std::string& name, const std::string& value);
+ void handleUnregisterService(const std::string& name, const std::string& value);
+ void handleDisplayName(const std::string& name, const std::string& value);
+ void handleDescription(const std::string& name, const std::string& value);
+ void handleStartup(const std::string& name, const std::string& value);
+
+ Action _action;
+ std::string _displayName;
+ std::string _description;
+ std::string _startup;
- static Poco::Event _terminated;
+ static Poco::Event _terminated;
static SERVICE_STATUS _serviceStatus;
static SERVICE_STATUS_HANDLE _serviceStatusHandle;
+#endif // _WIN32_WCE
+ static Poco::NamedEvent _terminate;
#endif
};
@@ -207,13 +243,31 @@ private:
//
// Macro to implement main()
//
-#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(MINGW32)
+#if defined(_WIN32) && defined(POCO_WIN32_UTF8)
#define POCO_SERVER_MAIN(App) \
int wmain(int argc, wchar_t** argv) \
{ \
App app; \
return app.run(argc, argv); \
}
+#elif defined(POCO_VXWORKS)
+ #define POCO_SERVER_MAIN(App) \
+ int pocoSrvMain(const char* appName, ...) \
+ { \
+ std::vector args; \
+ args.push_back(std::string(appName)); \
+ va_list vargs; \
+ va_start(vargs, appName); \
+ const char* arg = va_arg(vargs, const char*); \
+ while (arg) \
+ { \
+ args.push_back(std::string(arg)); \
+ arg = va_arg(vargs, const char*); \
+ } \
+ va_end(vargs); \
+ App app; \
+ return app.run(args); \
+ }
#else
#define POCO_SERVER_MAIN(App) \
int main(int argc, char** argv) \
diff --git a/Util/include/Poco/Util/SystemConfiguration.h b/Util/include/Poco/Util/SystemConfiguration.h
index b631a1591..82603520a 100644
--- a/Util/include/Poco/Util/SystemConfiguration.h
+++ b/Util/include/Poco/Util/SystemConfiguration.h
@@ -57,6 +57,8 @@ class Util_API SystemConfiguration: public AbstractConfiguration
/// - system.osVersion: the operating system version
/// - system.osArchitecture: the operating system architecture
/// - system.nodeName: the node (or host) name
+ /// - system.nodeId: system ID, based on the Ethernet address (format "xxxxxxxxxxxx")
+ /// of the first Ethernet adapter found on the system.
/// - system.currentDir: the current working directory
/// - system.homeDir: the user's home directory
/// - system.tempDir: the system's temporary directory
@@ -69,6 +71,9 @@ class Util_API SystemConfiguration: public AbstractConfiguration
///
/// Enumerating environment variables is not supported.
/// An attempt to call keys("system.env") will return an empty range.
+ ///
+ /// Removing key is not supported. An attempt to remove a key results
+ /// in a NotImplementedException being thrown.
{
public:
SystemConfiguration();
@@ -78,6 +83,7 @@ protected:
bool getRaw(const std::string& key, std::string& value) const;
void setRaw(const std::string& key, const std::string& value);
void enumerate(const std::string& key, Keys& range) const;
+ void removeRaw(const std::string& key);
~SystemConfiguration();
private:
@@ -87,11 +93,14 @@ private:
static const std::string OSVERSION;
static const std::string OSARCHITECTURE;
static const std::string NODENAME;
+ static const std::string NODEID;
static const std::string CURRENTDIR;
static const std::string HOMEDIR;
static const std::string TEMPDIR;
static const std::string DATETIME;
+#if !defined(POCO_VXWORKS)
static const std::string PID;
+#endif
static const std::string ENV;
};
diff --git a/Util/include/Poco/Util/Timer.h b/Util/include/Poco/Util/Timer.h
index 06f7ab62b..9e9640433 100644
--- a/Util/include/Poco/Util/Timer.h
+++ b/Util/include/Poco/Util/Timer.h
@@ -1,140 +1,146 @@
-//
-// Timer.h
-//
-// $Id: //poco/Main/Util/include/Poco/Util/Timer.h#1 $
-//
-// Library: Util
-// Package: Timer
-// Module: Timer
-//
-// Definition of the Timer class.
-//
-// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
-// and Contributors.
-//
-// Permission is hereby granted, free of charge, to any person or organization
-// obtaining a copy of the software and accompanying documentation covered by
-// this license (the "Software") to use, reproduce, display, distribute,
-// execute, and transmit the Software, and to prepare derivative works of the
-// Software, and to permit third-parties to whom the Software is furnished to
-// do so, all subject to the following:
-//
-// The copyright notices in the Software and this entire statement, including
-// the above license grant, this restriction and the following disclaimer,
-// must be included in all copies of the Software, in whole or in part, and
-// all derivative works of the Software, unless such copies or derivative
-// works are solely in the form of machine-executable object code generated by
-// a source language processor.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-
-
-#ifndef Util_Timer_INCLUDED
-#define Util_Timer_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/TimerTask.h"
-#include "Poco/TimedNotificationQueue.h"
-#include "Poco/Thread.h"
-#include "Poco/Runnable.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API Timer: protected Poco::Runnable
- /// A Timer allows to schedule tasks (TimerTask objects) for future execution
- /// in a background thread. Tasks may be scheduled for one-time execution,
- /// or for repeated execution at regular intervals.
- ///
- /// The Timer object creates a thread that executes all scheduled tasks
- /// sequentially. Therefore, tasks should complete their work as quickly
- /// as possible, otherwise subsequent tasks may be delayed.
- ///
- /// Timer is save for multithreaded use - multiple threads can schedule
- /// new tasks simultaneously.
- ///
- /// Acknowledgement: The interface of this class has been inspired by
- /// the java.util.Timer class from Java 1.3.
-{
-public:
- Timer();
- /// Creates the Timer.
-
- explicit Timer(Poco::Thread::Priority priority);
- /// Creates the Timer, using a timer thread with
- /// the given priority.
-
- ~Timer();
- /// Destroys the Timer, cancelling all pending tasks.
-
- void cancel();
- /// Cancels all pending tasks.
- ///
- /// If a task is currently running, it is allowed to finish.
-
- void schedule(TimerTask::Ptr pTask, Poco::Timestamp time);
- /// Schedules a task for execution at the specified time.
- ///
- /// If the time lies in the past, the task is executed
- /// immediately.
-
- void schedule(TimerTask::Ptr pTask, long delay, long interval);
- /// Schedules a task for periodic execution.
- ///
- /// The task is first executed after the given delay.
- /// Subsequently, the task is executed periodically with
- /// the given interval in milliseconds between invocations.
-
- void schedule(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
- /// Schedules a task for periodic execution.
- ///
- /// The task is first executed at the given time.
- /// Subsequently, the task is executed periodically with
- /// the given interval in milliseconds between invocations.
-
- void scheduleAtFixedRate(TimerTask::Ptr pTask, long delay, long interval);
- /// Schedules a task for periodic execution at a fixed rate.
- ///
- /// The task is first executed after the given delay.
- /// Subsequently, the task is executed periodically
- /// every number of milliseconds specified by interval.
- ///
- /// If task execution takes longer than the given interval,
- /// further executions are delayed.
-
- void scheduleAtFixedRate(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
- /// Schedules a task for periodic execution at a fixed rate.
- ///
- /// The task is first executed at the given time.
- /// Subsequently, the task is executed periodically
- /// every number of milliseconds specified by interval.
- ///
- /// If task execution takes longer than the given interval,
- /// further executions are delayed.
-
-protected:
- void run();
-
-private:
- Timer(const Timer&);
- Timer& operator = (const Timer&);
-
- Poco::TimedNotificationQueue _queue;
- Poco::Thread _thread;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_Timer_INCLUDED
+//
+// Timer.h
+//
+// $Id: //poco/1.4/Util/include/Poco/Util/Timer.h#1 $
+//
+// Library: Util
+// Package: Timer
+// Module: Timer
+//
+// Definition of the Timer class.
+//
+// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// Permission is hereby granted, free of charge, to any person or organization
+// obtaining a copy of the software and accompanying documentation covered by
+// this license (the "Software") to use, reproduce, display, distribute,
+// execute, and transmit the Software, and to prepare derivative works of the
+// Software, and to permit third-parties to whom the Software is furnished to
+// do so, all subject to the following:
+//
+// The copyright notices in the Software and this entire statement, including
+// the above license grant, this restriction and the following disclaimer,
+// must be included in all copies of the Software, in whole or in part, and
+// all derivative works of the Software, unless such copies or derivative
+// works are solely in the form of machine-executable object code generated by
+// a source language processor.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+//
+
+
+#ifndef Util_Timer_INCLUDED
+#define Util_Timer_INCLUDED
+
+
+#include "Poco/Util/Util.h"
+#include "Poco/Util/TimerTask.h"
+#include "Poco/TimedNotificationQueue.h"
+#include "Poco/Thread.h"
+#include "Poco/Runnable.h"
+
+
+namespace Poco {
+namespace Util {
+
+
+class Util_API Timer: protected Poco::Runnable
+ /// A Timer allows to schedule tasks (TimerTask objects) for future execution
+ /// in a background thread. Tasks may be scheduled for one-time execution,
+ /// or for repeated execution at regular intervals.
+ ///
+ /// The Timer object creates a thread that executes all scheduled tasks
+ /// sequentially. Therefore, tasks should complete their work as quickly
+ /// as possible, otherwise subsequent tasks may be delayed.
+ ///
+ /// Timer is save for multithreaded use - multiple threads can schedule
+ /// new tasks simultaneously.
+ ///
+ /// Acknowledgement: The interface of this class has been inspired by
+ /// the java.util.Timer class from Java 1.3.
+{
+public:
+ Timer();
+ /// Creates the Timer.
+
+ explicit Timer(Poco::Thread::Priority priority);
+ /// Creates the Timer, using a timer thread with
+ /// the given priority.
+
+ ~Timer();
+ /// Destroys the Timer, cancelling all pending tasks.
+
+ void cancel(bool wait = false);
+ /// Cancels all pending tasks.
+ ///
+ /// If a task is currently running, it is allowed to finish.
+ ///
+ /// Task cancellation is done asynchronously. If wait
+ /// is false, cancel() returns immediately and the
+ /// task queue will be purged as soon as the currently
+ /// running task finishes. If wait is true, waits
+ /// until the queue has been purged.
+
+ void schedule(TimerTask::Ptr pTask, Poco::Timestamp time);
+ /// Schedules a task for execution at the specified time.
+ ///
+ /// If the time lies in the past, the task is executed
+ /// immediately.
+
+ void schedule(TimerTask::Ptr pTask, long delay, long interval);
+ /// Schedules a task for periodic execution.
+ ///
+ /// The task is first executed after the given delay.
+ /// Subsequently, the task is executed periodically with
+ /// the given interval in milliseconds between invocations.
+
+ void schedule(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
+ /// Schedules a task for periodic execution.
+ ///
+ /// The task is first executed at the given time.
+ /// Subsequently, the task is executed periodically with
+ /// the given interval in milliseconds between invocations.
+
+ void scheduleAtFixedRate(TimerTask::Ptr pTask, long delay, long interval);
+ /// Schedules a task for periodic execution at a fixed rate.
+ ///
+ /// The task is first executed after the given delay.
+ /// Subsequently, the task is executed periodically
+ /// every number of milliseconds specified by interval.
+ ///
+ /// If task execution takes longer than the given interval,
+ /// further executions are delayed.
+
+ void scheduleAtFixedRate(TimerTask::Ptr pTask, Poco::Timestamp time, long interval);
+ /// Schedules a task for periodic execution at a fixed rate.
+ ///
+ /// The task is first executed at the given time.
+ /// Subsequently, the task is executed periodically
+ /// every number of milliseconds specified by interval.
+ ///
+ /// If task execution takes longer than the given interval,
+ /// further executions are delayed.
+
+protected:
+ void run();
+
+private:
+ Timer(const Timer&);
+ Timer& operator = (const Timer&);
+
+ Poco::TimedNotificationQueue _queue;
+ Poco::Thread _thread;
+};
+
+
+} } // namespace Poco::Util
+
+
+#endif // Util_Timer_INCLUDED
diff --git a/Util/include/Poco/Util/TimerTask.h b/Util/include/Poco/Util/TimerTask.h
index 3cf94eddb..529afe302 100644
--- a/Util/include/Poco/Util/TimerTask.h
+++ b/Util/include/Poco/Util/TimerTask.h
@@ -1,117 +1,117 @@
-//
-// TimerTask.h
-//
-// $Id: //poco/Main/Util/include/Poco/Util/TimerTask.h#1 $
-//
-// Library: Util
-// Package: Timer
-// Module: TimerTask
-//
-// Definition of the TimerTask class.
-//
-// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
-// and Contributors.
-//
-// Permission is hereby granted, free of charge, to any person or organization
-// obtaining a copy of the software and accompanying documentation covered by
-// this license (the "Software") to use, reproduce, display, distribute,
-// execute, and transmit the Software, and to prepare derivative works of the
-// Software, and to permit third-parties to whom the Software is furnished to
-// do so, all subject to the following:
-//
-// The copyright notices in the Software and this entire statement, including
-// the above license grant, this restriction and the following disclaimer,
-// must be included in all copies of the Software, in whole or in part, and
-// all derivative works of the Software, unless such copies or derivative
-// works are solely in the form of machine-executable object code generated by
-// a source language processor.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-
-
-#ifndef Util_TimerTask_INCLUDED
-#define Util_TimerTask_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Runnable.h"
-#include "Poco/RefCountedObject.h"
-#include "Poco/AutoPtr.h"
-#include "Poco/Timestamp.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-class Util_API TimerTask: public Poco::RefCountedObject, public Poco::Runnable
- /// A task that can be scheduled for one-time or
- /// repeated execution by a Timer.
- ///
- /// This is an abstract class. Subclasses must override the run() member
- /// function to implement the actual task logic.
-{
-public:
- typedef Poco::AutoPtr Ptr;
-
- TimerTask();
- /// Creates the TimerTask.
-
- void cancel();
- /// Cancels the execution of the timer.
- /// If the task has been scheduled for one-time execution and has
- /// not yet run, or has not yet been scheduled, it will never run.
- /// If the task has been scheduled for repeated execution, it will never
- /// run again. If the task is running when this call occurs, the task
- /// will run to completion, but will never run again.
-
- bool isCancelled() const;
- /// Returns true iff the TimerTask has been cancelled by a call
- /// to cancel().
-
- Poco::Timestamp lastExecution() const;
- /// Returns the time of the last execution of the timer task.
- ///
- /// Returns 0 if the timer has never been executed.
-
-protected:
- ~TimerTask();
- /// Destroys the TimerTask.
-
-private:
- TimerTask(const TimerTask&);
- TimerTask& operator = (const TimerTask&);
-
- Poco::Timestamp _lastExecution;
- bool _isCancelled;
-
- friend class TaskNotification;
-};
-
-
-//
-// inlines
-//
-inline bool TimerTask::isCancelled() const
-{
- return _isCancelled;
-}
-
-
-inline Poco::Timestamp TimerTask::lastExecution() const
-{
- return _lastExecution;
-}
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_TimerTask_INCLUDED
+//
+// TimerTask.h
+//
+// $Id: //poco/1.4/Util/include/Poco/Util/TimerTask.h#1 $
+//
+// Library: Util
+// Package: Timer
+// Module: TimerTask
+//
+// Definition of the TimerTask class.
+//
+// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// Permission is hereby granted, free of charge, to any person or organization
+// obtaining a copy of the software and accompanying documentation covered by
+// this license (the "Software") to use, reproduce, display, distribute,
+// execute, and transmit the Software, and to prepare derivative works of the
+// Software, and to permit third-parties to whom the Software is furnished to
+// do so, all subject to the following:
+//
+// The copyright notices in the Software and this entire statement, including
+// the above license grant, this restriction and the following disclaimer,
+// must be included in all copies of the Software, in whole or in part, and
+// all derivative works of the Software, unless such copies or derivative
+// works are solely in the form of machine-executable object code generated by
+// a source language processor.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+//
+
+
+#ifndef Util_TimerTask_INCLUDED
+#define Util_TimerTask_INCLUDED
+
+
+#include "Poco/Util/Util.h"
+#include "Poco/Runnable.h"
+#include "Poco/RefCountedObject.h"
+#include "Poco/AutoPtr.h"
+#include "Poco/Timestamp.h"
+
+
+namespace Poco {
+namespace Util {
+
+
+class Util_API TimerTask: public Poco::RefCountedObject, public Poco::Runnable
+ /// A task that can be scheduled for one-time or
+ /// repeated execution by a Timer.
+ ///
+ /// This is an abstract class. Subclasses must override the run() member
+ /// function to implement the actual task logic.
+{
+public:
+ typedef Poco::AutoPtr Ptr;
+
+ TimerTask();
+ /// Creates the TimerTask.
+
+ void cancel();
+ /// Cancels the execution of the timer.
+ /// If the task has been scheduled for one-time execution and has
+ /// not yet run, or has not yet been scheduled, it will never run.
+ /// If the task has been scheduled for repeated execution, it will never
+ /// run again. If the task is running when this call occurs, the task
+ /// will run to completion, but will never run again.
+
+ bool isCancelled() const;
+ /// Returns true iff the TimerTask has been cancelled by a call
+ /// to cancel().
+
+ Poco::Timestamp lastExecution() const;
+ /// Returns the time of the last execution of the timer task.
+ ///
+ /// Returns 0 if the timer has never been executed.
+
+protected:
+ ~TimerTask();
+ /// Destroys the TimerTask.
+
+private:
+ TimerTask(const TimerTask&);
+ TimerTask& operator = (const TimerTask&);
+
+ Poco::Timestamp _lastExecution;
+ bool _isCancelled;
+
+ friend class TaskNotification;
+};
+
+
+//
+// inlines
+//
+inline bool TimerTask::isCancelled() const
+{
+ return _isCancelled;
+}
+
+
+inline Poco::Timestamp TimerTask::lastExecution() const
+{
+ return _lastExecution;
+}
+
+
+} } // namespace Poco::Util
+
+
+#endif // Util_TimerTask_INCLUDED
diff --git a/Util/include/Poco/Util/TimerTaskAdapter.h b/Util/include/Poco/Util/TimerTaskAdapter.h
index 59bd35469..2ddab6138 100644
--- a/Util/include/Poco/Util/TimerTaskAdapter.h
+++ b/Util/include/Poco/Util/TimerTaskAdapter.h
@@ -1,91 +1,91 @@
-//
-// TimerTaskAdapter.h
-//
-// $Id: //poco/Main/Util/include/Poco/Util/TimerTaskAdapter.h#1 $
-//
-// Library: Util
-// Package: Timer
-// Module: TimerTaskAdapter
-//
-// Definition of the TimerTaskAdapter class template.
-//
-// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
-// and Contributors.
-//
-// Permission is hereby granted, free of charge, to any person or organization
-// obtaining a copy of the software and accompanying documentation covered by
-// this license (the "Software") to use, reproduce, display, distribute,
-// execute, and transmit the Software, and to prepare derivative works of the
-// Software, and to permit third-parties to whom the Software is furnished to
-// do so, all subject to the following:
-//
-// The copyright notices in the Software and this entire statement, including
-// the above license grant, this restriction and the following disclaimer,
-// must be included in all copies of the Software, in whole or in part, and
-// all derivative works of the Software, unless such copies or derivative
-// works are solely in the form of machine-executable object code generated by
-// a source language processor.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-
-
-#ifndef Util_TimerTaskAdapter_INCLUDED
-#define Util_TimerTaskAdapter_INCLUDED
-
-
-#include "Poco/Util/Util.h"
-#include "Poco/Util/TimerTask.h"
-
-
-namespace Poco {
-namespace Util {
-
-
-template
-class TimerTaskAdapter: public TimerTask
- /// This class template simplifies the implementation
- /// of TimerTask objects by allowing a member function
- /// of an object to be called as task.
-{
-public:
- typedef void (C::*Callback)(TimerTask&);
-
- TimerTaskAdapter(C& object, Callback method): _pObject(&object), _method(method)
- /// Creates the TimerTaskAdapter, using the given
- /// object and its member function as task target.
- ///
- /// The member function must accept one argument,
- /// a reference to a TimerTask object.
- {
- }
-
- void run()
- {
- (_pObject->*_method)(*this);
- }
-
-protected:
- ~TimerTaskAdapter()
- /// Destroys the TimerTaskAdapter.
- {
- }
-
-private:
- TimerTaskAdapter();
-
- C* _pObject;
- Callback _method;
-};
-
-
-} } // namespace Poco::Util
-
-
-#endif // Util_TimerTaskAdapter_INCLUDED
+//
+// TimerTaskAdapter.h
+//
+// $Id: //poco/1.4/Util/include/Poco/Util/TimerTaskAdapter.h#1 $
+//
+// Library: Util
+// Package: Timer
+// Module: TimerTaskAdapter
+//
+// Definition of the TimerTaskAdapter class template.
+//
+// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// Permission is hereby granted, free of charge, to any person or organization
+// obtaining a copy of the software and accompanying documentation covered by
+// this license (the "Software") to use, reproduce, display, distribute,
+// execute, and transmit the Software, and to prepare derivative works of the
+// Software, and to permit third-parties to whom the Software is furnished to
+// do so, all subject to the following:
+//
+// The copyright notices in the Software and this entire statement, including
+// the above license grant, this restriction and the following disclaimer,
+// must be included in all copies of the Software, in whole or in part, and
+// all derivative works of the Software, unless such copies or derivative
+// works are solely in the form of machine-executable object code generated by
+// a source language processor.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+//
+
+
+#ifndef Util_TimerTaskAdapter_INCLUDED
+#define Util_TimerTaskAdapter_INCLUDED
+
+
+#include "Poco/Util/Util.h"
+#include "Poco/Util/TimerTask.h"
+
+
+namespace Poco {
+namespace Util {
+
+
+template
+class TimerTaskAdapter: public TimerTask
+ /// This class template simplifies the implementation
+ /// of TimerTask objects by allowing a member function
+ /// of an object to be called as task.
+{
+public:
+ typedef void (C::*Callback)(TimerTask&);
+
+ TimerTaskAdapter(C& object, Callback method): _pObject(&object), _method(method)
+ /// Creates the TimerTaskAdapter, using the given
+ /// object and its member function as task target.
+ ///
+ /// The member function must accept one argument,
+ /// a reference to a TimerTask object.
+ {
+ }
+
+ void run()
+ {
+ (_pObject->*_method)(*this);
+ }
+
+protected:
+ ~TimerTaskAdapter()
+ /// Destroys the TimerTaskAdapter.
+ {
+ }
+
+private:
+ TimerTaskAdapter();
+
+ C* _pObject;
+ Callback _method;
+};
+
+
+} } // namespace Poco::Util
+
+
+#endif // Util_TimerTaskAdapter_INCLUDED
diff --git a/Util/include/Poco/Util/Units.h b/Util/include/Poco/Util/Units.h
index cafd536b5..f0e0d51dc 100644
--- a/Util/include/Poco/Util/Units.h
+++ b/Util/include/Poco/Util/Units.h
@@ -1,1333 +1,1324 @@
-//
-// Units.h
-//
-// $Id: //poco/svn/Util/include/Poco/Util/Units.h#1 $
-//
-// Library: Util
-// Package: Units
-// Module: Units
-//
-// Basic definitions for the Poco Util library.
-// This file must be the first file included by every other Util
-// header file.
-//
-// Copyright (c) 2007-2009, Applied Informatics Software Engineering GmbH.
-// and Contributors.
-//
-// Permission is hereby granted, free of charge, to any person or organization
-// obtaining a copy of the software and accompanying documentation covered by
-// this license (the "Software") to use, reproduce, display, distribute,
-// execute, and transmit the Software, and to prepare derivative works of the
-// Software, and to permit third-parties to whom the Software is furnished to
-// do so, all subject to the following:
-//
-// The copyright notices in the Software and this entire statement, including
-// the above license grant, this restriction and the following disclaimer,
-// must be included in all copies of the Software, in whole or in part, and
-// all derivative works of the Software, unless such copies or derivative
-// works are solely in the form of machine-executable object code generated by
-// a source language processor.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-// Adapted for POCO from the following source:
-//
-// Written by Calum Grant
-// Copyright (C) Calum Grant 2007
-//
-// Home page: http://calumgrant.net/units
-// File location: http://calumgrant.net/units/units.hpp
-//
-// Copying permitted under the terms of the Boost software license.
-//
-
-
-#ifndef Util_Units_INCLUDED
-#define Util_Units_INCLUDED
-
-
-#include
-#include
-
-
-namespace Poco {
-namespace Util {
-namespace Units {
-
-
- namespace Internal
- {
- template struct Convert;
- /// Forward
-
- struct None;
- /// Allows construction of no units
-
- template
- struct FixedPower;
- /// Forward
- }
-
-
- template
- struct Compose;
- /// Construct a unit equivalent to Unit1*Unit2
-
-
- template
- struct Scale;
- /// Constructs a unit equivalent to U*Num/Den
-
-
- template
- struct Translate;
- /// Constructs a Unit equivalent to U+Num/Den
-
-
- template
- struct Power;
- /// Constructs a Unit equivalent to U^(Num/Den)
-
-
- typedef Power Unit;
- /// A unit which is effectively no units at all.
-
-
- template
- class Value
- /// A Value with a unit.
- /// - V is the type you are storing
- /// - U is the units of the Value
- {
- public:
- typedef V ValueType;
- typedef U Unit;
-
- Value(): _rep()
- {
- }
-
- explicit Value(const ValueType& v): _rep(v)
- {
- }
-
- template
- Value(const Value& v):
- _rep(Internal::Convert::fn(v.get()))
- {
- }
-
- const ValueType& get() const
- {
- return _rep;
- }
-
- template
- Value& operator = (const Value& other)
- {
- _rep = Value(other).get();
- return *this;
- }
-
- template
- Value operator + (const Value& other) const
- {
- return Value(get() + Value(other).get());
- }
-
- template
- Value& operator += (const Value& other)
- {
- _rep += Value(other).get();
- return *this;
- }
-
- template
- Value& operator -= (const Value& other)
- {
- _rep -= Value(other).get();
- return *this;
- }
-
- template
- Value operator - (const Value& other) const
- {
- return Value(get() - Value(other).get());
- }
-
- Value operator - () const
- {
- return Value(-get());
- }
-
- template
- Value >
- operator * (const Value& other) const
- {
- return Value >(get() * other.get());
- }
-
- Value operator * (const ValueType& v) const
- {
- return Value(get() * v);
- }
-
- Value& operator *= (const ValueType& v)
- {
- _rep *= v;
- return *this;
- }
-
- template
- Value > > operator / (const Value& other) const
- {
- return Value > >(get() / other.get());
- }
-
- Value operator / (const ValueType& v) const
- {
- return Value(get() / v);
- }
-
- Value& operator /= (const ValueType& v)
- {
- _rep /= v;
- return *this;
- }
-
- template
- bool operator == (const Value& other) const
- {
- return get() == Value(other).get();
- }
-
- template
- bool operator != (const Value& other) const
- {
- return get() != Value(other).get();
- }
-
- template
- bool operator < (const Value& other) const
- {
- return get() < Value(other).get();
- }
-
- template
- bool operator <= (const Value& other) const
- {
- return get() <= Value(other).get();
- }
-
- template
- bool operator > (const Value& other) const
- {
- return get() > Value(other).get();
- }
-
- template
- bool operator >= (const Value& other) const
- {
- return get() >= Value(other).get();
- }
-
- Value& operator ++ ()
- {
- ++_rep;
- return *this;
- }
-
- Value operator ++ (int)
- {
- Value v = *this;
- ++_rep;
- return v;
- }
-
- Value& operator -- ()
- {
- --_rep;
- return *this;
- }
-
- Value operator -- (int)
- {
- Value v = *this;
- --_rep;
- return v;
- }
-
- private:
- ValueType _rep;
- };
-
-
- template
- Value > operator / (const V& a, const Value& b)
- {
- return Value >(a / b.get());
- }
-
-
- template
- Value operator * (const V& a, const Value& b)
- {
- return Value(a * b.get());
- }
-
-
- template
- Value > sqrt(const Value& a)
- {
- return Value >(std::sqrt(a.get()));
- }
-
-
- template
- Value > square(const Value& a)
- {
- return Value >(std::pow(a.get(), 2));
- }
-
-
- template
- Value > cube(const Value& a)
- {
- return Value >(std::pow(a.get(), 3));
- }
-
-
- template
- Value > raise(const Value& a)
- {
- return Value >(Internal::FixedPower::Power(a.get()));
- }
-} // namespace Units
-
-
-//
-// Implementation
-//
-
-
-namespace Units
-{
- namespace Internal
- {
- template struct static_assert;
- template <> struct static_assert { };
- /// Ensures (at compile-time) that the template argument is true.
-
-
- template
- struct Convertible;
- /// Forward
-
-
- template
- struct ScalingFactor;
- /// Forward
-
-
- template
- struct Convert3
- /// Converts T1 to T2.
- /// Stage 3 - performed after Stage 1 and Stage 2.
- /// The reason we perform Convert in stages is so that the compiler
- /// can resolve templates in the order we want it to.
- {
- template
- static V fn(const V& v)
- /// The default implementation assumes that the two quantities are in compatible
- /// Units up to some scaling factor. Find the scaling factor and apply it.
- {
- return v * ScalingFactor::template fn() / ScalingFactor::template fn();
- }
- };
-
-
- template
- struct Convert2
- /// Converts T1 to T2.
- /// Template matches the first argument (T1),
- /// this is the fall-through to Convert3.
- {
- template
- static V fn(const V& v)
- {
- return Convert3::fn(v);
- }
- };
-
-
- template
- struct Convert
- /// Converts T1 to T2.
- /// If you really want to implement your own conversion routine,
- /// specialize this template.
- /// The default implementation falls through to Convert2.
- {
- static_assert::Value> check_convertible;
- /// If this fails, then T1 is not Convertible to T2:
-
- template
- static V fn(const V& v)
- {
- return Convert2::fn(v);
- }
- };
-
-
- template
- struct Convert
- /// Trivial conversion to the same type.
- {
- template
- static const U& fn(const U& u) { return u; }
- };
-
-
- template
- struct Convert3
- /// Convert to same type.
- {
- template
- static const U& fn(const U& u) { return u; }
- };
-
-
- template
- struct Convert2, U>
- /// Convert from a scaled Unit
- {
- template
- static V fn(const V& v)
- {
- return Convert::fn((v * Den)/Num);
- }
- };
-
-
- template
- struct Convert3 >
- /// Convert to a scaled Unit
- {
- template
- static V fn(const V& v)
- {
- return (Convert::fn(v) * Num)/ Den;
- }
- };
-
-
- template
- struct Convert2, U>
- /// Convert from a translated Unit
- {
- template
- static V fn(const V& v)
- {
- return Convert::fn(v - static_cast(Num) / static_cast(Den));
- }
- };
-
-
- template
- struct Convert3 >
- /// Convert to a translated Unit
- {
- template
- static V fn(const V& v)
- {
- return Convert::fn(v) + static_cast(Num) / static_cast(Den);
- }
- };
-
-
- template
- struct CountTerms
- /// Count the power to which Unit Term is raised in the Unit List.
- /// Returns a rational num/den of the power of term Term in List.
- /// The default assumes that Term is not found (num/den=0)
- {
- static const int num = 0;
- static const int den = 1;
- };
-
-
- template
- struct CountTerms
- {
- static const int num = 1;
- static const int den = 1;
- };
-
-
- template
- struct CountTerms >
- /// CountTerms ignores scaling factors - that is taken care of by ScalingFactor.
- {
- typedef CountTerms result;
- static const int num = result::num;
- static const int den = result::den;
- };
-
-
- template
- struct CountTerms >
- /// CountTerms ignores translation.
- {
- typedef CountTerms result;
- static const int num = result::num;
- static const int den = result::den;
- };
-
-
- template
- struct CountTerms >
- /// Addition of fractions.
- {
- typedef CountTerms result1;
- typedef CountTerms result2;
- static const int num =
- result1::num * result2::den + result1::den * result2::num;
- static const int den =
- result1::den * result2::den;
- };
-
-
- template
- struct CountTerms >
- /// Multiplication of fractions.
- {
- typedef CountTerms result;
- static const int num = N * result::num;
- static const int den = D * result::den;
- };
-
-
- template
- struct CheckTermsEqual
- /// Counts the power of the Unit Term in Units T1 and T2.
- /// Reports if they are equal, using equality of fractions.
- /// Does a depth-first search of the Unit "Term",
- /// or counts the terms in the default case.
- {
- typedef CountTerms count1;
- typedef CountTerms count2;
-
- static const bool Value =
- count1::num * count2::den ==
- count1::den * count2::num;
- };
-
-
- template
- struct CheckTermsEqual, T1, T2 >
- {
- static const bool Value = CheckTermsEqual::Value;
- };
-
-
- template
- struct CheckTermsEqual, T1, T2 >
- {
- static const bool Value = CheckTermsEqual::Value;
- };
-
-
- template
- struct CheckTermsEqual, T1, T2 >
- {
- static const bool Value = CheckTermsEqual::Value;
- };
-
-
- template
- struct CheckTermsEqual,T3,T4>
- {
- static const bool Value =
- CheckTermsEqual::Value &&
- CheckTermsEqual::Value;
- };
-
-
- template
- struct Convertible
- /// Determines whether two types are Convertible
- /// Counts the powers in the LHS and RHS and ensures they are equal.
- {
- static const bool Value =
- CheckTermsEqual::Value &&
- CheckTermsEqual::Value;
- };
-
-
- template
- struct FixedPower
- /// A functor that raises a Value to the power Num/Den.
- /// The template is specialised for efficiency
- /// so that we don't always have to call the std::Power function.
- {
- template static T Power(const T& t)
- {
- return std::pow(t, static_cast(Num)/static_cast(Den));
- }
- };
-
-
- template
- struct FixedPower
- {
- template static const T& Power(const T& t)
- {
- return t;
- }
- };
-
-
- template
- struct FixedPower
- {
- template static T Power(const T& t)
- {
- return t*t;
- }
- };
-
-
- template
- struct FixedPower
- {
- template static T Power(const T& t)
- {
- return t*t*t;
- }
- };
-
-
- template
- struct FixedPower
- {
- template static const T& Power(const T& t)
- {
- T u = t*t;
- return u*u;
- }
- };
-
-
- template
- struct FixedPower
- {
- template static T Power(const T& t)
- {
- return 1/t;
- }
- };
-
-
- template
- struct FixedPower
- {
- template static T Power(const T& t)
- {
- return 1/(t*t);
- }
- };
-
-
- template
- struct FixedPower
- {
- template static T Power(const T& t)
- {
- return 1;
- }
- };
-
-
- template
- struct ScalingFactor
- /// Determine the scaling factor of a Unit in relation to its "base" Units.
- /// Default is that U is a primitive Unit and is not scaled.
- {
- template
- static T fn() { return 1; }
- };
-
-
- template
- struct ScalingFactor< Compose >
- {
- template
- static T fn()
- {
- return
- ScalingFactor::template fn() *
- ScalingFactor::template fn();
- }
- };
-
-
- template
- struct ScalingFactor< Scale >
- {
- template
- static T fn()
- {
- return
- ScalingFactor::template fn() *
- static_cast(N) / static_cast(D);
- }
- };
-
-
- template
- struct ScalingFactor< Power >
- {
- template
- static T fn()
- {
- return FixedPower::Power(ScalingFactor::template fn());
- }
- };
-
-
- template
- struct ScalingFactor< Translate >
- {
- template
- static T fn()
- {
- return ScalingFactor::template fn();
- }
- };
- }
-}
-
-
-///
-/// Display
-///
-
-
-#define UNIT_DISPLAY_NAME(Unit, string) \
- template <> struct OutputUnit { \
- template static void fn(Stream& os) { os << string; } \
- };
-
-
-#define UNITS_DISPLAY_NAME(Unit, string) \
- namespace Units { UNIT_DISPLAY_NAME(Unit, string) }
-
-
-namespace Units
-{
- namespace Internal
- {
- template
- struct OutputUnit2
- /// The default Unit formatting mechanism
- {
- template
- static void fn(Stream &os) { os << "Units"; }
- };
- }
-
-
- template
- struct OutputUnit
- /// Functor to write Unit text to stream
- {
- template
- static void fn(Stream &os) { Internal::OutputUnit2::fn(os); }
- };
-
-
- UNIT_DISPLAY_NAME(Unit, "1");
-
-
- namespace Internal
- {
- template
- struct OutputUnit2< Compose >
- {
- template
- static void fn(Stream &os)
- {
- OutputUnit::fn(os);
- os << '.';
- OutputUnit::fn(os);
- }
- };
-
-
- template
- struct OutputUnit2< Power >
- {
- template
- static void fn(Stream &os)
- {
- if(Num!=Den) os << '(';
- OutputUnit::fn(os);
- if(Num!=Den)
- {
- os << ')';
- os << '^' << Num;
- if(Num%Den)
- {
- os << '/' << Den;
- }
- }
- }
- };
-
-
- template
- struct OutputUnit2< Translate >
- {
- template
- static void fn(Stream &os)
- {
- os << '(';
- OutputUnit::fn(os);
- os << '+' << Num;
- if(Den!=1) os << '/' << Den;
- os << ')';
- }
- };
-
-
- template
- struct OutputUnit2< Scale >
- {
- template
- static void fn(Stream &os)
- {
- os << Den;
- if(Num != 1)
- os << '/' << Num;
- os << '.';
- OutputUnit::fn(os);
- }
- };
- }
-
-
- template
- Str& operator << (Str& os, const Value& value)
- {
- os << value.get() << ' ';
- OutputUnit::fn(os);
- return os;
- }
-}
-
-
-///
-/// Additional Units
-///
-
-
-namespace Units
-{
- namespace Units
- {
- typedef Poco::Util::Units::Unit Unit;
-
- // SI base Units:
-
- struct m; // meter
- struct kg; // kilogram
- struct s; // second
- struct K; // Kelvin
- struct A; // Ampere
- struct mol; // mole
- struct cd; // candela
- }
-
-
- UNIT_DISPLAY_NAME(Units::m, "m");
- UNIT_DISPLAY_NAME(Units::kg, "kg");
- UNIT_DISPLAY_NAME(Units::s, "s");
- UNIT_DISPLAY_NAME(Units::K, "K");
- UNIT_DISPLAY_NAME(Units::A, "A");
- UNIT_DISPLAY_NAME(Units::mol, "mol");
- UNIT_DISPLAY_NAME(Units::cd, "cd");
-
-
- namespace Units
- {
- // SI derived Units:
- typedef Compose > rad;
- typedef Compose, Power > sr;
- typedef Power Hz;
- typedef Compose > > N;
- typedef Compose