1 | /* |
---|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
3 | * contributor license agreements. See the NOTICE file distributed with |
---|
4 | * this work for additional information regarding copyright ownership. |
---|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
6 | * (the "License"); you may not use this file except in compliance with |
---|
7 | * the License. You may obtain a copy of the License at |
---|
8 | * |
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
10 | * |
---|
11 | * Unless required by applicable law or agreed to in writing, software |
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
14 | * See the License for the specific language governing permissions and |
---|
15 | * limitations under the License. |
---|
16 | */ |
---|
17 | |
---|
18 | /* |
---|
19 | * $Id: UnionToken.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #if !defined(UNIONTOKEN_HPP) |
---|
23 | #define UNIONTOKEN_HPP |
---|
24 | |
---|
25 | // --------------------------------------------------------------------------- |
---|
26 | // Includes |
---|
27 | // --------------------------------------------------------------------------- |
---|
28 | #include <xercesc/util/regx/Token.hpp> |
---|
29 | #include <xercesc/util/RefVectorOf.hpp> |
---|
30 | |
---|
31 | XERCES_CPP_NAMESPACE_BEGIN |
---|
32 | |
---|
33 | class XMLUTIL_EXPORT UnionToken : public Token { |
---|
34 | public: |
---|
35 | // ----------------------------------------------------------------------- |
---|
36 | // Public Constructors and Destructor |
---|
37 | // ----------------------------------------------------------------------- |
---|
38 | UnionToken(const unsigned short tokType |
---|
39 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
40 | ~UnionToken(); |
---|
41 | |
---|
42 | // ----------------------------------------------------------------------- |
---|
43 | // Getter methods |
---|
44 | // ----------------------------------------------------------------------- |
---|
45 | int size() const; |
---|
46 | Token* getChild(const int index) const; |
---|
47 | |
---|
48 | // ----------------------------------------------------------------------- |
---|
49 | // Children manipulation methods |
---|
50 | // ----------------------------------------------------------------------- |
---|
51 | void addChild(Token* const child, TokenFactory* const tokFactory); |
---|
52 | |
---|
53 | private: |
---|
54 | // ----------------------------------------------------------------------- |
---|
55 | // Unimplemented constructors and operators |
---|
56 | // ----------------------------------------------------------------------- |
---|
57 | UnionToken(const UnionToken&); |
---|
58 | UnionToken& operator=(const UnionToken&); |
---|
59 | |
---|
60 | // ----------------------------------------------------------------------- |
---|
61 | // Private Constants |
---|
62 | // ----------------------------------------------------------------------- |
---|
63 | static const unsigned short INITIALSIZE; |
---|
64 | |
---|
65 | // ----------------------------------------------------------------------- |
---|
66 | // Private data members |
---|
67 | // ----------------------------------------------------------------------- |
---|
68 | RefVectorOf<Token>* fChildren; |
---|
69 | }; |
---|
70 | |
---|
71 | |
---|
72 | // --------------------------------------------------------------------------- |
---|
73 | // UnionToken: getter methods |
---|
74 | // --------------------------------------------------------------------------- |
---|
75 | inline int UnionToken::size() const { |
---|
76 | |
---|
77 | return fChildren == 0 ? 0 : fChildren->size(); |
---|
78 | } |
---|
79 | |
---|
80 | inline Token* UnionToken::getChild(const int index) const { |
---|
81 | |
---|
82 | return fChildren->elementAt(index); |
---|
83 | } |
---|
84 | |
---|
85 | XERCES_CPP_NAMESPACE_END |
---|
86 | |
---|
87 | #endif |
---|
88 | |
---|
89 | /** |
---|
90 | * End of file UnionToken.hpp |
---|
91 | */ |
---|