📄 properties.h
字号:
/*************************************************************************** properties.h - description ------------------- copyright : (C) 2004 by Matt Grover email : mgrover@amygdala.org ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#ifndef PROPERTIES_H#define PROPERTIES_H#include <amygdala/amygdalaclass.h>#include <string>#include <vector>#include <map>#include <utility>namespace Amygdala {/** * @class Properties properties.h amygdala/properties.h * Because related classes in Amygdala can have completely different data members, * property classes are used to provide a consistent interface when building objects. For example, * FastNeuron has a single time constant that controls its behavior, whereas AlphaNeuron uses * three time constants. Rather than requiring users to pass class-specific variables to * constructors or factory functions, Amygdala uses property classes as factory function * arguments. All of the variables that a neuron requires to function are defined in a Property * class. If a class hierarchy uses Property classes, then each class in that hierarchy will * have its own Properties class defined (FastNeuronProperties, StaticSynapseProperties, etc). * @author Matt Grover (mgrover@amygdala.org) */class Properties: public AmygdalaClass{public: Properties(); /** Copy constructor */ Properties(const Properties& rhs); virtual ~Properties() = 0; /** Set a property value * @param name Property name * @param value Property value */ virtual void SetProperty(const std::string& name, const std::string& value) = 0; /** @return A map of property names and their associated values converted * to strings. */ virtual std::map< std::string, std::string > GetPropertyMap() const = 0;protected:};class PropertyNotFoundException: public AmygdalaClass{public: PropertyNotFoundException(std::string propertyName):AmygdalaClass(),propName(propertyName) {} ~PropertyNotFoundException() {} std::string& GetPropertyName() const { return propName; }private: std::string& propName;};} // namespace Amygdala#endif // PROPERTIES_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -