diff --git a/models/quantal_stp_synapse_impl.h b/models/quantal_stp_synapse_impl.h index 9fa2664b44..e6d22fe25b 100644 --- a/models/quantal_stp_synapse_impl.h +++ b/models/quantal_stp_synapse_impl.h @@ -36,38 +36,6 @@ namespace nest { - -/* Polymorphic version of update_value. - * This code will take either an int or a double and convert it to an - * int. - */ -bool -update_value_int( const DictionaryDatum& d, Name propname, int& prop ) -{ - if ( d->known( propname ) ) - { - Datum* dat = ( *d )[ propname ].datum(); - IntegerDatum* intdat = dynamic_cast< IntegerDatum* >( dat ); - if ( intdat != 0 ) - { - prop = static_cast< int >( intdat->get() ); - return true; - } - DoubleDatum* doubledat = dynamic_cast< DoubleDatum* >( dat ); - if ( doubledat != 0 ) - { - prop = static_cast< int >( doubledat->get() ); - return true; - } - else - { - throw TypeMismatch(); - } - } - - return false; -} - template < typename targetidentifierT > quantal_stp_synapse< targetidentifierT >::quantal_stp_synapse() : ConnectionBase() @@ -108,8 +76,8 @@ quantal_stp_synapse< targetidentifierT >::set_status( const DictionaryDatum& d, updateValue< double >( d, names::u, u_ ); updateValue< double >( d, names::tau_rec, tau_rec_ ); updateValue< double >( d, names::tau_fac, tau_fac_ ); - update_value_int( d, names::n, n_ ); - update_value_int( d, names::a, a_ ); + updateValue< long >( d, names::n, n_ ); + updateValue< long >( d, names::a, a_ ); } } // of namespace nest diff --git a/sli/dictutils.h b/sli/dictutils.h index 356748a24e..a4a5198c68 100644 --- a/sli/dictutils.h +++ b/sli/dictutils.h @@ -225,6 +225,7 @@ def( DictionaryDatum& d, Name const n, FT const& value ) /** Update a variable from a dictionary entry if it exists, skip call if it * doesn't. + * @note If the dictionary entry is an integer, use updateValue< long >. * @ingroup DictUtils * @throws see getValue(DictionaryDatum, Name) */ @@ -268,7 +269,6 @@ updateValue2( DictionaryDatum const& d, Name const n, C& obj, void ( C::*setfunc } } - /** Create a property of type ArrayDatum in the dictionary, if it does not * already exist. * @ingroup DictUtils