API changes in version 2.0.0

Sascha Zelzer edited this page Dec 23, 2013 · 7 revisions

This page lists the changes in the CppMicroServices 2.0.0 library.

New features

Changes in C++ classes

  • us::ServiceReference is now a class template over the service interface type. Example: us::ServiceReference<A> ref = context->GetServiceReference<A>()
  • us::ServiceRegistration is now a class template over the service interface type(s). Example: us::ServiceRegistration<A,B> reg = context->RegisterService<A,B>(service)
  • The template argument for the function template us_service_interface_iid should now be a plain type instead of a pointer type, e.g. us_service_interface_iid<A>() instead of us_service_interface_iid<A*>().
  • The requirements for the template arguments of the class template us::ServiceTracker changed. The first one should now be a plain type instead of a pointer type and the second one is a type traits class for the tracked type, see us::TrackedTypeTraitsBase: us::ServiceTracker<A> tracker(context)
  • Many methods returning or expecting a std::list to return a list of objects now return a std::vector instead.
  • The objectClass service property now expects a std::vector<std::string> instead of a std::list<std::string>.
  • The GetModules and GetLoadedModules methods of the us::ModuleRegistry class now return a std::vector instead of taking a reference as an argument.
  • Typedefs ending with a T have been removed to end with Type instead. E.g. TrackedT was renamed to TrackedType.

Removed functionality

The free method std::ostream& operator<<(std::ostream& os, const us::Any& any) was removed because implicit type conversions to us::Any could lead to complications. Use us::Any::ToString() directly instead.