LibreOffice Module codemaker (master) 1
exceptiontree.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#ifndef INCLUDED_CODEMAKER_EXCEPTIONTREE_HXX
21#define INCLUDED_CODEMAKER_EXCEPTIONTREE_HXX
22
23#include <rtl/ref.hxx>
24#include <rtl/string.hxx>
25
26#include <memory>
27#include <utility>
28#include <vector>
29
30class TypeManager;
31
32namespace codemaker {
33
38 typedef std::vector< std::unique_ptr<ExceptionTreeNode> > Children;
39
40 // Internally used by ExceptionTree:
41 ExceptionTreeNode(rtl::OString theName):
42 name(std::move(theName)), present(false) {}
43
44 // Internally used by ExceptionTree:
46
47 // Internally used by ExceptionTree:
48 void setPresent() { present = true; clearChildren(); }
49
50 // Internally used by ExceptionTree:
51 ExceptionTreeNode * add(rtl::OString const & theName);
52
53 rtl::OString name;
54 bool present;
56
57private:
60
61 void clearChildren();
62};
63
80public:
81 ExceptionTree(): m_root("com.sun.star.uno.Exception") {}
82
95 void add(
96 rtl::OString const & name,
97 rtl::Reference< TypeManager > const & manager);
98
106 ExceptionTreeNode const & getRoot() const { return m_root; }
107
108private:
109 ExceptionTree(ExceptionTree const &) = delete;
111
113};
114
115}
116
117#endif
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the hierarchy formed by a set of UNO exception types.
ExceptionTree(ExceptionTree const &)=delete
void add(rtl::OString const &name, rtl::Reference< TypeManager > const &manager)
Builds the exception hierarchy, by adding one exception type at a time.
ExceptionTreeNode m_root
ExceptionTree & operator=(const ExceptionTree &)=delete
ExceptionTreeNode const & getRoot() const
Gives access to the resultant exception hierarchy.
@HTML
Definition: codemaker.cxx:29
Represents a node of the hierarchy from the ExceptionTree class.
std::vector< std::unique_ptr< ExceptionTreeNode > > Children
ExceptionTreeNode * add(rtl::OString const &theName)
ExceptionTreeNode & operator=(ExceptionTreeNode const &)=delete
ExceptionTreeNode(ExceptionTreeNode const &)=delete
ExceptionTreeNode(rtl::OString theName)