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

instruction_tag_string.hh

00001 /*
00002 *  Name:      instruction_tag_string.hh
00003 *  Author:    Rafael Jesus Alcantara Perez
00004 *  Summary:   Instruction-tag string
00005 *  Date:      $Date: 2003/04/14 00:18:32 $
00006 *  Revision:  $Revision: 1.1 $
00007 *
00008 *  Copyright (C) 1994-2002  Rafael Jesus Alcantara Perez <rafa@dedalo-ing.com>
00009 *
00010 *  This program is free software; you can redistribute it and/or modify
00011 *  it under the terms of the GNU General Public License as published by
00012 *  the Free Software Foundation; either version 2 of the License, or
00013 *  (at your option) any later version.
00014 *
00015 *  This program is distributed in the hope that it will be useful,
00016 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 *  GNU General Public License for more details.
00019 *
00020 *  You should have received a copy of the GNU General Public License
00021 *  along with this program; if not, write to the Free Software
00022 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00023 *  MA 02111-1307, USA.
00024 */
00025 
00026 #ifndef _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__
00027 #define _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__
00028 
00029 #include "../../io/streamable.hh"
00030 #include "../regex/matcher.hh"
00031 #include "../string.hh"
00032 
00033 
00035 namespace mpcl
00036 {
00037 
00039   namespace text
00040   {
00041 
00043     namespace codegen
00044     {
00045 
00046       using io::IStreamable;
00047       using std::basic_istream;
00048       using std::basic_ostream;
00049 
00051       class TInstructionTagString;
00052 
00057       template <typename TChar, typename TTraits>
00058       basic_istream<TChar, TTraits>&
00059       operator >> ( basic_istream<TChar, TTraits>& rtSOURCE_ISTREAM         ,
00060                     TInstructionTagString&         ryTARGET_INSTRUCTION_TAG );
00061 
00066       template <typename TChar, typename TTraits>
00067       basic_ostream<TChar, TTraits>&
00068       operator << ( basic_ostream<TChar, TTraits>& rtSOURCE_OSTREAM          ,
00069                     const TInstructionTagString&   rkySOURCE_INSTRUCTION_TAG );
00070 
00075       class TInstructionTagString :
00076         public TString            ,
00077         public IStreamable<>
00078       {
00079 
00080         public:
00081 
00083           typedef
00084             IStreamable<>::char_type
00085             char_type;
00086 
00088           typedef
00089             IStreamable<>::traits_type
00090             traits_type;
00091 
00092 
00093         public:
00094 
00095           //
00096           //  C O N S T R U C T O R S
00097           //
00098 
00100           TInstructionTagString (void) :
00101             TString       ()           ,
00102             IStreamable<> ()           {}
00103 
00108           TInstructionTagString (const char* pkcSOURCE_TEXT) :
00109             TString       (pkcSOURCE_TEXT)                   ,
00110             IStreamable<> ()                                 {}
00111 
00116           TInstructionTagString (const TInstructionTagString& rkySOURCE_INSTRUCTION_TAG) :
00117             TString       (rkySOURCE_INSTRUCTION_TAG)                                    ,
00118             IStreamable<> ()                                                             {}
00119 
00120 
00121         protected:
00122 
00123           //
00124           //  C O N S T R U C T O R S
00125           //
00126 
00131           void read (basic_istream<char_type, traits_type>& rtSOURCE_ISTREAM);
00132 
00133 
00134         protected:
00135 
00136           //
00137           //  S E L E C T O R S
00138           //
00139 
00141           void write (basic_ostream<char_type, traits_type>& rtTARGET_OSTREAM) const;
00142 
00143 
00144         public:
00145 
00146           //
00147           //  F R I E N D   F U N C T I O N S
00148           //
00149 
00150           friend basic_istream<value_type, traits_type>&
00151           operator >> <value_type, traits_type>
00152           (
00153             basic_istream<value_type, traits_type>& rtSOURCE_ISTREAM         ,
00154             TInstructionTagString&                  ryTARGET_INSTRUCTION_TAG
00155           );
00156 
00157           friend basic_ostream<value_type, traits_type>&
00158           operator << <value_type, traits_type>
00159           (
00160             basic_ostream<value_type, traits_type>& rtSOURCE_OSTREAM          ,
00161             const TInstructionTagString&            rkySOURCE_INSTRUCTION_TAG
00162           );
00163 
00164       };  // class TInstructionTagString
00165 
00166       //
00167       //  F R I E N D   F U N C T I O N S
00168       //
00169 
00170       template <typename TChar, typename TTraits>
00171       basic_istream<TChar, TTraits>&
00172       operator >> ( basic_istream<TChar, TTraits>& rtSOURCE_ISTREAM         ,
00173                     TInstructionTagString&         ryTARGET_INSTRUCTION_TAG )
00174       {
00175         ryTARGET_INSTRUCTION_TAG.read (rtSOURCE_ISTREAM);
00176         return rtSOURCE_ISTREAM;
00177       }
00178 
00179       template <typename TChar, typename TTraits>
00180       basic_ostream<TChar, TTraits>&
00181       operator << ( basic_ostream<TChar, TTraits>& rtSOURCE_OSTREAM          ,
00182                     const TInstructionTagString&   rkySOURCE_INSTRUCTION_TAG )
00183       {
00184         rkySOURCE_INSTRUCTION_TAG.write (rtSOURCE_OSTREAM);
00185         return rtSOURCE_OSTREAM;
00186       }
00187 
00188     }  // namespace codegen
00189 
00190   }  // namespace text
00191 
00192 }  // namespace mpcl
00193 
00194 
00195 #endif  // not _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__

Generated on Mon Oct 13 02:35:23 2003 for MPCL by doxygen1.2.18