Commit Graph

18 Commits

Author SHA1 Message Date
Thomas Arnhold
530899ba18 cppuhelper: fix includes
Change-Id: I0e6bc822d19cf266dea716fe92f2ccd08d87c51f
2014-06-04 21:18:39 +02:00
Stephan Bergmann
70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Stephan Bergmann
88999eb03b Use cppu::BaseMutex instead of plain osl::Mutex as base
Change-Id: Id169891e60eb0a19899586fd3c9a9325ef9d1236
2014-03-18 13:29:14 +01:00
Noel Grandin
86a32589e9 Find places where OUString and OString are passed by value.
It's not very efficient, because we generally end up copying it twice -
once into the parameter and again into the destination OUString.

So I create a clang plugin that finds such places and generates a
warning so that we can convert them to pass-by-reference.

Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
2014-03-18 08:32:26 +02:00
Stephan Bergmann
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
Stephan Bergmann
874c481801 Simplify service manager's tracking of singletons
It only tracks whether to dispose a singleton instance now, and (at least
conceptually) no longer remembers the single instance (apart from what is
necessary in order to call dispose on it), as the underlying implementation
already needs to keep track of that to support direct calls of constructor
functions.

Change-Id: I154bf05438e1db099c1c5ffb1c56377725c6bfc6
2014-02-07 11:10:06 +01:00
Jan Holesovsky
c2c530da69 Introduce static inline cppu::acquire(), and make use of that.
This is much better approach compared to the callback function, as it allows
passing arguments to the c++ constructor directly, while still allowing some
additional initialization after having acquired the instance.

Change-Id: I5a0f981915dd58f1522ee6054e53a3550b29d624
2014-01-22 15:09:28 +01:00
Jan Holesovsky
f278397787 Change _get_implementation()'s not to do initialization directly.
Many of the initalizations (in eg. framework) have to be done on an
acquire()'d object, so instead of doing the initialization directly, return
the initialization member function back to the createInstance() /
createInstanceWithContext() / ... and perform the initialization there.

As a sideeffect, I belive the calling initialize() from servicemanager is not
that much a hack any more - whoever converts the implementation to be
constructor-base has the choice to provide the callback, or still initialize
through XInitialization, where the callback is preferred by servicemanager
when it exists.

Change-Id: I8a87b75c54c1441ca0f184967d31ff4902fc4081
2014-01-21 21:25:22 +01:00
Stephan Bergmann
585d5621f1 Simplify code; STATUS_LOADED => component||factory1||factory2
Change-Id: I661eb69551eae3d888d156c6bd4291a532d0b6ab
2014-01-20 23:30:49 +01:00
Michael Stahl
2646b1594d cppuhelper: valgrind complains about uninitialized variable...
... cppuhelper::ServcieManager::Data::Implementation::dispose

Change-Id: I70a96e608f17eb6630326bbf32fff5fb5d7d4569
2014-01-16 21:50:59 +01:00
Stephan Bergmann
997d211833 Support for singleton constructor functions
The service manager now keeps track of instances of singleton implementations
(i.e., implementations whose XML description lists at least one
<singleton ...>).  These instances will be disposed either when the service
manager is disposed, or, for instances that have been instantiated into the
component context's /singleton/* map, when the component context is disposed.

This change allows to use constructor functions for such singleton
implementations, too.

Change-Id: I220c9ddc9824e4d7f7556daefb599e2ec36b0e6c
2014-01-16 18:40:05 +01:00
Matúš Kukan
4337a0664f Use const& arguments parameter for ctor functions.
Change-Id: I19ce8bd1a23123ac9a62a7fc95cd54fea5315221
2014-01-15 08:51:27 +01:00
Stephan Bergmann
ae3a0c8da5 Add .component <implementation constructor="..." feature
...to directly call constructor functions of ComponentContext-based C++
implementations of (non-single-instance) UNO services.  The case where these
calls would need to be bridged across different environments (e.g., from gcc3
to gcc3:affine) is not yet implemented.

bootstrap.component and expwrap.component are adapted accordingly as a proof-of-
concept (which had previously been adapted to use the prefix="direct" feature,
which may become unnecessary again in the end, depending on how to handle
single-instance services/singletons).  More to follow.

Change-Id: I18682d75bcd29d3d427e31331b4ce8161dbb846d
2013-12-19 08:48:56 +01:00
Stephan Bergmann
b1d65c9f15 Allow setting environment value directly in .component files
...for internal loader="com.sun.star.loader.SharedLibrary" components, instead
of exported component_getImplementationEnvironmen (or implicit
CPPU_CURRENT_LANGUAGE_BINDING_NAME).  Adapted a few .component files as proof-
of-concept, more to follow.

Change-Id: I82332e0a48e6fc1da245990bb72265fe6e58447e
2013-12-16 21:43:12 +01:00
Stephan Bergmann
4e42ce3271 Don't call code in UNO object ctor that throws UNO exceptions
...with Context set to this, that leads to refcounting bugs.

Change-Id: I4875dbe4ccb5a7bcfaa8370b14d4eab83c21d0e5
2013-05-08 12:29:53 +02:00
Stephan Bergmann
6059652fba Move addSingletonContextEntries to ServiceManager
Change-Id: I2a4c5b1f1f735e2bf5a8670d2f957f84388f0164
2013-01-16 17:27:00 +01:00
Stephan Bergmann
882aaee5ff UNO methods are no longer called directly on ServiceManager
Change-Id: I037ed9899873e614e9e10c89f1f8a74efa73d737
2013-01-16 17:27:00 +01:00
Stephan Bergmann
3250fad637 Extract servicemanager and typedescriptionprovider from defaultbootstrap
Change-Id: I94fe7e68c5a49e591a625e9bf62108acac69428d
2013-01-16 11:39:02 +01:00