2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: ElementType.C /main/1 1996/07/29 16:49:35 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
28 #pragma implementation
31 #include "ElementType.h"
32 #include "ContentToken.h"
36 namespace SP_NAMESPACE {
39 ElementType::ElementType(const StringC &name, size_t index)
40 : Named(name), index_(index), map_(0), defIndex_(0)
44 ElementDefinition::ElementDefinition(const Location &location,
46 unsigned char omitFlags,
47 DeclaredContent declaredContent)
48 : location_(location),
50 omitFlags_(omitFlags),
51 declaredContent_(declaredContent)
56 ElementDefinition::ElementDefinition(const Location &location,
58 unsigned char omitFlags,
59 DeclaredContent declaredContent,
60 Owner<CompiledModelGroup> &modelGroup)
61 : location_(location),
63 omitFlags_(omitFlags),
64 declaredContent_(declaredContent),
65 modelGroup_(modelGroup.extract())
70 void ElementDefinition::computeMode()
72 switch (declaredContent_) {
74 if (!modelGroup_->containsPcdata()) {
75 netMode_ = econnetMode;
81 netMode_ = mconnetMode;
85 netMode_ = cconnetMode;
89 netMode_ = rcconnetMode;
99 void ElementType::swap(ElementType &to)
103 size_t tem = to.index_;
108 size_t tem = to.defIndex_;
109 to.defIndex_ = defIndex_;
114 const ShortReferenceMap *tem = to.map_;
120 RankStem::RankStem(const StringC &name, size_t index)
121 : Named(name), index_(index)
125 void RankStem::addDefinition(const ConstPtr<ElementDefinition> &p)