1*7b6bd0c4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*7b6bd0c4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*7b6bd0c4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*7b6bd0c4SAndrew Rist  * distributed with this work for additional information
6*7b6bd0c4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*7b6bd0c4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*7b6bd0c4SAndrew Rist  * "License"); you may not use this file except in compliance
9*7b6bd0c4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*7b6bd0c4SAndrew Rist  *
11*7b6bd0c4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*7b6bd0c4SAndrew Rist  *
13*7b6bd0c4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*7b6bd0c4SAndrew Rist  * software distributed under the License is distributed on an
15*7b6bd0c4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7b6bd0c4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*7b6bd0c4SAndrew Rist  * specific language governing permissions and limitations
18*7b6bd0c4SAndrew Rist  * under the License.
19*7b6bd0c4SAndrew Rist  *
20*7b6bd0c4SAndrew Rist  *************************************************************/
21*7b6bd0c4SAndrew Rist 
22*7b6bd0c4SAndrew Rist 
23cdf0e10cSrcweir #ifndef _XMLSEARCH_QE_DOCGENERATOR_HXX_
24cdf0e10cSrcweir #define _XMLSEARCH_QE_DOCGENERATOR_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <rtl/ref.hxx>
27cdf0e10cSrcweir #ifndef _RTL_USTRING_HXX__
28cdf0e10cSrcweir #include  <rtl/ustring.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include <excep/XmlSearchExceptions.hxx>
31cdf0e10cSrcweir #include <util/CompressorIterator.hxx>
32cdf0e10cSrcweir #include <util/Decompressor.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace xmlsearch {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir 	namespace qe {
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 		class Query;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 		class NonnegativeIntegerGenerator
44cdf0e10cSrcweir 		{
45cdf0e10cSrcweir 		public:
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 			static const sal_Int32 END;
48cdf0e10cSrcweir 
~NonnegativeIntegerGenerator()49cdf0e10cSrcweir 			virtual ~NonnegativeIntegerGenerator() { };
50cdf0e10cSrcweir 			virtual sal_Int32 first() throw( xmlsearch::excep::XmlSearchException ) = 0;
51cdf0e10cSrcweir 			virtual sal_Int32 next() throw( xmlsearch::excep::XmlSearchException ) = 0;
52cdf0e10cSrcweir 		};
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 		class RoleFiller
56cdf0e10cSrcweir 		{
57cdf0e10cSrcweir 		public:
58cdf0e10cSrcweir 
STOP()59cdf0e10cSrcweir 			static RoleFiller* STOP() { return &roleFiller_; }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 			RoleFiller();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 			~RoleFiller();
64cdf0e10cSrcweir 
acquire()65cdf0e10cSrcweir 			void acquire() { ++m_nRefcount; }
release()66cdf0e10cSrcweir 			void release() { if( ! --m_nRefcount ) delete this; }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		private:
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 			static RoleFiller roleFiller_;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 			sal_uInt32     m_nRefcount;
73cdf0e10cSrcweir 			sal_uInt8      fixedRole_;
74cdf0e10cSrcweir 			sal_Int16      filled_;
75cdf0e10cSrcweir 			sal_Int32      begin_,end_,parentContext_,limit_;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 			RoleFiller*    next_;
78cdf0e10cSrcweir 			std::vector< RoleFiller* > fillers_;
79cdf0e10cSrcweir 		};
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 		class GeneratorHeap
83cdf0e10cSrcweir 		{
84cdf0e10cSrcweir 		public:
85cdf0e10cSrcweir 
GeneratorHeap()86cdf0e10cSrcweir 			GeneratorHeap()
87cdf0e10cSrcweir 				: heapSize_( 0 ),
88cdf0e10cSrcweir 				  free_( 0 )
89cdf0e10cSrcweir 			{ }
90cdf0e10cSrcweir 		private:
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 			sal_Int32   heapSize_,free_;
93cdf0e10cSrcweir 		};
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	}
98cdf0e10cSrcweir }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir #endif
101