diff --git a/Core/Code/CppMicroServices/documentation/doxygen/standalone/BuildInstructions.md b/Core/Code/CppMicroServices/documentation/doxygen/standalone/BuildInstructions.md
index c904ee8165..949489d93b 100644
--- a/Core/Code/CppMicroServices/documentation/doxygen/standalone/BuildInstructions.md
+++ b/Core/Code/CppMicroServices/documentation/doxygen/standalone/BuildInstructions.md
@@ -1,80 +1,83 @@
Build Instructions {#BuildInstructions}
==================
The C++ Micro Services library provides [CMake][cmake] build scripts which allow the generation of
platform and IDE specific project files.
The library should compile on many different platforms. Below is a list of tested compiler/OS combinations:
- GCC 4.5 (Ubuntu 11.04 and MacOS X 10.6)
- Visual Studio 2008 and 2010
- Clang 3.0 (Ubuntu 11.04 and MacOS X 10.6)
Prerequisites
-------------
- [CMake][cmake] 2.8 (Visual Studio 2010 users should use the latest CMake version available)
Configuring the Build
---------------------
When building the C++ Micro Services library, you have a few configuration options at hand.
### General build options
- **US_BUILD_SHARED_LIBS**
Specify if the library should be build shared or static. See \ref MicroServices_StaticModules for detailed
information about static CppMicroServices modules.
- **US_BUILD_TESTING**
Build unit tests and code snippets.
- **US_ENABLE_AUTOLOADING_SUPPORT**
Enable auto-loading of modules located in special sup-directories. See \ref MicroServices_AutoLoading for
detailed information about this feature.
- **US_ENABLE_THREADING_SUPPORT**
Enable the use of synchronization primitives (atomics and pthread mutexes or Windows primitives) to make
the API thread-safe. If you are application is not multi-threaded, turn this option OFF to get maximum
performance.
- **US_USE_C++11 (advanced)**
Enable the usage of C++11 constructs
+- **US_ENABLE_RESOURCE_COMPRESSION**
+ Enable compression of embedded resources. See \ref MicroServices_Resources for detailed information
+ about the resource system.
### Customizing naming conventions
- **US_NAMESPACE**
The default namespace is `us` but you may override this at will.
- **US_HEADER_PREFIX**
By default, all public headers have a "us" prefix. You may specify an arbitrary prefix to match your
naming conventions.
The above options are mainly useful when embedding the C++ Micro Services source code in your own library and
you want to make it look like native source code.
### Configure the service base class
All service implementations must inherit from the same base class. The C++ Micro Services library provides
a trivial class called `us::Base` for that purpose. However, most applications already have a special base
class and you can configure the C++ Micro Services library to use that class.
- **US_BASECLASS_NAME**
The fully-qualified name of the base class, e.g. `my::OwnBaseClass`. If you don't need support for service
factories (see below) and don't want to enable US_BUILD_TESTING, this is all you need.
- **US_ENABLE_SERVICE_FACTORY_SUPPORT (advanced)**
If you want support for service factories (they allow the customization of service objects for individual
modules, see OSGi Service Platform Core Specification Release 4, Version 4.3, Section 5.6), switch this
option to ON. If you also provided a custom US_BASECLASS_NAME, you need to set the US_BASECLASS_HEADER variable.
- **US_BASECLASS_HEADER (advanced)**
The name of the header file containing the declaration for the base class specified in US_BASECLASS_NAME, e.g.
`myOwnBaseClass.h`. You will also have to set US_BASECLASS_PACKAGE or US_BASECLASS_INCLUDE_DIRS and US_BASECLASS_LIBRARIES.
- **US_BASECLASS_PACKAGE (advanced)**
If your specified a custom base class from a library which can be found via a CMake `find_package` command, enter
the package name here. Most of the time, this will correctly set the values for US_BASECLASS_INCLUDE_DIRS,
US_BASECLASS_LIBRARIES, and US_BASECLASS_LIBRARY_DIRS.
- **US_BASECLASS_INCLUDE_DIRS (advanced)**
A list of include dirs needed to include the base class header file as specified in US_BASECLASS_HEADER.
- **US_BASECLASS_LIBRARIES (advanced)**
A list of libraries to link the C++ Micro Services library against for resolving symbols needed for a custom base class.
- **US_BASECLASS_LIBRARY_DIRS (advanced)**
A list of directories to look for the libraries specified in US_BASECLASS_LIBRARIES
[cmake]: http://www.cmake.org
diff --git a/Core/Code/CppMicroServices/src/service/usServiceEvent.h b/Core/Code/CppMicroServices/src/service/usServiceEvent.h
index d1047b5fab..1d181deed2 100644
--- a/Core/Code/CppMicroServices/src/service/usServiceEvent.h
+++ b/Core/Code/CppMicroServices/src/service/usServiceEvent.h
@@ -1,179 +1,191 @@
/*=============================================================================
Library: CppMicroServices
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============================================================================*/
#ifndef USSERVICEEVENT_H
#define USSERVICEEVENT_H
+#ifdef REGISTERED
+#ifdef _WIN32
+#error The REGISTERED preprocessor define clashes with the ServiceEvent::REGISTERED\
+ enum type. Try to reorder your includes, compile with WIN32_LEAN_AND_MEAN, or undef\
+ the REGISTERED macro befor including this header.
+#else
+#error The REGISTERED preprocessor define clashes with the ServiceEvent::REGISTERED\
+ enum type. Try to reorder your includes or undef the REGISTERED macro befor including\
+ this header.
+#endif
+#endif
+
#include "usSharedData.h"
#include "usServiceReference.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4251)
#endif
US_BEGIN_NAMESPACE
class ServiceEventData;
/**
* \ingroup MicroServices
*
* An event from the Micro Services framework describing a service lifecycle change.
*
* ServiceEvent
objects are delivered to
* listeners connected via ModuleContext::AddServiceListener() when a
* change occurs in this service's lifecycle. A type code is used to identify
* the event type for future extendability.
*/
class US_EXPORT ServiceEvent
{
SharedDataPointer d;
public:
enum Type {
/**
* This service has been registered.
*
* This event is delivered after the service
* has been registered with the framework.
*
* @see ModuleContext#RegisterService()
*/
REGISTERED = 0x00000001,
/**
* The properties of a registered service have been modified.
*
* This event is delivered after the service
* properties have been modified.
*
* @see ServiceRegistration#SetProperties
*/
MODIFIED = 0x00000002,
/**
* This service is in the process of being unregistered.
*
* This event is delivered before the service
* has completed unregistering.
*
*
* If a module is using a service that is UNREGISTERING
, the
* module should release its use of the service when it receives this event.
* If the module does not release its use of the service when it receives
* this event, the framework will automatically release the module's use of
* the service while completing the service unregistration operation.
*
* @see ServiceRegistration#Unregister
* @see ModuleContext#UngetService
*/
UNREGISTERING = 0x00000004,
/**
* The properties of a registered service have been modified and the new
* properties no longer match the listener's filter.
*
* This event is delivered after the service
* properties have been modified. This event is only delivered to listeners
* which were added with a non-empty filter where the filter
* matched the service properties prior to the modification but the filter
* does not match the modified service properties.
*
* @see ServiceRegistration#SetProperties
*/
MODIFIED_ENDMATCH = 0x00000008
};
/**
* Creates an invalid instance.
*/
ServiceEvent();
~ServiceEvent();
/**
* Can be used to check if this ServiceEvent instance is valid,
* or if it has been constructed using the default constructor.
*
* @return true
if this event object is valid,
* false
otherwise.
*/
bool IsNull() const;
/**
* Creates a new service event object.
*
* @param type The event type.
* @param reference A ServiceReference
object to the service
* that had a lifecycle change.
*/
ServiceEvent(Type type, const ServiceReference& reference);
ServiceEvent(const ServiceEvent& other);
ServiceEvent& operator=(const ServiceEvent& other);
/**
* Returns a reference to the service that had a change occur in its
* lifecycle.
*
* This reference is the source of the event.
*
* @return Reference to the service that had a lifecycle change.
*/
ServiceReference GetServiceReference() const;
/**
* Returns the type of event. The event type values are:
*
* - {@link #REGISTERED}
* - {@link #MODIFIED}
* - {@link #MODIFIED_ENDMATCH}
* - {@link #UNREGISTERING}
*
*
* @return Type of service lifecycle change.
*/
Type GetType() const;
};
US_END_NAMESPACE
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/**
* \ingroup MicroServices
* @{
*/
US_EXPORT std::ostream& operator<<(std::ostream& os, const US_PREPEND_NAMESPACE(ServiceEvent::Type)& type);
US_EXPORT std::ostream& operator<<(std::ostream& os, const US_PREPEND_NAMESPACE(ServiceEvent)& event);
/** @}*/
#endif // USSERVICEEVENT_H
diff --git a/Core/Code/CppMicroServices/tools/usResourceCompiler.cpp b/Core/Code/CppMicroServices/tools/usResourceCompiler.cpp
index 34aef6b1b2..443cd9c46f 100644
--- a/Core/Code/CppMicroServices/tools/usResourceCompiler.cpp
+++ b/Core/Code/CppMicroServices/tools/usResourceCompiler.cpp
@@ -1,817 +1,827 @@
/*=============================================================================
Library: CppMicroServices
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============================================================================*/
#include "usConfig.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include