19 std::vector<std::string>
const & object_names_tolink, QUuid
const & src,
20 QUndoCommand * parent )
22 this_relation ( relation ),
23 this_current_neighbors (
24 dbe::config::api::graph::linked::through::relation<
std::vector<
tref>> ( object, relation ) )
28 for ( std::string
const & oname : object_names_tolink )
33 { oname, relation.p_type } ) );
35 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
43 catch ( dunedaq::conffwk::Exception
const & e )
50 QObject::tr (
"Relation %1 of object %2 was updated." ).arg (
64 this_target_neighbors );
69 catch ( dunedaq::conffwk::Exception
const & e )
73 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
75 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
77 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
92 this_current_neighbors );
97 catch ( dunedaq::conffwk::Exception
const & e )
102 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
104 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
106 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
114 std::string
const & include_file,
115 QUuid
const & src, QUndoCommand * parent )
116 :
state ( parent, src ),
117 m_db_file ( db_file ),
118 m_include_file ( include_file )
121 QObject::tr (
"Add Include File %1 to %2" ).arg (
122 QFileInfo ( QString (
m_include_file.c_str() ) ).fileName() ).arg (
123 QFileInfo ( QString (
m_db_file.c_str() ) ).fileName() ) );
137 catch ( dunedaq::conffwk::Exception
const & e )
157 catch ( dunedaq::conffwk::Exception
const & e )
166 QUuid
const & src, QUndoCommand * parent )
167 :
state ( parent, src ),
168 m_db_file ( db_file ),
169 m_include_file ( include_file )
172 QObject::tr (
"Remove Include File %1 to %2" ).arg (
173 QFileInfo ( QString (
m_include_file.c_str() ) ).fileName() ).arg (
174 QFileInfo ( QString (
m_db_file.c_str() ) ).fileName() ) );
188 catch ( dunedaq::conffwk::Exception
const & e )
205 catch ( dunedaq::conffwk::Exception
const & e )
214 QUuid
const & src, QUndoCommand * parent )
215 :
state ( parent, src ),
216 this_object_key ( img )
219 QObject::tr (
"Creation of : Object %2@%1 " ).arg (
this_object_key.
ref.this_class.c_str() )
232 [&] (
dref const obj )
242 catch ( dunedaq::conffwk::Exception
const & e )
246 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
248 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
265 catch ( dunedaq::conffwk::Exception
const & e )
274 QUndoCommand * parent )
275 :
onobject ( anobject, parent, uuid )
278 QObject::tr (
"Delete object of class %1 with ID %2" ).arg (
279 ( this->
checkedref().class_name() ).c_str() ).arg (
303 catch ( dunedaq::conffwk::Exception
const & e )
307 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
309 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
311 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
320 if ( redoable() and not checkedref().is_null() )
330 decltype ( this_remainder ) ::t_extractor > ( checkedref(), deletion );
334 catch ( dunedaq::conffwk::Exception
const & e )
338 catch ( daq::dbe::config_object_retrieval_result_is_null
const & ex )
340 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
342 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, ex );
350 QUndoCommand * parent )
352 oldname ( this->checkedref().UID() ),
356 QObject::tr (
"Object changed ID from %1 to %2" ).arg ( this->
checkedref().UID().c_str() )
369 dref object_before_change ( checkedref() );
374 std::vector<tref> tonotify
375 { this->checkedref().referenced_by (
"*",
false ) };
377 std::for_each ( tonotify.begin(), tonotify.end(), [&] (
tref const & x )
379 confaccessor::ref().force_emit_object_changed ( source().toString(), x );
384 catch ( dunedaq::conffwk::Exception
const & e )
388 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
390 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
392 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
406 dref object_before_rename ( checkedref() );
410 std::vector<tref> tonotify = checkedref().referenced_by (
"*",
false );
412 std::for_each ( tonotify.begin(), tonotify.end(), [&] (
tref const & x )
414 confaccessor::ref().force_emit_object_changed ( source().toString(), x );
419 catch ( dunedaq::conffwk::Exception
const & e )
423 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
425 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
427 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
435 QUuid
const & src, QUndoCommand * parent )
437 source_file ( this->checkedref().contained_in() ),
441 QObject::tr (
"Object changed from file %1 to %2" ).arg (
source_file.c_str() ).arg (
465 catch ( dunedaq::conffwk::Exception
const & e )
469 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
471 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
473 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
490 catch ( dunedaq::conffwk::Exception
const & e )
494 catch ( daq::dbe::config_object_retrieval_result_is_null
const & e )
496 FAIL (
"Operation did not complete because a lookup in the underlying database failed",
498 throw daq::dbe::ObjectChangeWasNotSuccessful (
ERS_HERE, e );
506 :
dbe::actions::
state ( parent, uuid ),
515 return this_object.
ref();
521 : QUndoCommand ( parent ),
531 invalid = not invalid;
533 forward = not forward;
560 return rewind and not invalid;
565 return forward and not invalid;
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
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
dunedaq::conffwk::ConfigObject & ref(bool check_null=true) const
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 &)