1*1c78a5d6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1c78a5d6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1c78a5d6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1c78a5d6SAndrew Rist * distributed with this work for additional information 6*1c78a5d6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1c78a5d6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1c78a5d6SAndrew Rist * "License"); you may not use this file except in compliance 9*1c78a5d6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*1c78a5d6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*1c78a5d6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1c78a5d6SAndrew Rist * software distributed under the License is distributed on an 15*1c78a5d6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1c78a5d6SAndrew Rist * KIND, either express or implied. See the License for the 17*1c78a5d6SAndrew Rist * specific language governing permissions and limitations 18*1c78a5d6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*1c78a5d6SAndrew Rist *************************************************************/ 21*1c78a5d6SAndrew Rist 22*1c78a5d6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef ADC_CPP_SDOCDIST_HXX 25cdf0e10cSrcweir #define ADC_CPP_SDOCDIST_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir 28cdf0e10cSrcweir 29cdf0e10cSrcweir // USED SERVICES 30cdf0e10cSrcweir // BASE CLASSES 31cdf0e10cSrcweir #include "cxt2ary.hxx" 32cdf0e10cSrcweir #include <ary/info/docstore.hxx> 33cdf0e10cSrcweir // COMPONENTS 34cdf0e10cSrcweir // PARAMETERS 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace cpp 37cdf0e10cSrcweir { 38cdf0e10cSrcweir 39cdf0e10cSrcweir using ary::Documentation; 40cdf0e10cSrcweir 41cdf0e10cSrcweir /** Implementation struct for cpp::ContextForAry. 42cdf0e10cSrcweir */ 43cdf0e10cSrcweir 44cdf0e10cSrcweir struct ContextForAry::S_DocuDistributor : public ary::info::DocuStore 45cdf0e10cSrcweir { 46cdf0e10cSrcweir public: 47cdf0e10cSrcweir S_DocuDistributor() : pCurRe(0) {} 48cdf0e10cSrcweir ~S_DocuDistributor() {} 49cdf0e10cSrcweir 50cdf0e10cSrcweir void Reset() { pCurRe = 0; pLastStoredDocu = 0; } 51cdf0e10cSrcweir 52cdf0e10cSrcweir void SetCurrentlyStoredRe( 53cdf0e10cSrcweir ary::cpp::CppEntity & 54cdf0e10cSrcweir io_rRe ); 55cdf0e10cSrcweir void Event_LineBreak(); 56cdf0e10cSrcweir 57cdf0e10cSrcweir private: 58cdf0e10cSrcweir // Interface ary::info::DocuStore 59cdf0e10cSrcweir virtual void do_Store2CurFile( 60cdf0e10cSrcweir DYN ary::doc::Node& let_drDocu ); 61cdf0e10cSrcweir virtual void do_Store2CurNamespace( 62cdf0e10cSrcweir DYN ary::doc::Node& let_drDocu ); 63cdf0e10cSrcweir 64cdf0e10cSrcweir virtual void do_Store2ConnectedDeclaration( 65cdf0e10cSrcweir DYN ary::doc::Node& let_drDocu ); 66cdf0e10cSrcweir 67cdf0e10cSrcweir virtual void do_Store2Glossary( 68cdf0e10cSrcweir DYN ary::doc::Node& let_drDocu, 69cdf0e10cSrcweir const String & i_sExplainedTerm ); 70cdf0e10cSrcweir virtual void do_Store2GlobalTexts( 71cdf0e10cSrcweir DYN ary::doc::Node& let_drDocu, 72cdf0e10cSrcweir ary::info::GlobalTextId 73cdf0e10cSrcweir i_nId ); 74cdf0e10cSrcweir // DATA 75cdf0e10cSrcweir ary::cpp::CppEntity * 76cdf0e10cSrcweir pCurRe; 77cdf0e10cSrcweir Dyn<ary::doc::Node> pLastStoredDocu; 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir 80cdf0e10cSrcweir 81cdf0e10cSrcweir // IMPLEMENTATION 82cdf0e10cSrcweir 83cdf0e10cSrcweir /* The implementation is in header, though not all inline, because this file 84cdf0e10cSrcweir is included in cxt2ary.cxx only! 85cdf0e10cSrcweir */ 86cdf0e10cSrcweir 87cdf0e10cSrcweir 88cdf0e10cSrcweir void 89cdf0e10cSrcweir ContextForAry:: 90cdf0e10cSrcweir S_DocuDistributor::SetCurrentlyStoredRe( ary::cpp::CppEntity & io_rRe ) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir pCurRe = &io_rRe; 93cdf0e10cSrcweir if ( pLastStoredDocu ) 94cdf0e10cSrcweir pCurRe->Set_Docu( *pLastStoredDocu.Release() ); 95cdf0e10cSrcweir } 96cdf0e10cSrcweir 97cdf0e10cSrcweir inline void 98cdf0e10cSrcweir ContextForAry:: 99cdf0e10cSrcweir S_DocuDistributor::Event_LineBreak() 100cdf0e10cSrcweir { 101cdf0e10cSrcweir pCurRe = 0; 102cdf0e10cSrcweir } 103cdf0e10cSrcweir 104cdf0e10cSrcweir void 105cdf0e10cSrcweir ContextForAry:: 106cdf0e10cSrcweir S_DocuDistributor::do_Store2CurFile( DYN ary::doc::Node & let_drDocu ) 107cdf0e10cSrcweir { 108cdf0e10cSrcweir // KORR_FUTURE 109cdf0e10cSrcweir delete &let_drDocu; 110cdf0e10cSrcweir } 111cdf0e10cSrcweir 112cdf0e10cSrcweir void 113cdf0e10cSrcweir ContextForAry:: 114cdf0e10cSrcweir S_DocuDistributor::do_Store2CurNamespace( DYN ary::doc::Node & let_drDocu ) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir // KORR_FUTURE 117cdf0e10cSrcweir delete &let_drDocu; 118cdf0e10cSrcweir } 119cdf0e10cSrcweir 120cdf0e10cSrcweir void 121cdf0e10cSrcweir ContextForAry:: 122cdf0e10cSrcweir S_DocuDistributor::do_Store2ConnectedDeclaration( DYN ary::doc::Node & let_drDocu ) 123cdf0e10cSrcweir { 124cdf0e10cSrcweir if ( pCurRe != 0 ) 125cdf0e10cSrcweir pCurRe->Set_Docu(let_drDocu); 126cdf0e10cSrcweir else 127cdf0e10cSrcweir pLastStoredDocu = &let_drDocu; 128cdf0e10cSrcweir } 129cdf0e10cSrcweir 130cdf0e10cSrcweir void 131cdf0e10cSrcweir ContextForAry:: 132cdf0e10cSrcweir S_DocuDistributor::do_Store2Glossary( DYN ary::doc::Node & let_drDocu, 133cdf0e10cSrcweir const String & // i_sExplainedTerm 134cdf0e10cSrcweir ) 135cdf0e10cSrcweir { 136cdf0e10cSrcweir // KORR_FUTURE 137cdf0e10cSrcweir delete &let_drDocu; 138cdf0e10cSrcweir } 139cdf0e10cSrcweir 140cdf0e10cSrcweir void 141cdf0e10cSrcweir ContextForAry:: 142cdf0e10cSrcweir S_DocuDistributor::do_Store2GlobalTexts( DYN ary::doc::Node & let_drDocu, 143cdf0e10cSrcweir ary::info::GlobalTextId // i_nId 144cdf0e10cSrcweir ) 145cdf0e10cSrcweir { 146cdf0e10cSrcweir // KORR_FUTURE 147cdf0e10cSrcweir delete &let_drDocu; 148cdf0e10cSrcweir } 149cdf0e10cSrcweir 150cdf0e10cSrcweir 151cdf0e10cSrcweir 152cdf0e10cSrcweir 153cdf0e10cSrcweir } // namespace cpp 154cdf0e10cSrcweir #endif 155