1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ADC_CPP_CX_BASE_HXX
25 #define ADC_CPP_CX_BASE_HXX
26 
27 // USED SERVICES
28 	// BASE CLASSES
29 #include <tokens/tkpcontx.hxx>
30 	// COMPONENTS
31 	// PARAMETERS
32 
33 
34 class TextToken;
35 
36 
37 namespace cpp
38 {
39 
40 class Distributor;
41 
42 
43 class Cx_Base : public ::TkpContext
44 {
45   public:
46 	virtual bool		PassNewToken();
47 	virtual TkpContext &
48 						FollowUpContext();
49 
50     virtual void        AssignDealer(
51                             Distributor &       o_rDealer );
52   protected:
53 	// LIFECYCLE
54 						Cx_Base(
55 							TkpContext *		io_pFollowUpContext );
56 
57 	void				SetNewToken(
58 							DYN ::TextToken *	let_dpToken );
59 	void				SetFollowUpContext(
60 							TkpContext  *	    io_pContext );
61 
62     Distributor &       Dealer() const;
63 
64   private:
65 	// DATA
66 	Distributor *		pDealer;
67 	TkpContext *		pFollowUpContext;
68 	Dyn< ::TextToken >	pNewToken;
69 };
70 
71 
72 
73 
74 inline void
SetNewToken(DYN::TextToken * let_dpToken)75 Cx_Base::SetNewToken( DYN ::TextToken *	let_dpToken )
76     { pNewToken = let_dpToken; }
77 inline void
SetFollowUpContext(TkpContext * io_pContext)78 Cx_Base::SetFollowUpContext( TkpContext * io_pContext )
79     { pFollowUpContext = io_pContext; }
80 inline Distributor &
Dealer() const81 Cx_Base::Dealer() const
82     { csv_assert(pDealer != 0);
83       return *pDealer; }
84 
85 
86 
87 
88 
89 } // namespace cpp
90 
91 #endif
92 
93