object.hxx 1.85 KB
Newer Older
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
Michael Meeks's avatar
Michael Meeks committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you 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 .
 */
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
19

20 21
#ifndef INCLUDED_STORE_SOURCE_OBJECT_HXX
#define INCLUDED_STORE_SOURCE_OBJECT_HXX
22

23 24
#include <sal/types.h>
#include <salhelper/simplereferenceobject.hxx>
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
25

26 27 28
namespace store
{

Noel Grandin's avatar
Noel Grandin committed
29
class OStoreObject : public virtual salhelper::SimpleReferenceObject
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
30 31
{
public:
32 33
    /** Construction.
     */
34
    OStoreObject() {}
35

Noel Grandin's avatar
Noel Grandin committed
36
    /** Replaces dynamic_cast type checking.
37
     */
Noel Grandin's avatar
Noel Grandin committed
38
    virtual bool isKindOf (sal_uInt32 nTypeId);
39

Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
40
protected:
41 42
    /** Destruction.
     */
43
    virtual ~OStoreObject() override {}
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
44 45

private:
46 47 48
    /** The IStoreHandle TypeId.
     */
    static const sal_uInt32 m_nTypeId;
49 50
    OStoreObject (const OStoreObject&) = delete;
    OStoreObject& operator= (const OStoreObject&) = delete;
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
51 52
};

Noel Grandin's avatar
Noel Grandin committed
53
/** Template helper function as dynamic_cast replacement.
54
 */
Noel Grandin's avatar
Noel Grandin committed
55 56 57
template<class store_handle_type>
store_handle_type * SAL_CALL query (
    OStoreObject * pHandle, store_handle_type *);
58 59

} // namespace store
Jens-Heiner Rechtien's avatar
Jens-Heiner Rechtien committed
60

61
#endif // INCLUDED_STORE_SOURCE_OBJECT_HXX
62 63

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */