src/Generator/Generator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Sverre Rabbelier                                *
00003  *   sverre@rabbelier.nl                                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 3 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #pragma once
00021 
00029 #include "Types.h"
00030 
00031 #include <fstream>
00032 
00033 
00041 class Generator
00042 {
00043 public:
00045         explicit Generator(const std::string& name);
00046         
00048         ~Generator();
00049         
00051         void GenerateDAL(TableDefVector::const_iterator begin, TableDefVector::const_iterator end);
00052 
00053 private:
00055         Generator(const Generator& rhs);
00056         
00058         Generator operator=(const Generator& rhs);
00059         
00060         void AppendLicense(std::ofstream& file);
00061         void AppendGeneratorNotice(std::ofstream& file);
00062         
00063         void AppendHeaderIncludes();
00064         void AppendHeaderClass(TableDefPtr table);
00065         void AppendHeaderFooter();
00066         void CreateHeader();
00067         
00068         void AppendSourceIncludes();
00069         void AppendSourceClass(TableDefPtr table);
00070         void AppendSourceFooter();
00071         void CreateSource();
00072         
00073         void AppendHeaderTableImpls();
00074         void AppendSourceTableImpls();
00075         void CreateTI();
00076         
00077         std::string m_name; 
00078         std::string m_fieldname; 
00079         std::string m_tablename; 
00080         std::string m_tabs; 
00081         std::ofstream m_headerfile; 
00082         std::ofstream m_sourcefile; 
00083         std::ofstream m_tiheaderfile; 
00084         std::ofstream m_tisourcefile; 
00086         TableDefVector::const_iterator m_begin; 
00087         TableDefVector::const_iterator m_end; 
00088 };

Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo