source: NonGTP/Xerces/xerces/include/xercesc/util/regx/UnionToken.hpp @ 358

Revision 358, 3.1 KB checked in by bittner, 19 years ago (diff)

xerces added

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