Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ApplyVisitor.cxx

00001 /*
00002  * Copyright 2001 by Eric M. Hopper <hopper@omnifarious.mn.org>
00003  * 
00004  *     This program is free software; you can redistribute it and/or modify it
00005  *     under the terms of the GNU Lesser General Public License as published
00006  *     by the Free Software Foundation; either version 2 of the License, or
00007  *     (at your option) any later version.
00008  * 
00009  *     This program is distributed in the hope that it will be useful, but
00010  *     WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *     Lesser General Public License for more details.
00013  * 
00014  *     You should have received a copy of the GNU Lesser General Public
00015  *     License along with this program; if not, write to the Free Software
00016  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 /* $Header: /home/hopper/src/cvs/C++/StrMod/ApplyVisitor.cxx,v 1.3 2001/09/23 22:40:41 hopper Exp $ */
00020 
00021 // For a log, see ChangeLog
00022 
00023 #ifdef __GNUG__
00024 #  pragma implementation "ApplyVisitor.h"
00025 #endif
00026 
00027 #include "StrMod/ApplyVisitor.h"
00028 #include "StrMod/StrSubChunk.h"
00029 #include "StrMod/StrChunkPtr.h"
00030 
00031 namespace strmod {
00032 namespace strmod {
00033 
00034 const STR_ClassIdent ApplyVisitor_Base::identifier(51UL);
00035 
00036 ApplyVisitor_Base::ApplyVisitor_Base(const StrChunkPtr &chunk)
00037      : UseTrackingVisitor(true), chunk_(chunk), extent_used_(false)
00038 {
00039 }
00040 
00041 ApplyVisitor_Base::ApplyVisitor_Base(const StrChunkPtr &chunk,
00042                                      LinearExtent &extent)
00043      : UseTrackingVisitor(true), chunk_(chunk),
00044        extent_used_(true), extent_(extent)
00045 {
00046 }
00047 
00048 void ApplyVisitor_Base::apply()
00049 {
00050    if (extent_used_)
00051    {
00052       StrSubChunk mychunk(chunk_, extent_);
00053       mychunk.AddReference();
00054       startVisit(&mychunk);
00055    }
00056    else
00057    {
00058       startVisit(chunk_);
00059    }
00060 }
00061 
00062 };  // End namespace strmod
00063 };  // End namespace strmod

Generated on Wed Jan 29 00:32:43 2003 for libNet by doxygen1.3-rc1