LibreOffice Module comphelper (master)  1
multicontainer2.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <sal/config.h>
23 
24 #include <osl/diagnose.h>
25 #include <osl/mutex.hxx>
26 #include <com/sun/star/lang/EventObject.hpp>
27 #include <com/sun/star/lang/DisposedException.hpp>
28 #include <com/sun/star/uno/Sequence.hxx>
31 #include <cstddef>
32 #include <functional>
33 #include <memory>
34 #include <vector>
35 #include <utility>
36 
37 namespace com::sun::star::uno
38 {
39 class XInterface;
40 }
41  //for docpp
43 namespace comphelper
44 {
49 {
50 public:
58  OMultiTypeInterfaceContainerHelper2(::osl::Mutex& rMutex);
63 
67  std::vector<css::uno::Type> getContainedTypes() const;
68 
74  OInterfaceContainerHelper2* getContainer(const css::uno::Type& rKey) const;
75 
94  sal_Int32 addInterface(const css::uno::Type& rKey,
95  const css::uno::Reference<css::uno::XInterface>& r);
96 
107  sal_Int32 removeInterface(const css::uno::Type& rKey,
108  const css::uno::Reference<css::uno::XInterface>& rxIFace);
109 
114  void disposeAndClear(const css::lang::EventObject& rEvt);
118  void clear();
119 
120  typedef css::uno::Type keyType;
121 
122 private:
123  typedef std::vector<std::pair<css::uno::Type, std::unique_ptr<OInterfaceContainerHelper2>>>
125 
126  t_type2ptr::iterator findType(const css::uno::Type& rKey);
127  t_type2ptr::const_iterator findType(const css::uno::Type& rKey) const;
128 
130  ::osl::Mutex& rMutex;
131 
134  = delete;
135 };
136 
137 } // namespace comphelper
138 
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::pair< css::uno::Type, std::unique_ptr< OInterfaceContainerHelper2 > > > t_type2ptr
This is a copy of cppu::OMultiTypeInterfaceContainerHelper2 in include/cppuhelper/interfacecontainer...
#define COMPHELPER_DLLPUBLIC