1 | /*
|
---|
2 | * Copyright 1999-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 | * $Log: XMLGrammarDescription.hpp,v $
|
---|
19 | * Revision 1.3 2004/09/08 13:55:59 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.2 2003/10/14 15:17:47 peiyongz
|
---|
23 | * Implementation of Serialization/Deserialization
|
---|
24 | *
|
---|
25 | * Revision 1.1 2003/06/20 18:37:39 peiyongz
|
---|
26 | * Stateless Grammar Pool :: Part I
|
---|
27 | *
|
---|
28 | * $Id: XMLGrammarDescription.hpp,v 1.3 2004/09/08 13:55:59 peiyongz Exp $
|
---|
29 | *
|
---|
30 | */
|
---|
31 |
|
---|
32 | #if !defined(XMLGRAMMARDESCRIPTION_HPP)
|
---|
33 | #define XMLGRAMMARDESCRIPTION_HPP
|
---|
34 |
|
---|
35 | #include <xercesc/util/XMemory.hpp>
|
---|
36 | #include <xercesc/validators/common/Grammar.hpp>
|
---|
37 |
|
---|
38 | #include <xercesc/internal/XSerializable.hpp>
|
---|
39 |
|
---|
40 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
41 |
|
---|
42 | class XMLPARSER_EXPORT XMLGrammarDescription : public XSerializable, public XMemory
|
---|
43 | {
|
---|
44 | public :
|
---|
45 | // -----------------------------------------------------------------------
|
---|
46 | /** @name Virtual destructor for derived classes */
|
---|
47 | // -----------------------------------------------------------------------
|
---|
48 | //@{
|
---|
49 | /**
|
---|
50 | * virtual destructor
|
---|
51 | *
|
---|
52 | */
|
---|
53 | virtual ~XMLGrammarDescription();
|
---|
54 | //@}
|
---|
55 |
|
---|
56 | // -----------------------------------------------------------------------
|
---|
57 | /** @name The Grammar Description Interface */
|
---|
58 | // -----------------------------------------------------------------------
|
---|
59 | //@{
|
---|
60 | /**
|
---|
61 | * getGrammarType
|
---|
62 | *
|
---|
63 | */
|
---|
64 | virtual Grammar::GrammarType getGrammarType() const = 0;
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * getGrammarKey
|
---|
68 | *
|
---|
69 | */
|
---|
70 | virtual const XMLCh* getGrammarKey() const = 0;
|
---|
71 | //@}
|
---|
72 |
|
---|
73 | inline MemoryManager* getMemoryManager() const;
|
---|
74 |
|
---|
75 | /***
|
---|
76 | * Support for Serialization/De-serialization
|
---|
77 | ***/
|
---|
78 | DECL_XSERIALIZABLE(XMLGrammarDescription)
|
---|
79 |
|
---|
80 | protected :
|
---|
81 | // -----------------------------------------------------------------------
|
---|
82 | /** Hidden Constructors */
|
---|
83 | // -----------------------------------------------------------------------
|
---|
84 | //@{
|
---|
85 | XMLGrammarDescription(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
|
---|
86 | //@}
|
---|
87 |
|
---|
88 | private :
|
---|
89 | // -----------------------------------------------------------------------
|
---|
90 | /** name Unimplemented copy constructor and operator= */
|
---|
91 | // -----------------------------------------------------------------------
|
---|
92 | //@{
|
---|
93 | XMLGrammarDescription(const XMLGrammarDescription& );
|
---|
94 | XMLGrammarDescription& operator=(const XMLGrammarDescription& );
|
---|
95 | //@}
|
---|
96 |
|
---|
97 | // -----------------------------------------------------------------------
|
---|
98 | //
|
---|
99 | // fMemMgr: plugged-in (or defaulted-in) memory manager,
|
---|
100 | // not owned
|
---|
101 | // no reset after initialization
|
---|
102 | // allow derivatives to access directly
|
---|
103 | //
|
---|
104 | // -----------------------------------------------------------------------
|
---|
105 | MemoryManager* const fMemMgr;
|
---|
106 | };
|
---|
107 |
|
---|
108 | inline MemoryManager* XMLGrammarDescription::getMemoryManager() const
|
---|
109 | {
|
---|
110 | return fMemMgr;
|
---|
111 | }
|
---|
112 |
|
---|
113 | XERCES_CPP_NAMESPACE_END
|
---|
114 |
|
---|
115 | #endif
|
---|