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/confobject_desc.hpp
"
13
#include "
dbe/confobject_extra.hpp
"
14
#include "
dbe/config_reference_copy.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
{
26
namespace
actions
27
{
33
class
state
:
34
public
QUndoCommand
35
{
36
private
:
37
QUuid
const
uuid
;
38
mutable
bool
rewind
;
39
mutable
bool
forward
;
40
mutable
bool
invalid
;
41
42
bool
canRedo
()
const
;
43
44
bool
canUndo
()
const
;
45
46
protected
:
47
state
( QUndoCommand * parent =
nullptr
, QUuid
const
&
uuid
= 0 );
48
49
public
:
50
bool
isvalid
()
const
;
51
52
void
toggle
();
53
54
void
failed
()
const
;
55
void
setundoable
(
bool
s =
true
)
const
;
56
void
setredoable
(
bool
s =
true
)
const
;
57
58
bool
undoable
()
const
;
59
60
bool
redoable
()
const
;
61
62
void
reload
()
const
;
63
64
QUuid
const
&
source
()
const
;
65
};
66
//------------------------------------------------------------------------------------------
67
68
//------------------------------------------------------------------------------------------
72
class
onobject
:
73
public
state
74
{
75
public
:
76
onobject
(
tref
obj, QUndoCommand * parent =
nullptr
, QUuid
const
&
uuid
= 0 );
77
78
protected
:
79
tref
checkedref
()
const
;
80
81
private
:
82
dref
this_object
;
83
};
84
//------------------------------------------------------------------------------------------
85
86
namespace
object
87
{
88
89
//------------------------------------------------------------------------------------------
90
class
create
:
91
public
state
92
{
93
public
:
94
create
(
dbe::t_config_object_preimage
const
& img, QUuid
const
& src = 0,
95
QUndoCommand * parent = 0 );
96
97
void
undo
();
98
void
redo
();
99
private
:
100
dbe::t_config_object_preimage
this_object_key
;
101
};
102
//------------------------------------------------------------------------------------------
103
104
//------------------------------------------------------------------------------------------
105
class
remove
:
106
public
onobject
107
{
108
public
:
109
remove
(
tref
item, QUuid
const
&
uuid
= 0, QUndoCommand * parent = 0 );
110
~remove
();
111
void
redo
();
112
void
undo
();
113
114
private
:
115
gref
this_remainder
;
116
};
117
//------------------------------------------------------------------------------------------
118
119
//------------------------------------------------------------------------------------------
120
class
rename
:
121
public
onobject
122
{
123
public
:
124
rename
(
tref
object
, std::string
const
& Id, QUuid
const
& src = 0,
125
QUndoCommand * parent =
nullptr
);
126
void
redo
();
127
void
undo
();
128
private
:
129
std::string
oldname
;
130
std::string
newname
;
131
};
132
//------------------------------------------------------------------------------------------
133
134
//------------------------------------------------------------------------------------------
135
class
changerefs
:
136
public
onobject
137
{
138
public
:
139
changerefs
(
tref
object
,
dunedaq::conffwk::relationship_t
const
& relation,
140
std::vector<std::string>
const
& object_names_tolink, QUuid
const
& src = 0,
141
QUndoCommand * Parent =
nullptr
);
142
void
redo
();
143
void
undo
();
144
private
:
145
dunedaq::conffwk::relationship_t
this_relation
;
146
std::vector<tref>
this_current_neighbors
;
147
std::vector<tref>
this_target_neighbors
;
148
};
149
//------------------------------------------------------------------------------------------
150
151
//------------------------------------------------------------------------------------------
152
class
move
:
153
public
onobject
154
{
155
public
:
156
move
(
tref
ObjectChanged, std::string
const
& File, QUuid
const
& src = 0,
157
QUndoCommand * parent =
nullptr
);
158
~move
();
159
void
redo
();
160
void
undo
();
161
private
:
162
std::string
source_file
;
163
std::string
destination_file
;
164
};
165
//------------------------------------------------------------------------------------------
166
}
// end namespace object
167
168
namespace
file
169
{
170
/*
171
* This namespace handles operations related to files , but not those of object in files
172
*/
173
//------------------------------------------------------------------------------------------
174
class
add
:
175
public
state
176
{
177
public
:
178
add
( std::string
const
& db_file, std::string
const
& include_file, QUuid
const
& src = 0,
179
QUndoCommand * parent = 0 );
180
void
redo
();
181
void
undo
();
182
private
:
183
std::string
m_db_file
;
184
std::string
m_include_file
;
185
};
186
//------------------------------------------------------------------------------------------
187
188
//------------------------------------------------------------------------------------------
189
class
remove
:
190
public
state
191
{
192
public
:
193
remove
( std::string & db_file, std::string & include_file, QUuid
const
& src = 0,
194
QUndoCommand * parent = 0 );
195
void
redo
();
196
void
undo
();
197
private
:
198
std::string
m_db_file
;
199
std::string
m_include_file
;
200
};
201
//------------------------------------------------------------------------------------------
202
}
// end namespace file
203
204
}
//end namespace actions
205
}
// end namespace dbe
206
#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:118
dbe::actions::file::add::m_db_file
std::string m_db_file
Definition
Command.hpp:183
dbe::actions::file::add::redo
void redo()
Definition
Command.cpp:151
dbe::actions::file::add::m_include_file
std::string m_include_file
Definition
Command.hpp:184
dbe::actions::file::add::undo
void undo()
Definition
Command.cpp:133
dbe::actions::file::remove::remove
remove(std::string &db_file, std::string &include_file, QUuid const &src=0, QUndoCommand *parent=0)
Definition
Command.cpp:170
dbe::actions::file::remove::m_include_file
std::string m_include_file
Definition
Command.hpp:199
dbe::actions::file::remove::redo
void redo()
Definition
Command.cpp:199
dbe::actions::file::remove::m_db_file
std::string m_db_file
Definition
Command.hpp:198
dbe::actions::file::remove::undo
void undo()
Definition
Command.cpp:182
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:147
dbe::actions::object::changerefs::this_current_neighbors
std::vector< tref > this_current_neighbors
Definition
Command.hpp:146
dbe::actions::object::changerefs::undo
void undo()
Definition
Command.cpp:89
dbe::actions::object::changerefs::redo
void redo()
Definition
Command.cpp:61
dbe::actions::object::changerefs::this_relation
dunedaq::conffwk::relationship_t this_relation
Definition
Command.hpp:145
dbe::actions::object::create::create
create(dbe::t_config_object_preimage const &img, QUuid const &src=0, QUndoCommand *parent=0)
Definition
Command.cpp:218
dbe::actions::object::create::undo
void undo()
Definition
Command.cpp:228
dbe::actions::object::create::this_object_key
dbe::t_config_object_preimage this_object_key
Definition
Command.hpp:100
dbe::actions::object::create::redo
void redo()
Definition
Command.cpp:257
dbe::actions::object::move::source_file
std::string source_file
Definition
Command.hpp:162
dbe::actions::object::move::redo
void redo()
Definition
Command.cpp:458
dbe::actions::object::move::destination_file
std::string destination_file
Definition
Command.hpp:163
dbe::actions::object::move::move
move(tref ObjectChanged, std::string const &File, QUuid const &src=0, QUndoCommand *parent=nullptr)
Definition
Command.cpp:439
dbe::actions::object::move::undo
void undo()
Definition
Command.cpp:484
dbe::actions::object::move::~move
~move()
Definition
Command.cpp:452
dbe::actions::object::remove::redo
void redo()
Definition
Command.cpp:321
dbe::actions::object::remove::undo
void undo()
Definition
Command.cpp:292
dbe::actions::object::remove::~remove
~remove()
Definition
Command.cpp:288
dbe::actions::object::remove::remove
remove(tref item, QUuid const &uuid=0, QUndoCommand *parent=0)
Definition
Command.cpp:278
dbe::actions::object::remove::this_remainder
gref this_remainder
Definition
Command.hpp:115
dbe::actions::object::rename::undo
void undo()
Definition
Command.cpp:404
dbe::actions::object::rename::redo
void redo()
Definition
Command.cpp:367
dbe::actions::object::rename::newname
std::string newname
Definition
Command.hpp:130
dbe::actions::object::rename::oldname
std::string oldname
Definition
Command.hpp:129
dbe::actions::object::rename::rename
rename(tref object, std::string const &Id, QUuid const &src=0, QUndoCommand *parent=nullptr)
Definition
Command.cpp:353
dbe::actions::onobject::checkedref
tref checkedref() const
Definition
Command.cpp:518
dbe::actions::onobject::onobject
onobject(tref obj, QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition
Command.cpp:510
dbe::actions::onobject::this_object
dref this_object
Definition
Command.hpp:82
dbe::actions::state::setundoable
void setundoable(bool s=true) const
Definition
Command.cpp:553
dbe::actions::state::canRedo
bool canRedo() const
Definition
Command.cpp:578
dbe::actions::state::reload
void reload() const
Definition
Command.cpp:588
dbe::actions::state::rewind
bool rewind
Definition
Command.hpp:38
dbe::actions::state::toggle
void toggle()
Definition
Command.cpp:534
dbe::actions::state::undoable
bool undoable() const
Definition
Command.cpp:563
dbe::actions::state::canUndo
bool canUndo() const
Definition
Command.cpp:583
dbe::actions::state::isvalid
bool isvalid() const
Definition
Command.cpp:548
dbe::actions::state::forward
bool forward
Definition
Command.hpp:39
dbe::actions::state::setredoable
void setredoable(bool s=true) const
Definition
Command.cpp:558
dbe::actions::state::failed
void failed() const
Definition
Command.cpp:541
dbe::actions::state::redoable
bool redoable() const
Definition
Command.cpp:568
dbe::actions::state::invalid
bool invalid
Definition
Command.hpp:40
dbe::actions::state::state
state(QUndoCommand *parent=nullptr, QUuid const &uuid=0)
Definition
Command.cpp:525
dbe::actions::state::source
QUuid const & source() const
Definition
Command.cpp:573
dbe::actions::state::uuid
QUuid const uuid
Definition
Command.hpp:37
confaccessor.hpp
Schema.hpp
config_reference_copy.hpp
confobject_desc.hpp
confobject_extra.hpp
dbcontroller.hpp
dbe::actions::file
Definition
Command.hpp:169
dbe::actions::object
Definition
Command.hpp:87
dbe::actions
Definition
change_attribute.hpp:37
dbe
Include QT Headers.
Definition
BatchChangeWidget.hpp:18
dbe::tref
inner::configobject::tref tref
Definition
tref.hpp:35
dbe::t_config_object_preimage
config_object_preimage< std::string > t_config_object_preimage
Definition
confobject_desc.hpp:144
dbe::gref
inner::configobject::gref< config_object_aggregates< std::string > > gref
Definition
tref.hpp:38
dbe::dref
config_object_description dref
Definition
confobject_desc.hpp:109
dunedaq::conffwk::relationship_t
Definition
Schema.hpp:120
Generated on
for DUNE-DAQ by
1.17.0