allow to not set the res value from a plugin function
Add PluginInfo::has_res (bool, default true). If set to false by a plugin function then the PluginInfo::res value is not taken into account when calculating how many plugins have returned true or false.
This commit is contained in:
parent
71ad4869ce
commit
f4470ccbe7
|
@ -4,8 +4,8 @@
|
|||
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2022, Tomasz Sowa
|
||||
/*
|
||||
* Copyright (c) 2008-2023, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -370,10 +370,13 @@ PluginRes Plugin::Call(morm::ModelConnector * model_connector, Log * plog, Cur *
|
|||
|
||||
Call(model_connector, plog, cur, message, i, info);
|
||||
|
||||
if( info.res )
|
||||
++res.res_true;
|
||||
else
|
||||
++res.res_false;
|
||||
if( info.has_res )
|
||||
{
|
||||
if( info.res )
|
||||
++res.res_true;
|
||||
else
|
||||
++res.res_false;
|
||||
}
|
||||
}
|
||||
|
||||
current_plugin = old_current_plugin;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2022, Tomasz Sowa
|
||||
/*
|
||||
* Copyright (c) 2008-2023, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -120,6 +120,12 @@ struct PluginInfo
|
|||
// to create your plugin's session data
|
||||
PluginDataBase * plugin_data_base; // !! zmienic nazwe na plugin_session_base ? a moze session_base; a moze plugin_session?
|
||||
|
||||
// whether or not there is a res (bool) value set
|
||||
// default: true
|
||||
// if set to false then the 'res' is not taken into account when calculating how many plugins
|
||||
// have returned true or false
|
||||
bool has_res;
|
||||
|
||||
// function return status
|
||||
// default: false (if not set by the plugin)
|
||||
bool res;
|
||||
|
@ -137,6 +143,7 @@ struct PluginInfo
|
|||
plugin_id = -1;
|
||||
plugin_data_base = 0;
|
||||
|
||||
has_res = true;
|
||||
res = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue