📄 eofactory.h
字号:
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-//-----------------------------------------------------------------------------// eoFactory.h// (c) GeNeura Team, 1998/* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: todos@geneura.ugr.es, http://geneura.ugr.es *///-----------------------------------------------------------------------------#ifndef _EOFACTORY_H#define _EOFACTORY_H//-----------------------------------------------------------------------------#include <eoObject.h>//-----------------------------------------------------------------------------/** EO Factory. A factory is used to create other objects. In particular,it can be used so that objects of that kind can磘 be created in any otherway. It should be instantiated with anything that needs a factory, like selectorsor whatever; but the instance class should be the parent class from which all theobject 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 newobject is added to the hierarchy, which is not too good, but in any case, some code wouldhave to be modified*/template<class EOClass>class eoFactory: public eoObject { public: /// @name ctors and dtors //{@ /// constructor eoFactory( ) {} /// destructor virtual ~eoFactory() {} //@} /** Another factory methods: creates an object from an std::istream, reading from it whatever is needed to create the object. Usually, the format for the std::istream will be\\ objectType parameter1 parameter2 ... parametern\\ */ virtual EOClass* make(std::istream& _is) = 0; ///@name eoObject methods //@{ /** Return the class id */ virtual std::string className() const { return "eoFactory"; } /** Read and print are left without implementation */ //@} };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -