From d0d14c3ff845145aa67cb3a2bff08039c74aa020 Mon Sep 17 00:00:00 2001 From: evomarc Date: Sat, 8 Sep 2001 05:59:17 +0000 Subject: [PATCH] Removed trailing string after #endif - it generates a lot of useless warning on some versions of g++ --- eo/src/EO.h | 2 +- eo/src/eoDetTournamentSelect.h | 2 +- eo/src/eoEasyEA.h | 2 +- eo/src/eoFactory.h | 92 ++++++++-------- eo/src/eoGeneralBreeder.h | 2 +- eo/src/eoObject.h | 2 +- eo/src/eoOpSelMason.h | 166 ++++++++++++++--------------- eo/src/eoPersistent.h | 2 +- eo/src/eoPrintable.h | 2 +- eo/src/eoProportionalSelect.h | 3 +- eo/src/eoRandomSelect.h | 2 +- eo/src/eoRankingSelect.h | 3 +- eo/src/eoReduce.h | 2 +- eo/src/eoSelectFactory.h | 2 +- eo/src/eoStochTournamentSelect.h | 2 +- eo/src/es.h | 6 +- eo/src/es/eoNormalMutation.h | 2 +- eo/src/es/eoRealOp.h | 2 +- eo/src/ga.h | 6 +- eo/src/ga/eoBitOp.h | 4 +- eo/src/ga/eoBitOpFactory.h | 2 +- eo/src/utils/eoData.h | 2 +- eo/src/utils/eoGnuplot.h | 4 +- eo/src/utils/eoGnuplot1DMonitor.h | 2 +- eo/src/utils/eoGnuplot1DSnapshot.h | 2 +- 25 files changed, 154 insertions(+), 164 deletions(-) diff --git a/eo/src/EO.h b/eo/src/EO.h index a6d32d77..82a2a2b1 100644 --- a/eo/src/EO.h +++ b/eo/src/EO.h @@ -130,4 +130,4 @@ private: //----------------------------------------------------------------------------- -#endif EO_H +#endif diff --git a/eo/src/eoDetTournamentSelect.h b/eo/src/eoDetTournamentSelect.h index df25ff45..9c6d6cd1 100755 --- a/eo/src/eoDetTournamentSelect.h +++ b/eo/src/eoDetTournamentSelect.h @@ -69,5 +69,5 @@ template class eoDetTournamentSelect: public eoSelectOne //----------------------------------------------------------------------------- -#endif eoDetTournamentSelect_h +#endif // eoDetTournamentSelect_h diff --git a/eo/src/eoEasyEA.h b/eo/src/eoEasyEA.h index b675ea78..e2ad1b5d 100644 --- a/eo/src/eoEasyEA.h +++ b/eo/src/eoEasyEA.h @@ -206,5 +206,5 @@ template class eoEasyEA: public eoAlgo //----------------------------------------------------------------------------- -#endif eoSelectTransformReduce_h +#endif diff --git a/eo/src/eoFactory.h b/eo/src/eoFactory.h index 05f9f8a4..f755036e 100644 --- a/eo/src/eoFactory.h +++ b/eo/src/eoFactory.h @@ -1,7 +1,7 @@ -// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- - +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + //----------------------------------------------------------------------------- -// eoFactory.h +// eoFactory.h // (c) GeNeura Team, 1998 /* This library is free software; you can redistribute it and/or @@ -24,49 +24,49 @@ #ifndef _EOFACTORY_H #define _EOFACTORY_H - -//----------------------------------------------------------------------------- -#include //----------------------------------------------------------------------------- - -/** EO Factory. A factory is used to create other objects. In particular, -it can be used so that objects of that kind canīt be created in any other -way. It should be instantiated with anything that needs a factory, like selectors -or whatever; but the instance class should be the parent class from which all the -object that are going to be created descend. This class basically defines an interface, -as usual. The base factory class for each hierarchy should be redefined every time a new -object is added to the hierarchy, which is not too good, but in any case, some code would -have to be modified*/ -template -class eoFactory: public eoObject { - -public: - - /// @name ctors and dtors - //{@ - /// constructor - eoFactory( ) {} - - /// destructor - virtual ~eoFactory() {} - //@} - - /** Another factory methods: creates an object from an istream, reading from - it whatever is needed to create the object. Usually, the format for the istream will be\\ - objectType parameter1 parameter2 ... parametern\\ - */ - virtual EOClass* make(istream& _is) = 0; - - ///@name eoObject methods - //@{ - /** Return the class id */ - virtual string className() const { return "eoFactory"; } - - /** Read and print are left without implementation */ - //@} - -}; - +#include -#endif _EOFACTORY_H +//----------------------------------------------------------------------------- + +/** EO Factory. A factory is used to create other objects. In particular, +it can be used so that objects of that kind canīt be created in any other +way. It should be instantiated with anything that needs a factory, like selectors +or whatever; but the instance class should be the parent class from which all the +object that are going to be created descend. This class basically defines an interface, +as usual. The base factory class for each hierarchy should be redefined every time a new +object is added to the hierarchy, which is not too good, but in any case, some code would +have to be modified*/ +template +class eoFactory: public eoObject { + +public: + + /// @name ctors and dtors + //{@ + /// constructor + eoFactory( ) {} + + /// destructor + virtual ~eoFactory() {} + //@} + + /** Another factory methods: creates an object from an istream, reading from + it whatever is needed to create the object. Usually, the format for the istream will be\\ + objectType parameter1 parameter2 ... parametern\\ + */ + virtual EOClass* make(istream& _is) = 0; + + ///@name eoObject methods + //@{ + /** Return the class id */ + virtual string className() const { return "eoFactory"; } + + /** Read and print are left without implementation */ + //@} + +}; + + +#endif diff --git a/eo/src/eoGeneralBreeder.h b/eo/src/eoGeneralBreeder.h index 3f1ac663..878955a8 100644 --- a/eo/src/eoGeneralBreeder.h +++ b/eo/src/eoGeneralBreeder.h @@ -102,5 +102,5 @@ class eoGeneralBreeder: public eoBreed eoHowMany howMany; }; -#endif eoBreeder_h +#endif diff --git a/eo/src/eoObject.h b/eo/src/eoObject.h index 544e8251..69a6b388 100644 --- a/eo/src/eoObject.h +++ b/eo/src/eoObject.h @@ -73,5 +73,5 @@ class eoObject }; -#endif EOOBJECT_H +#endif diff --git a/eo/src/eoOpSelMason.h b/eo/src/eoOpSelMason.h index 3f96d822..44089827 100644 --- a/eo/src/eoOpSelMason.h +++ b/eo/src/eoOpSelMason.h @@ -1,7 +1,7 @@ -// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- - +// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- + //----------------------------------------------------------------------------- -// eoOpSelMason.h +// eoOpSelMason.h // (c) GeNeura Team, 1999 /* This library is free software; you can redistribute it and/or @@ -24,86 +24,86 @@ #ifndef _EOOPSELMASON_H #define _EOOPSELMASON_H - -//----------------------------------------------------------------------------- -#include -#include // for eoFactory and eoOpFactory - -#include //----------------------------------------------------------------------------- - -/** EO Mason, or builder, for operator selectors. A builder must allocate memory -to the objects it builds, and then deallocate it when it gets out of scope*/ -template -class eoOpSelMason: public eoFactory > { - -public: - typedef vector* > vOpP; - typedef map*, vOpP > MEV; - - /// @name ctors and dtors - //{@ - /// constructor - eoOpSelMason( eoOpFactory& _opFact): operatorFactory( _opFact ) {}; - - /// destructor - virtual ~eoOpSelMason() {}; - //@} - - /** Factory methods: creates an object from an istream, reading from - it whatever is needed to create the object. The format is - opSelClassName\\ - rate 1 operator1\\ - rate 2 operator2\\ - ...\\ - Stores all operators built in a database (#allocMap#), so that somebody - can destroy them later. The Mason is in charge or destroying the operators, - since the built object canīt do it itself. The objects built must be destroyed - from outside, using the #destroy# method - */ - virtual eoOpSelector* make(istream& _is) { - - string opSelName; - _is >> opSelName; - eoOpSelector* opSelectorP; - // Build the operator selector - if ( opSelName == "eoProportionalOpSel" ) { - opSelectorP = new eoProportionalOpSel(); - } - - // Temp vector for storing pointers - vOpP tmpPVec; - // read operator rate and name - while ( _is ) { - float rate; - _is >> rate; - if ( _is ) { - eoOp* op = operatorFactory.make( _is ); // This reads the rest of the line - // Add the operators to the selector, donīt pay attention to the IDs - opSelectorP->addOp( *op, rate ); - // Keep it in the store, to destroy later - tmpPVec.push_back( op ); - } // if - } // while - - // Put it in the map - allocMap.insert( MEV::value_type( opSelectorP, tmpPVec ) ); - - return opSelectorP; - }; - - ///@name eoObject methods - //@{ - /** Return the class id */ - virtual string className() const { return "eoOpSelMason"; } - - //@} - -private: - map*,vector* > > allocMap; - eoOpFactory& operatorFactory; -}; - +#include +#include // for eoFactory and eoOpFactory -#endif _EOOPSELMASON_H +#include + +//----------------------------------------------------------------------------- + +/** EO Mason, or builder, for operator selectors. A builder must allocate memory +to the objects it builds, and then deallocate it when it gets out of scope*/ +template +class eoOpSelMason: public eoFactory > { + +public: + typedef vector* > vOpP; + typedef map*, vOpP > MEV; + + /// @name ctors and dtors + //{@ + /// constructor + eoOpSelMason( eoOpFactory& _opFact): operatorFactory( _opFact ) {}; + + /// destructor + virtual ~eoOpSelMason() {}; + //@} + + /** Factory methods: creates an object from an istream, reading from + it whatever is needed to create the object. The format is + opSelClassName\\ + rate 1 operator1\\ + rate 2 operator2\\ + ...\\ + Stores all operators built in a database (#allocMap#), so that somebody + can destroy them later. The Mason is in charge or destroying the operators, + since the built object canīt do it itself. The objects built must be destroyed + from outside, using the #destroy# method + */ + virtual eoOpSelector* make(istream& _is) { + + string opSelName; + _is >> opSelName; + eoOpSelector* opSelectorP; + // Build the operator selector + if ( opSelName == "eoProportionalOpSel" ) { + opSelectorP = new eoProportionalOpSel(); + } + + // Temp vector for storing pointers + vOpP tmpPVec; + // read operator rate and name + while ( _is ) { + float rate; + _is >> rate; + if ( _is ) { + eoOp* op = operatorFactory.make( _is ); // This reads the rest of the line + // Add the operators to the selector, donīt pay attention to the IDs + opSelectorP->addOp( *op, rate ); + // Keep it in the store, to destroy later + tmpPVec.push_back( op ); + } // if + } // while + + // Put it in the map + allocMap.insert( MEV::value_type( opSelectorP, tmpPVec ) ); + + return opSelectorP; + }; + + ///@name eoObject methods + //@{ + /** Return the class id */ + virtual string className() const { return "eoOpSelMason"; } + + //@} + +private: + map*,vector* > > allocMap; + eoOpFactory& operatorFactory; +}; + + +#endif diff --git a/eo/src/eoPersistent.h b/eo/src/eoPersistent.h index e10edb93..c6f83838 100644 --- a/eo/src/eoPersistent.h +++ b/eo/src/eoPersistent.h @@ -70,5 +70,5 @@ class eoPersistent: public eoPrintable ///Standard input for all objects in the EO hierarchy istream & operator >> ( istream& _is, eoPersistent& _o ); -#endif EOOBJECT_H +#endif diff --git a/eo/src/eoPrintable.h b/eo/src/eoPrintable.h index bf7c4ccb..e416175d 100644 --- a/eo/src/eoPrintable.h +++ b/eo/src/eoPrintable.h @@ -59,5 +59,5 @@ class eoPrintable ///Standard output for all objects in the EO hierarchy ostream & operator << ( ostream& _os, const eoPrintable& _o ); -#endif EOPRINTABLE_H +#endif diff --git a/eo/src/eoProportionalSelect.h b/eo/src/eoProportionalSelect.h index 36a0da26..d870dcaf 100755 --- a/eo/src/eoProportionalSelect.h +++ b/eo/src/eoProportionalSelect.h @@ -67,5 +67,4 @@ private : typename EOT::Fitness total; }; -#endif - +#endif diff --git a/eo/src/eoRandomSelect.h b/eo/src/eoRandomSelect.h index ada1ac53..b8c5da6c 100644 --- a/eo/src/eoRandomSelect.h +++ b/eo/src/eoRandomSelect.h @@ -138,5 +138,5 @@ private: unsigned current; }; -#endif eoRandomSelect_h +#endif diff --git a/eo/src/eoRankingSelect.h b/eo/src/eoRankingSelect.h index 79104b71..6f070cb9 100644 --- a/eo/src/eoRankingSelect.h +++ b/eo/src/eoRankingSelect.h @@ -52,5 +52,4 @@ private : eoRanking ranking; // derived from eoPerf2Worth }; -#endif - +#endif diff --git a/eo/src/eoReduce.h b/eo/src/eoReduce.h index 4c0ff77c..85675a6c 100644 --- a/eo/src/eoReduce.h +++ b/eo/src/eoReduce.h @@ -270,4 +270,4 @@ private: //----------------------------------------------------------------------------- -#endif //eoInsertion_h +#endif diff --git a/eo/src/eoSelectFactory.h b/eo/src/eoSelectFactory.h index 1d83f5f4..aafb01a7 100644 --- a/eo/src/eoSelectFactory.h +++ b/eo/src/eoSelectFactory.h @@ -86,4 +86,4 @@ public: }; -#endif _EOFACTORY_H +#endif diff --git a/eo/src/eoStochTournamentSelect.h b/eo/src/eoStochTournamentSelect.h index 75a8b508..b0ba2ec9 100755 --- a/eo/src/eoStochTournamentSelect.h +++ b/eo/src/eoStochTournamentSelect.h @@ -69,5 +69,5 @@ private: //----------------------------------------------------------------------------- -#endif eoStochTournamentSelect_h +#endif diff --git a/eo/src/es.h b/eo/src/es.h index 360f48e7..84fd2c73 100644 --- a/eo/src/es.h +++ b/eo/src/es.h @@ -55,8 +55,4 @@ #include #include -#endif _es_h - -// Local Variables: -// mode: C++ -// End: +#endif diff --git a/eo/src/es/eoNormalMutation.h b/eo/src/es/eoNormalMutation.h index 4722a081..325d981c 100644 --- a/eo/src/es/eoNormalMutation.h +++ b/eo/src/es/eoNormalMutation.h @@ -178,5 +178,5 @@ private: //----------------------------------------------------------------------------- //@} -#endif eoRealOp_h +#endif diff --git a/eo/src/es/eoRealOp.h b/eo/src/es/eoRealOp.h index 1f7ee14d..06528cc2 100644 --- a/eo/src/es/eoRealOp.h +++ b/eo/src/es/eoRealOp.h @@ -502,4 +502,4 @@ template class eoRealUXover: public eoQuadOp //----------------------------------------------------------------------------- //@} -#endif eoRealOp_h +#endif diff --git a/eo/src/ga.h b/eo/src/ga.h index cbb71d72..87cc0e34 100644 --- a/eo/src/ga.h +++ b/eo/src/ga.h @@ -39,8 +39,4 @@ //----------------------------------------------------------------------------- -#endif _ga_h - -// Local Variables: -// mode: C++ -// End: +#endif diff --git a/eo/src/ga/eoBitOp.h b/eo/src/ga/eoBitOp.h index 3e691280..8ab78652 100644 --- a/eo/src/ga/eoBitOp.h +++ b/eo/src/ga/eoBitOp.h @@ -21,7 +21,7 @@ Contact: todos@geneura.ugr.es, http://geneura.ugr.es Marc.Schoenauer@polytechnique.fr mak@dhi.dk - CVS Info: $Date: 2001-05-10 12:16:00 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/ga/eoBitOp.h,v 1.13 2001-05-10 12:16:00 jmerelo Exp $ $Author: jmerelo $ + CVS Info: $Date: 2001-09-08 05:59:17 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/ga/eoBitOp.h,v 1.14 2001-09-08 05:59:17 evomarc Exp $ $Author: evomarc $ */ //----------------------------------------------------------------------------- @@ -440,5 +440,5 @@ template class eoBitGxOver: public eoQuadOp //----------------------------------------------------------------------------- //@} -#endif eoBitOp_h +#endif diff --git a/eo/src/ga/eoBitOpFactory.h b/eo/src/ga/eoBitOpFactory.h index 5c0273c4..9ec142bd 100644 --- a/eo/src/ga/eoBitOpFactory.h +++ b/eo/src/ga/eoBitOpFactory.h @@ -166,5 +166,5 @@ public: }; -#endif _EOBITOPFACTORY_H +#endif diff --git a/eo/src/utils/eoData.h b/eo/src/utils/eoData.h index b7327687..7e6d256b 100644 --- a/eo/src/utils/eoData.h +++ b/eo/src/utils/eoData.h @@ -76,5 +76,5 @@ using namespace std; #define eo_is_a_rate true #define eo_is_an_integer false -#endif EODATA_H +#endif diff --git a/eo/src/utils/eoGnuplot.h b/eo/src/utils/eoGnuplot.h index fb5a5c3a..24efca0e 100644 --- a/eo/src/utils/eoGnuplot.h +++ b/eo/src/utils/eoGnuplot.h @@ -129,7 +129,7 @@ inline void eoGnuplot::initGnuPlot(std::string _title, std::string _extra) * Created......: Mon Mar 13 13:50:11 1995 * Description..: Communication par pipe bidirectionnel avec un autre process * - * Ident........: $Id: eoGnuplot.h,v 1.3 2001-02-12 13:58:51 maartenkeijzer Exp $ + * Ident........: $Id: eoGnuplot.h,v 1.4 2001-09-08 05:59:17 evomarc Exp $ * ---------------------------------------------------------------------- */ @@ -282,4 +282,4 @@ inline int PipeComWaitFor( PCom *from, char *what ) } -#endif _eoGnuplot_H +#endif diff --git a/eo/src/utils/eoGnuplot1DMonitor.h b/eo/src/utils/eoGnuplot1DMonitor.h index e7550875..2f5e3bfc 100644 --- a/eo/src/utils/eoGnuplot1DMonitor.h +++ b/eo/src/utils/eoGnuplot1DMonitor.h @@ -119,4 +119,4 @@ inline void eoGnuplot1DMonitor::FirstPlot() PipeComSend( gpCom, buff ); } -#endif _eoGnuplot1DMonitor_H +#endif diff --git a/eo/src/utils/eoGnuplot1DSnapshot.h b/eo/src/utils/eoGnuplot1DSnapshot.h index efb9c323..3c064960 100644 --- a/eo/src/utils/eoGnuplot1DSnapshot.h +++ b/eo/src/utils/eoGnuplot1DSnapshot.h @@ -108,4 +108,4 @@ inline eoMonitor& eoGnuplot1DSnapshot::operator() (void) return (*this); } -#endif _eoGnuplot1DSnapshot_H +#endif