-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation warnings for features that will disappear (fixes #552) #580
Changes from 14 commits
8bf610e
425aca4
c5ff0bc
a779682
0cca6a1
2b456e2
e3ffe9b
9c18171
3c18a1a
7aabc1f
0e98846
dcc2685
ebdaf8c
a8f5447
e97933c
d053142
f113398
76f2b55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,9 @@ std::ostream& operator<<( std::ostream& out, const LoggingEvent& e ) | |
case M_INFO: | ||
out << "[INFO] "; | ||
break; | ||
case M_DEPRECATED: | ||
out << "[INFO] "; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be even more expressive if "[INFO]" was "[DEPRECATED]"? This would also allow to search the output log for such functions more easily. |
||
break; | ||
case M_WARNING: | ||
out << "[WARNING] "; | ||
break; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,9 @@ | |
|
||
#include "modelsmodule.h" | ||
|
||
// Includes from nestkernel | ||
#include "genericmodel_impl.h" | ||
|
||
// Generated includes: | ||
#include "config.h" | ||
|
||
|
@@ -173,7 +176,9 @@ ModelsModule::commandstring( void ) const | |
void | ||
ModelsModule::init( SLIInterpreter* ) | ||
{ | ||
kernel().model_manager.register_node_model< iaf_neuron >( "iaf_neuron" ); | ||
kernel().model_manager.register_node_model< iaf_neuron >( "iaf_neuron", | ||
/* private_model */ false, | ||
/* deprecation_info */ "NEST 3.0" ); | ||
kernel().model_manager.register_node_model< iaf_chs_2007 >( "iaf_chs_2007" ); | ||
kernel().model_manager.register_node_model< iaf_psc_alpha >( | ||
"iaf_psc_alpha" ); | ||
|
@@ -353,7 +358,9 @@ ModelsModule::init( SLIInterpreter* ) | |
|
||
// This version of the AdEx model does not depend on GSL. | ||
kernel().model_manager.register_node_model< aeif_cond_alpha_RK5 >( | ||
"aeif_cond_alpha_RK5" ); | ||
"aeif_cond_alpha_RK5", | ||
/*private_model*/ false, | ||
/*deprecation_model*/ "NEST 3.0" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "deprecation_model" -> "deprecation_info" |
||
|
||
#ifdef HAVE_MUSIC | ||
//// proxies for inter-application communication using MUSIC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* genericmodel_impl.h | ||
* | ||
* This file is part of NEST. | ||
* | ||
* Copyright (C) 2004 The NEST Initiative | ||
* | ||
* NEST 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. | ||
* | ||
* NEST 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with NEST. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#ifndef GENERICMODEL_IMPL_H | ||
#define GENERICMODEL_IMPL_H | ||
|
||
#include "genericmodel.h" | ||
|
||
// Includes from nestkernel: | ||
#include "kernel_manager.h" | ||
#include "logging_manager.h" | ||
|
||
namespace nest | ||
{ | ||
|
||
template < typename ElementT > | ||
void | ||
GenericModel< ElementT >::deprecation_warning( const std::string& caller ) | ||
{ | ||
if ( deprecation_warning_issued_ or deprecation_info_.empty() ) | ||
return; | ||
|
||
if ( not deprecation_info_.empty() ) | ||
{ | ||
LOG( M_DEPRECATED, | ||
caller, | ||
"Model " + get_name() + " is deprecated in " + deprecation_info_ + "." ); | ||
} | ||
|
||
deprecation_warning_issued_ = true; | ||
} | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Sli" -> "SLI"
There are some more changes like this that I won't comment on. Please search and replace all of them.