DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dbe
include
dbe
Command.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3
// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4
// Renamed since fork: yes (from dbe/Command.h to include/dbe/Command.hpp).
5
6
#ifndef COMMAND_H
7
#define COMMAND_H
8
9
#include "
dbe/Conversion.hpp
"
10
#include "
dbe/Exceptions.hpp
"
11
#include "
dbe/confaccessor.hpp
"
12
#include "
dbe/config_reference_copy.hpp
"
13
#include "
dbe/confobject_desc.hpp
"
14
#include "
dbe/confobject_extra.hpp
"
15
16
#include "
dbe/dbcontroller.hpp
"
17
18
#include "
conffwk/ConfigObject.hpp
"
19
#include "
conffwk/Schema.hpp
"
20
21
#include <QUndoCommand>
22
#include <QUuid>
23
24
namespace
dbe
{
25
namespace
actions
{
31
class
state
:
public
QUndoCommand
32
{
33
private
:
34
QUuid
const
uuid
;
35
mutable
bool
rewind
;
36
mutable
bool
forward
;
37
mutable
bool
invalid
;
38
39
bool
canRedo
()
const
;
40
41
bool
canUndo
()
const
;
42
43
protected
:
44
state
(QUndoCommand* parent =
nullptr
, QUuid
const
&
uuid
= 0);
45
46
public
:
47
bool
isvalid
()
const
;
48
49
void
toggle
();
50
51
void
failed
()
const
;
52
void
setundoable
(
bool
s =
true
)
const
;
53
void
setredoable
(
bool
s =
true
)
const
;
54
55
bool
undoable
()
const
;
56
57
bool
redoable
()
const
;
58
59
void
reload
()
const
;
60
61
QUuid
const
&
source
()
const
;
62
};
63
//------------------------------------------------------------------------------------------
64
65
//------------------------------------------------------------------------------------------
69
class
onobject
:
public
state
70
{
71
public
:
72
onobject
(
tref
obj, QUndoCommand* parent =
nullptr
, QUuid
const
&
uuid
= 0);
73
74
protected
:
75
tref
checkedref
()
const
;
76
77
private
:
78
dref
this_object
;
79
};
80
//------------------------------------------------------------------------------------------
81
82
namespace
object
{
83
84
//------------------------------------------------------------------------------------------
85
class
create
:
public
state
86
{
87
public
:
88
create
(
dbe::t_config_object_preimage
const
& img, QUuid
const
& src = 0, QUndoCommand* parent = 0);
89
90
void
undo
();
91
void
redo
();
92
93
private
:
94
dbe::t_config_object_preimage
this_object_key
;
95
};
96
//------------------------------------------------------------------------------------------
97
98
//------------------------------------------------------------------------------------------
99
class
remove
:
public
onobject
100
{
101
public
:
102
remove
(
tref
item, QUuid
const
&
uuid
= 0, QUndoCommand* parent = 0);
103
~remove
();
104
void
redo
();
105
void
undo
();
106
107
private
:
108
gref
this_remainder
;
109
};
110
//------------------------------------------------------------------------------------------
111
112
//------------------------------------------------------------------------------------------
113
class
rename
:
public
onobject
114
{
115
public
:
116
rename
(
tref
object
, std::string
const
& Id, QUuid
const
& src = 0, QUndoCommand* parent =
nullptr
);
117
void
redo
();
118
void
undo
();
119
120
private
:
121
std::string
oldname
;
122
std::string
newname
;
123
};
124
//------------------------------------------------------------------------------------------
125
126
//------------------------------------------------------------------------------------------
127
class
changerefs
:
public
onobject
128
{
129
public
:
130
changerefs
(
tref
object
,
131
dunedaq::conffwk::relationship_t
const
& relation,
132
std::vector<std::string>
const
& object_names_tolink,
133
QUuid
const
& src = 0,
134
QUndoCommand* Parent =
nullptr
);
135
void
redo
();
136
void
undo
();
137
138
private
:
139
dunedaq::conffwk::relationship_t
this_relation
;
140
std::vector<tref>
this_current_neighbors
;
141
std::vector<tref>
this_target_neighbors
;
142
};
143
//------------------------------------------------------------------------------------------
144
145
//------------------------------------------------------------------------------------------
146
class
move
:
public
onobject
147
{
148
public
:
149
move
(
tref
ObjectChanged, std::string
const
& File, QUuid
const
& src = 0, QUndoCommand* parent =
nullptr
);
150
~move
();
151
void
redo
();
152
void
undo
();
153
154
private
:
155
std::string
source_file
;
156
std::string
destination_file
;
157
};
158
//------------------------------------------------------------------------------------------
159
}
// end namespace object
160
161
namespace
file
{
162
/*
163
* This namespace handles operations related to files , but not those of object in files
164
*/
165
//------------------------------------------------------------------------------------------
166
class
add
:
public
state
167
{
168
public
:
169
add
(std::string
const
& db_file, std::string
const
& include_file, QUuid
const
& src = 0, QUndoCommand* parent = 0);
170
void
redo
();
171
void
undo
();
172
173
private
:
174
std::string
m_db_file
;
175
std::string
m_include_file
;
176
};
177
//------------------------------------------------------------------------------------------
178
179
//------------------------------------------------------------------------------------------
180
class
remove
:
public
state
181
{
182
public
:
183
remove
(std::string& db_file, std::string& include_file, QUuid
const
& src = 0, QUndoCommand* parent = 0);
184
void
redo
();
185
void
undo
();
186
187
private
:
188
std::string
m_db_file
;
189
std::string
m_include_file
;
190
};
191
//------------------------------------------------------------------------------------------
192
}
// end namespace file
193
194
}
// end namespace actions
195
}
// end namespace dbe
196
#endif
// COMMAND_H
ConfigObject.hpp
Conversion.hpp
Exceptions.hpp
dbe::actions::file::add::add
add(std::string const &db_file, std::string const &include_file, QUuid const &src=0, QUndoCommand *parent=0)
Definition
Command.cpp:93
dbe::actions::file::add::m_db_file
std::string m_db_file
Definition
Command.hpp:174
dbe::actions::file::add::redo
void redo()
Definition
Command.cpp:124
dbe::actions::file::add::m_include_file
std::string m_include_file
Definition
Command.hpp:175
dbe::actions::file::add::undo
void undo()
Definition
Command.cpp:109
dbe::actions::file::remove::remove
remove(std::string &db_file, std::string &include_file, QUuid const &src=0, QUndoCommand *parent=0)
Definition
Command.cpp:139
dbe::actions::file::remove::m_include_file
std::string m_include_file
Definition
Command.hpp:189
dbe::actions::file::remove::redo
void redo()
Definition
Command.cpp:167
dbe::actions::file::remove::m_db_file
std::string m_db_file
Definition
Command.hpp:188
dbe::actions::file::remove::undo
void undo()
Definition
Command.cpp:153
dbe::actions::object::changerefs::changerefs
changerefs(tref object, dunedaq::conffwk::relationship_t const &relation, std::vector< std::string > const &object_names_tolink, QUuid const &src=0, QUndoCommand *Parent=nullptr)
Definition
Command.cpp:22
dbe::actions::object::changerefs::this_target_neighbors
std::vector< tref > this_target_neighbors
Definition
Command.hpp:141
dbe::actions::object::changerefs::this_current_neighbors
std::vector< tref > this_current_neighbors
Definition
Command.hpp:140
dbe::actions::object::changerefs::undo
void undo()
Definition
Command.cpp:73
dbe::actions::object::changerefs::redo
void redo()
Definition
Command.cpp:53
dbe::actions::object::changerefs::this_relation
dunedaq::conffwk::relationship_t this_relation
Definition
Command.hpp:139
dbe::actions::object::create::create
create(dbe::t_config_object_preimage const &img, QUuid const &src=0, QUndoCommand *parent=0)
Definition
Command.cpp:182
dbe::actions::object::create::undo
void undo()
Definition
Command.cpp:192
dbe::actions::object::create::this_object_key
dbe::t_config_object_preimage this_object_key
Definition
Command.hpp:94
dbe::actions::object::create::redo
void redo()
Definition
Command.cpp:214
dbe::actions::object::move::source_file
std::string source_file
Definition
Command.hpp:155
dbe::actions::object::move::redo
void redo()
Definition
Command.cpp:365
dbe::actions::object::move::destination_file
std::string destination_file
Definition
Command.hpp:156
dbe::actions::object::move::move
move(tref ObjectChanged, std::string const &File, QUuid const &src=0, QUndoCommand *parent=nullptr)
Definition
Command.cpp:350
dbe::actions::object::move::undo
void undo()
Definition
Command.cpp:385
dbe::actions::object::remove::redo
void redo()
Definition
Command.cpp:262
dbe::actions::object::remove::undo
void undo()
Definition
Command.cpp:241
dbe::actions::object::remove::remove
remove(tref item, QUuid const &uuid=0, QUndoCommand *parent=0)
Definition
Command.cpp:230
dbe::actions::object::remove::this_remainder
gref this_remainder
Definition
Command.hpp:108
dbe::actions::object::rename::undo
void undo()
Definition
Command.cpp:324
dbe::actions::object::rename::redo
void redo()
Definition
Command.cpp:296
dbe::actions::object::rename::newname
std::string newname
Definition
Command.hpp:122
dbe::actions::object::rename::oldname
std::string oldname
Definition
Command.hpp:121
dbe::actions::object::rename::rename
rename(tref object, std::string const &Id, QUuid const &src=0, QUndoCommand *parent=nullptr)
Definition
Command.cpp:285
dbe::actions::onobject::checkedref
tref checkedref() const
Definition
Command.cpp:412
dbe::actions::onobject::onobject
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition
Command.cpp:403
dbe::actions::onobject::this_object
dref this_object
Definition
Command.hpp:78
dbe::actions::state::setundoable
void setundoable(bool s=true) const
Definition
Command.cpp:451
dbe::actions::state::canRedo
bool canRedo() const
Definition
Command.cpp:481
dbe::actions::state::reload
void reload() const
Definition
Command.cpp:493
dbe::actions::state::rewind
bool rewind
Definition
Command.hpp:35
dbe::actions::state::toggle
void toggle()
Definition
Command.cpp:429
dbe::actions::state::undoable
bool undoable() const
Definition
Command.cpp:463
dbe::actions::state::canUndo
bool canUndo() const
Definition
Command.cpp:487
dbe::actions::state::isvalid
bool isvalid() const
Definition
Command.cpp:445
dbe::actions::state::forward
bool forward
Definition
Command.hpp:36
dbe::actions::state::setredoable
void setredoable(bool s=true) const
Definition
Command.cpp:457
dbe::actions::state::failed
void failed() const
Definition
Command.cpp:437
dbe::actions::state::redoable
bool redoable() const
Definition
Command.cpp:469
dbe::actions::state::invalid
bool invalid
Definition
Command.hpp:37
dbe::actions::state::state
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition
Command.cpp:419
dbe::actions::state::source
QUuid const & source() const
Definition
Command.cpp:475
dbe::actions::state::uuid
QUuid const uuid
Definition
Command.hpp:34
confaccessor.hpp
Schema.hpp
config_reference_copy.hpp
confobject_desc.hpp
confobject_extra.hpp
dbcontroller.hpp
dbe::actions::file
Definition
Command.hpp:161
dbe::actions::object
Definition
Command.hpp:82
dbe::actions
Definition
change_attribute.hpp:35
dbe
Include QT Headers.
Definition
BatchChangeWidget.hpp:16
dbe::tref
inner::configobject::tref tref
Definition
tref.hpp:36
dbe::t_config_object_preimage
config_object_preimage< std::string > t_config_object_preimage
Definition
confobject_desc.hpp:128
dbe::gref
inner::configobject::gref< config_object_aggregates< std::string > > gref
Definition
tref.hpp:39
dbe::dref
config_object_description dref
Definition
confobject_desc.hpp:90
dunedaq::conffwk::relationship_t
Definition
Schema.hpp:117
Generated on
for DUNE-DAQ by
1.18.0