24 std::vector<std::string>
const & object_names_tolink, QUuid
const & src,
25 QUndoCommand * parent )
33 for ( std::string
const & oname : object_names_tolink )
38 { oname, relation.p_type } ) );
40 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
48 catch ( dunedaq::conffwk::Exception
const & e )
55 QObject::tr (
"Relation %1 of object %2 was updated." ).arg (
56 this_relation.p_name.c_str() ).arg (
object.UID().c_str() ) );
74 catch ( dunedaq::conffwk::Exception
const & e )
78 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
80 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
82 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
102 catch ( dunedaq::conffwk::Exception
const & e )
107 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
109 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
111 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
119 std::string
const & include_file,
120 QUuid
const & src, QUndoCommand * parent )
121 :
state ( parent, src ),
126 QObject::tr (
"Add Include File %1 to %2" ).arg (
127 QFileInfo ( QString (
m_include_file.c_str() ) ).fileName() ).arg (
128 QFileInfo ( QString (
m_db_file.c_str() ) ).fileName() ) );
142 catch ( dunedaq::conffwk::Exception
const & e )
162 catch ( dunedaq::conffwk::Exception
const & e )
171 QUuid
const & src, QUndoCommand * parent )
172 :
state ( parent, src ),
177 QObject::tr (
"Remove Include File %1 to %2" ).arg (
178 QFileInfo ( QString (
m_include_file.c_str() ) ).fileName() ).arg (
179 QFileInfo ( QString (
m_db_file.c_str() ) ).fileName() ) );
193 catch ( dunedaq::conffwk::Exception
const & e )
210 catch ( dunedaq::conffwk::Exception
const & e )
219 QUuid
const & src, QUndoCommand * parent )
220 :
state ( parent, src ),
224 QObject::tr (
"Creation of : Object %2@%1 " ).arg (
this_object_key.ref.this_class.c_str() )
237 [&] (
dref const obj )
247 catch ( dunedaq::conffwk::Exception
const & e )
251 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
253 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
270 catch ( dunedaq::conffwk::Exception
const & e )
279 QUndoCommand * parent )
283 QObject::tr (
"Delete object of class %1 with ID %2" ).arg (
284 ( this->
checkedref().class_name() ).c_str() ).arg (
308 catch ( dunedaq::conffwk::Exception
const & e )
312 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
314 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
316 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
339 catch ( dunedaq::conffwk::Exception
const & e )
343 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
345 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
347 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
355 QUndoCommand * parent )
361 QObject::tr (
"Object changed ID from %1 to %2" ).arg ( this->
checkedref().UID().c_str() )
379 std::vector<tref> tonotify
380 { this->
checkedref().referenced_by (
"*",
false ) };
382 std::for_each ( tonotify.begin(), tonotify.end(), [&] (
tref const & x )
384 confaccessor::ref().force_emit_object_changed ( source().toString(), x );
389 catch ( dunedaq::conffwk::Exception
const & e )
393 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
395 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
397 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
415 std::vector<tref> tonotify =
checkedref().referenced_by (
"*",
false );
417 std::for_each ( tonotify.begin(), tonotify.end(), [&] (
tref const & x )
419 confaccessor::ref().force_emit_object_changed ( source().toString(), x );
424 catch ( dunedaq::conffwk::Exception
const & e )
428 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
430 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
432 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
440 QUuid
const & src, QUndoCommand * parent )
446 QObject::tr (
"Object changed from file %1 to %2" ).arg (
source_file.c_str() ).arg (
470 catch ( dunedaq::conffwk::Exception
const & e )
474 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
476 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
478 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
495 catch ( dunedaq::conffwk::Exception
const & e )
499 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
501 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
503 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
526 : QUndoCommand ( parent ),
add(std::string const &db_file, std::string const &include_file, QUuid const &src=0, QUndoCommand *parent=0)
std::string m_include_file
remove(std::string &db_file, std::string &include_file, QUuid const &src=0, QUndoCommand *parent=0)
std::string m_include_file
changerefs(tref object, dunedaq::conffwk::relationship_t const &relation, std::vector< std::string > const &object_names_tolink, QUuid const &src=0, QUndoCommand *Parent=nullptr)
std::vector< tref > this_target_neighbors
std::vector< tref > this_current_neighbors
dunedaq::conffwk::relationship_t this_relation
create(dbe::t_config_object_preimage const &img, QUuid const &src=0, QUndoCommand *parent=0)
dbe::t_config_object_preimage this_object_key
std::string destination_file
move(tref ObjectChanged, std::string const &File, QUuid const &src=0, QUndoCommand *parent=nullptr)
remove(tref item, QUuid const &uuid=0, QUndoCommand *parent=0)
rename(tref object, std::string const &Id, QUuid const &src=0, QUndoCommand *parent=nullptr)
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
void setundoable(bool s=true) const
void setredoable(bool s=true) const
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
QUuid const & source() const
void force_emit_object_created(QString const &, dref const)
void removefile(std::string const &db, std::string const &fn)
void force_emit_object_deleted(QString const &, dref const)
void force_emit_object_renamed(QString const &, dref const)
void force_emit_object_changed(QString const &, dref const)
static confaccessor & ref()
void addfile(std::string const &db, std::string const &fn)
std::function< void(dref const) > config_action_notifiable
static configobject::gref< T > delete_object_request(configobject::tref const &obj)
static configobject::tref move_object_request(configobject::tref objref, std::string const &destfile)
static configobject::tref get(dbe::cokey const &desc)
static configobject::tref rename_object_request(configobject::tref objref, std::string const &newname)
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)
void relation(dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, std::vector< dbe::inner::configobject::tref > const &targets)
std::string const parse(ers::Issue const &)
inner::configobject::tref tref
config_object_preimage< std::string > t_config_object_preimage
config_object_description dref