ConfigBuilder.h

00001 /*
00002  * ConfigBuilder.h - Rulbus Device builder for Rulbus configuration file.
00003  *
00004  * This file is part of the Rulbus Device Class Library (RDCL).
00005  *
00006  * Copyright (C) 2003-2004, Leiden University.
00007  *
00008  * This library is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * The library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with mngdriver; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  * $Id: ConfigBuilder.h 2 2004-10-12 11:54:15Z moene $
00023  */
00024 
00025 #ifndef __CONFIGBUILDER_H
00026 #define __CONFIGBUILDER_H
00027 
00028 #ifndef __COMMON_H
00029 #include "Common.h"
00030 #endif
00031 
00032 namespace Rulbus
00033 {
00034    DECLARE_CLASS( ConfigBuilder     );          
00035    DECLARE_CLASS( ConfigPrinter     );          
00036    DECLARE_CLASS( ConfigListBuilder );          
00037    DECLARE_CLASS( RulbusDevice        );        // declare
00038 
00051    class ConfigBuilder
00052    {
00053    public:
00058       virtual void add( RulbusDevicePtr ptr ) = 0;
00059 
00060       /*
00061        * check the built object for consistency.
00062        */
00063 
00064       virtual void check( ) const;
00065    };
00066 
00072    inline void ConfigBuilder::check( ) const
00073    {
00074       ; // do nothing
00075    }
00076 
00084    class ConfigListBuilder : public ConfigBuilder
00085    {
00086    public:
00087       ConfigListBuilder( );
00088 
00089       void add  ( RulbusDevicePtr ptr );
00090       void check(                     ) const;
00091 
00092    private:
00093    };
00094 
00102    class ConfigPrinter : public ConfigBuilder
00103    {
00104    public:                              // public methods
00105       ConfigPrinter( std::ostream& aStream );
00106 
00107       void add( RulbusDevicePtr ptr );
00108 
00109    private:
00110       std::ostream& theStream;          
00111    };
00112 
00113 } // namespace Rulbus
00114 
00115 #endif  // __CONFIGBUILDER_H
00116 
00117 /*
00118  * end of file
00119  */
00120 

Generated on Tue Oct 12 14:11:57 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4