LibreOffice Module configmgr (master) 1
node.cxx
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#include <sal/config.h>
21
22#include <cassert>
23
24#include <com/sun/star/uno/RuntimeException.hpp>
25#include <rtl/ref.hxx>
26#include <rtl/ustring.hxx>
27
28#include "data.hxx"
29#include "node.hxx"
30#include "nodemap.hxx"
31
32namespace configmgr {
33
35 assert(false);
36 throw css::uno::RuntimeException("this cannot happen");
37}
38
39OUString Node::getTemplateName() const {
40 return OUString();
41}
42
43void Node::setMandatory(int layer) {
44 (void) layer; // avoid warnings
45 assert(layer == Data::NO_LAYER);
46}
47
48int Node::getMandatory() const {
49 return Data::NO_LAYER;
50}
51
52void Node::setLayer(int layer) {
53 assert(layer >= layer_);
54 layer_ = layer;
55}
56
57
58void Node::setFinalized(int layer) {
59 finalized_ = layer;
60}
61
62
64 NodeMap const & members = getMembers();
66 return i == members.end() ? rtl::Reference< Node >() : i->second;
67}
68
69Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER) {}
70
71Node::Node(const Node & other):
72 SimpleReferenceObject(), layer_(other.layer_), finalized_(other.finalized_)
73{}
74
76
77}
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NodeMapImpl::const_iterator const_iterator
Definition: nodemap.hxx:38
int finalized_
Definition: node.hxx:63
virtual void setMandatory(int layer)
Definition: node.cxx:43
rtl::Reference< Node > getMember(OUString const &name)
Definition: node.cxx:63
virtual NodeMap & getMembers()
Definition: node.cxx:34
virtual ~Node() override
Definition: node.cxx:75
virtual int getMandatory() const
Definition: node.cxx:48
void setLayer(int layer)
Definition: node.cxx:52
virtual OUString getTemplateName() const
Definition: node.cxx:39
Node(int layer)
Definition: node.cxx:69
void setFinalized(int layer)
Definition: node.cxx:58
OUString name
Definition: components.cxx:85
int i
PyObject_HEAD PyUNO_callable_Internals * members