xref: /aoo42x/main/configmgr/source/node.cxx (revision 3a7cf181)
1*3a7cf181SAndrew Rist /**************************************************************
2*3a7cf181SAndrew Rist  *
3*3a7cf181SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3a7cf181SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3a7cf181SAndrew Rist  * distributed with this work for additional information
6*3a7cf181SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3a7cf181SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3a7cf181SAndrew Rist  * "License"); you may not use this file except in compliance
9*3a7cf181SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3a7cf181SAndrew Rist  *
11*3a7cf181SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3a7cf181SAndrew Rist  *
13*3a7cf181SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3a7cf181SAndrew Rist  * software distributed under the License is distributed on an
15*3a7cf181SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3a7cf181SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3a7cf181SAndrew Rist  * specific language governing permissions and limitations
18*3a7cf181SAndrew Rist  * under the License.
19*3a7cf181SAndrew Rist  *
20*3a7cf181SAndrew Rist  *************************************************************/
21*3a7cf181SAndrew Rist 
22*3a7cf181SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_configmgr.hxx"
25cdf0e10cSrcweir #include "sal/config.h"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "com/sun/star/uno/Reference.hxx"
28cdf0e10cSrcweir #include "com/sun/star/uno/RuntimeException.hpp"
29cdf0e10cSrcweir #include "com/sun/star/uno/XInterface.hpp"
30cdf0e10cSrcweir #include "osl/diagnose.h"
31cdf0e10cSrcweir #include "rtl/ref.hxx"
32cdf0e10cSrcweir #include "rtl/ustring.h"
33cdf0e10cSrcweir #include "rtl/ustring.hxx"
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "data.hxx"
36cdf0e10cSrcweir #include "node.hxx"
37cdf0e10cSrcweir #include "nodemap.hxx"
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace configmgr {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir namespace {
42cdf0e10cSrcweir 
43cdf0e10cSrcweir namespace css = com::sun::star;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
getMembers()47cdf0e10cSrcweir NodeMap & Node::getMembers() {
48cdf0e10cSrcweir     OSL_ASSERT(false);
49cdf0e10cSrcweir     throw css::uno::RuntimeException(
50cdf0e10cSrcweir         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
51cdf0e10cSrcweir         css::uno::Reference< css::uno::XInterface >());
52cdf0e10cSrcweir }
53cdf0e10cSrcweir 
getTemplateName() const54cdf0e10cSrcweir rtl::OUString Node::getTemplateName() const {
55cdf0e10cSrcweir     return rtl::OUString();
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
setMandatory(int layer)58cdf0e10cSrcweir void Node::setMandatory(int layer) {
59cdf0e10cSrcweir     (void) layer; // avoid warnings
60cdf0e10cSrcweir     OSL_ASSERT(layer == Data::NO_LAYER);
61cdf0e10cSrcweir }
62cdf0e10cSrcweir 
getMandatory() const63cdf0e10cSrcweir int Node::getMandatory() const {
64cdf0e10cSrcweir     return Data::NO_LAYER;
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
setLayer(int layer)67cdf0e10cSrcweir void Node::setLayer(int layer) {
68cdf0e10cSrcweir     OSL_ASSERT(layer >= layer_);
69cdf0e10cSrcweir     layer_ = layer;
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
getLayer() const72cdf0e10cSrcweir int Node::getLayer() const {
73cdf0e10cSrcweir     return layer_;
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
setFinalized(int layer)76cdf0e10cSrcweir void Node::setFinalized(int layer) {
77cdf0e10cSrcweir     finalized_ = layer;
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
getFinalized() const80cdf0e10cSrcweir int Node::getFinalized() const {
81cdf0e10cSrcweir     return finalized_;
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
getMember(rtl::OUString const & name)84cdf0e10cSrcweir rtl::Reference< Node > Node::getMember(rtl::OUString const & name) {
85cdf0e10cSrcweir     NodeMap & members = getMembers();
86cdf0e10cSrcweir     NodeMap::iterator i(members.find(name));
87cdf0e10cSrcweir     return i == members.end() ? rtl::Reference< Node >() : i->second;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
Node(int layer)90cdf0e10cSrcweir Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER) {}
91cdf0e10cSrcweir 
Node(const Node & other)92cdf0e10cSrcweir Node::Node(const Node & other):
93cdf0e10cSrcweir     SimpleReferenceObject(), layer_(other.layer_), finalized_(other.finalized_)
94cdf0e10cSrcweir {}
95cdf0e10cSrcweir 
~Node()96cdf0e10cSrcweir Node::~Node() {}
97cdf0e10cSrcweir 
clear()98cdf0e10cSrcweir void Node::clear() {}
99cdf0e10cSrcweir 
100cdf0e10cSrcweir }
101