##// END OF EJS Templates
Adds read compatibility for local AMDA server...
Adds read compatibility for local AMDA server The local AMDA server uses another regex than the default server to read the units in x. We manage the compatibility by adding in the parser the possibility of testing several regexes to read a property

File last commit:

r1033:243c12122366
r1121:98220c931c83
Show More
DataSourceItemAction.cpp
49 lines | 1.4 KiB | text/x-c | CppLexer
/ core / src / DataSource / DataSourceItemAction.cpp
Alexandre Leroux
Defines actions for a data source items...
r144 #include <DataSource/DataSourceItemAction.h>
Configuration update to permit make install on linux
r257 #include <functional>
Alexandre Leroux
Defines actions for a data source items...
r144 Q_LOGGING_CATEGORY(LOG_DataSourceItemAction, "DataSourceItemAction")
struct DataSourceItemAction::DataSourceItemActionPrivate {
explicit DataSourceItemActionPrivate(const QString &name,
DataSourceItemAction::ExecuteFunction fun)
: m_Name{name}, m_Fun{std::move(fun)}, m_DataSourceItem{nullptr}
{
}
QString m_Name;
DataSourceItemAction::ExecuteFunction m_Fun;
/// Item associated to the action (can be null, in which case the action will not be executed)
DataSourceItem *m_DataSourceItem;
};
DataSourceItemAction::DataSourceItemAction(const QString &name, ExecuteFunction fun)
: impl{spimpl::make_unique_impl<DataSourceItemActionPrivate>(name, std::move(fun))}
{
}
Alexandre Leroux
Implements merge method (2)...
r1033 std::unique_ptr<DataSourceItemAction> DataSourceItemAction::clone() const
{
return std::make_unique<DataSourceItemAction>(impl->m_Name, impl->m_Fun);
}
Alexandre Leroux
Defines actions for a data source items...
r144 QString DataSourceItemAction::name() const noexcept
{
return impl->m_Name;
}
void DataSourceItemAction::setDataSourceItem(DataSourceItem *dataSourceItem) noexcept
{
impl->m_DataSourceItem = dataSourceItem;
}
void DataSourceItemAction::execute()
{
if (impl->m_DataSourceItem) {
impl->m_Fun(*impl->m_DataSourceItem);
}
else {
qCDebug(LOG_DataSourceItemAction())
<< tr("Can't execute action : no item has been associated");
}
}