00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CJND_CONSTANT_H_
00021 #define __CJND_CONSTANT_H_ 1
00022
00023 #include "CjNLTopology.hh"
00024 #include "CjNetworkDimensioner.hh"
00025 #include <string>
00026 #include <stdexcept>
00027
00028 namespace jmitie {
00029 namespace corelib {
00030 class CjND_constant : public CjNetworkDimensioner {
00031
00032 protected:
00033 CjNLTopology::WT m_defaultValue;
00034 bool m_redim;
00035
00036 public:
00037 static std::string getName_static() { return "const"; }
00038 std::string getName() const { return getName_static(); };
00039 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00040 static std::string getProperty_static(const std::string & opt) {
00041 if(opt=="desc") return "Sets the link to the constant value specified.";
00042 if(opt=="usage") return getProperty_static("desc") + "\n" + getName_static() + "=N\twhere N is an integer greater than 0\n";
00043 throw std::invalid_argument("CjND_constant::getProperty_static(" + opt + "): Unknown property requested.");
00044 }
00045
00046
00047 CjND_constant( const std::string & arg, const ctor_va_t & );
00048 virtual CjNLTopology::WT calcWeight( calcw_va_t & va, unsigned int, unsigned int );
00049 };
00050 }
00051 }
00052
00053 #endif // __CJND_CONSTANT_H_