LibreOffice Module dbaccess (master) 1
HelperCollections.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#pragma once
20
23#include <rtl/ref.hxx>
24
25namespace dbaccess
26{
27 using namespace dbtools;
28 using namespace comphelper;
29 using namespace connectivity;
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::beans;
32 using namespace ::com::sun::star::sdbc;
33 using namespace ::com::sun::star::sdb;
34 using namespace ::com::sun::star::sdbcx;
35 using namespace ::com::sun::star::container;
36 using namespace ::com::sun::star::lang;
37 using namespace ::com::sun::star::script;
38 using namespace ::cppu;
39 using namespace ::osl;
40
43 {
45 protected:
46 virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
47 virtual void impl_refresh() override {}
48 virtual Reference< XPropertySet > createDescriptor() override
49 {
50 return nullptr;
51 }
52 public:
54 bool _bCase,
55 ::cppu::OWeakObject& _rParent,
56 ::osl::Mutex& _rMutex,
57 const std::vector< OUString> &_rVector,
58 bool _bUseAsIndex = false
59 );
60
63 static std::unique_ptr<OPrivateColumns> createWithIntrinsicNames(
64 const ::rtl::Reference< ::connectivity::OSQLColumns >& _rColumns,
65 bool _bCase,
66 ::cppu::OWeakObject& _rParent,
67 ::osl::Mutex& _rMutex
68 );
69
70 virtual void disposing() override;
71 };
73
74 // OPrivateTables
76 {
78 protected:
79 virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
80 virtual void impl_refresh() override {}
81 virtual Reference< XPropertySet > createDescriptor() override
82 {
83 return nullptr;
84 }
85 public:
87 bool _bCase,
88 ::cppu::OWeakObject& _rParent,
89 ::osl::Mutex& _rMutex,
90 std::vector< OUString> && _rVector
91 ) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
92 ,m_aTables(std::move(_rTables))
93 {
94 }
95 virtual void disposing() override
96 {
98 // we're not owner of the objects we're holding, instead the object we got in our ctor is
99 // So we're not allowed to dispose our elements.
100 m_aTables.clear();
102 }
103 };
104}
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OCollection(::cppu::OWeakObject &_rParent, bool _bCase, ::osl::Mutex &_rMutex, const ::std::vector< OUString > &_rVector, bool _bUseIndexOnly=false, bool _bUseHardRef=true)
OPrivateColumns(::rtl::Reference< ::connectivity::OSQLColumns > _xColumns, bool _bCase, ::cppu::OWeakObject &_rParent, ::osl::Mutex &_rMutex, const std::vector< OUString > &_rVector, bool _bUseAsIndex=false)
virtual void impl_refresh() override
virtual connectivity::sdbcx::ObjectType createObject(const OUString &_rName) override
virtual void disposing() override
virtual Reference< XPropertySet > createDescriptor() override
static std::unique_ptr< OPrivateColumns > createWithIntrinsicNames(const ::rtl::Reference< ::connectivity::OSQLColumns > &_rColumns, bool _bCase, ::cppu::OWeakObject &_rParent, ::osl::Mutex &_rMutex)
creates a columns instance as above, but taking the names from the columns itself
::rtl::Reference< ::connectivity::OSQLColumns > m_aColumns
virtual void disposing() override
virtual void impl_refresh() override
virtual connectivity::sdbcx::ObjectType createObject(const OUString &_rName) override
OPrivateTables(OSQLTables _rTables, bool _bCase, ::cppu::OWeakObject &_rParent, ::osl::Mutex &_rMutex, std::vector< OUString > &&_rVector)
virtual Reference< XPropertySet > createDescriptor() override
css::uno::Reference< css::beans::XPropertySet > ObjectType
std::map< OUString, OSQLTable, comphelper::UStringMixLess > OSQLTables
connectivity::sdbcx::OCollection OPrivateTables_BASE
connectivity::sdbcx::OCollection OPrivateColumns_Base