DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCommand.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/SchemaCommand.h to include/dbe/SchemaCommand.hpp).
5
6#ifndef SCHEMACOMMAND_H
7#define SCHEMACOMMAND_H
8
10#include "oks/attribute.hpp"
11#include "oks/class.hpp"
12#include "oks/method.hpp"
13#include "oks/relationship.hpp"
14#include <QUndoCommand>
15
16namespace dunedaq {
17namespace oks {
18class OksClass;
19}
20}
21
22namespace dbse {
23
25class SetAbstractClassCommand : public QUndoCommand
26{
27public:
30 void redo();
31 void undo();
32
33private:
34 std::string ClassName;
37};
38
39class SetDescriptionClassCommand : public QUndoCommand
40{
41public:
42 SetDescriptionClassCommand(dunedaq::oks::OksClass* Class, std::string Description);
44 void redo();
45 void undo();
46
47private:
48 std::string ClassName;
49 std::string NewDescription;
50 std::string OldDescription;
51};
52
53class AddSuperClassCommand : public QUndoCommand
54{
55public:
56 AddSuperClassCommand(dunedaq::oks::OksClass* Class, std::string SuperClass);
58 void redo();
59 void undo();
60
61private:
62 std::string ClassName;
63 std::string NewSuperClass;
64};
65
66class RemoveSuperClassCommand : public QUndoCommand
67{
68public:
71 void redo();
72 void undo();
73
74private:
75 std::string ClassName;
76 std::string SuperClass;
77};
78
79class CreateClassCommand : public QUndoCommand
80{
81public:
82 CreateClassCommand(std::string ClassName, std::string ClassDescription, bool Abstract);
84 void redo();
85 void undo();
86
87private:
89 std::string SchemaClassName;
92};
93
94class RemoveClassCommand : public QUndoCommand
95{
96public:
97 RemoveClassCommand(dunedaq::oks::OksClass* Class, std::string ClassName, std::string ClassDescription, bool Abstract);
99 void redo();
100 void undo();
101
102private:
104 std::string SchemaClassName;
107};
108
110class SetNameRelationshipCommand : public QUndoCommand
111{
112public:
114 dunedaq::oks::OksRelationship* Relationship,
115 std::string Name);
117 void redo();
118 void undo();
119
120private:
121 std::string ClassName;
125};
126
127class SetClassTypeRelationshipCommand : public QUndoCommand
128{
129public:
131 dunedaq::oks::OksRelationship* Relationship,
132 std::string ClassType);
134 void redo();
135 void undo();
136
137private:
138 std::string ClassName;
140 std::string RelationshipName;
143};
144
145class SetDescriptionRelationshipCommand : public QUndoCommand
146{
147public:
149 dunedaq::oks::OksRelationship* Relationship,
150 std::string Description);
152 void redo();
153 void undo();
154
155private:
156 std::string ClassName;
158 std::string RelationshipName;
159 std::string NewDescription;
160 std::string OldDescription;
161};
162
180
198
199class SetIsCompositeRelationshipCommand : public QUndoCommand
200{
201public:
203 dunedaq::oks::OksRelationship* Relationship,
204 bool Value);
206 void redo();
207 void undo();
208
209private:
210 std::string ClassName;
212 std::string RelationshipName;
215};
216
217class SetIsDependentRelationshipCommand : public QUndoCommand
218{
219public:
221 dunedaq::oks::OksRelationship* Relationship,
222 bool Value);
224 void redo();
225 void undo();
226
227private:
228 std::string ClassName;
230 std::string RelationshipName;
233};
234
235class SetIsExclusiveRelationshipCommand : public QUndoCommand
236{
237public:
239 dunedaq::oks::OksRelationship* Relationship,
240 bool Value);
242 void redo();
243 void undo();
244
245private:
246 std::string ClassName;
248 std::string RelationshipName;
251};
252
253class AddRelationship : public QUndoCommand
254{
255public:
257 std::string Name,
258 std::string Description,
259 std::string Type,
260 bool Composite,
261 bool Exclusive,
262 bool Dependent,
266 void redo();
267 void undo();
268
269private:
270 std::string ClassName;
272 std::string RelationshipName;
274 std::string RelationshipType;
280};
281
282class RemoveRelationship : public QUndoCommand
283{
284public:
286 dunedaq::oks::OksRelationship* Relationship,
287 std::string Name,
288 std::string Description,
289 std::string Type,
290 bool Composite,
291 bool Exclusive,
292 bool Dependent,
296 void redo();
297 void undo();
298
299private:
300 std::string ClassName;
302 std::string RelationshipName;
304 std::string RelationshipType;
310};
311
313class SetMethodImplementationLanguage : public QUndoCommand
314{
315public:
319 std::string Language);
321 void redo();
322 void undo();
323
324private:
325 std::string ClassName;
326 std::string MethodName;
328 std::string NewLanguage;
329 std::string OldLanguage;
330};
331
332class SetMethodImplementationPrototype : public QUndoCommand
333{
334public:
338 std::string Prototype);
340 void redo();
341 void undo();
342
343private:
344 std::string ClassName;
345 std::string MethodName;
348 std::string NewPrototype;
349 std::string OldPrototype;
350};
351
352class SetMethodImplementationBody : public QUndoCommand
353{
354public:
358 std::string Body);
360 void redo();
361 void undo();
362
363private:
364 std::string ClassName;
365 std::string MethodName;
368 std::string NewBody;
369 std::string OldBody;
370};
371
372class AddMethodImplementationComand : public QUndoCommand
373{
374public:
377 std::string Language,
378 std::string Prototype,
379 std::string Body);
381 void redo();
382 void undo();
383
384private:
385 std::string ClassName;
387 std::string MethodName;
391};
392
393class RemoveMethodImplementationComand : public QUndoCommand
394{
395public:
398 std::string Language,
399 std::string Prototype,
400 std::string Body);
402 void redo();
403 void undo();
404
405private:
406 std::string ClassName;
408 std::string MethodName;
412};
413
415class SetNameMethodCommand : public QUndoCommand
416{
417public:
420 void redo();
421 void undo();
422
423private:
424 std::string ClassName;
426 std::string NewMethodName;
427 std::string OldMethodName;
428};
429
430class SetDescriptionMethodCommand : public QUndoCommand
431{
432public:
433 SetDescriptionMethodCommand(dunedaq::oks::OksClass* Class, dunedaq::oks::OksMethod* Method, std::string description);
435 void redo();
436 void undo();
437
438private:
439 std::string ClassName;
441 std::string MethodName;
444};
445
446class AddMethodCommand : public QUndoCommand
447{
448public:
449 AddMethodCommand(dunedaq::oks::OksClass* Class, std::string name, std::string description);
451 void redo();
452 void undo();
453
454private:
455 std::string ClassName;
457 std::string SchemaName;
458 std::string SchemaDescription;
459};
460
461class RemoveMethodCommand : public QUndoCommand
462{
463public:
466 std::string name,
467 std::string description);
469 void redo();
470 void undo();
471
472private:
473 std::string ClassName;
475 std::string SchemaName;
476 std::string SchemaDescription;
477};
478
480class SetAttributeNameCommand : public QUndoCommand
481{
482public:
483 SetAttributeNameCommand(dunedaq::oks::OksClass* Class, dunedaq::oks::OksAttribute* Attribute, std::string NewName);
485 void redo();
486 void undo();
487
488private:
489 std::string ClassName;
491 std::string NewAttributeName;
492 std::string OldAttributeName;
493};
494
495class SetAttributeDescriptionCommand : public QUndoCommand
496{
497public:
500 std::string NewDescription);
502 void redo();
503 void undo();
504
505private:
506 std::string ClassName;
508 std::string AttributeName;
511};
512
513class SetAttributeTypeCommand : public QUndoCommand
514{
515public:
516 SetAttributeTypeCommand(dunedaq::oks::OksClass* Class, dunedaq::oks::OksAttribute* Attribute, std::string NewType);
518 void redo();
519 void undo();
520
521private:
522 std::string ClassName;
524 std::string AttributeName;
525 std::string NewAttributeType;
526 std::string OldAttributeType;
527};
528
529class SetAttributeRangeCommand : public QUndoCommand
530{
531public:
532 SetAttributeRangeCommand(dunedaq::oks::OksClass* Class, dunedaq::oks::OksAttribute* Attribute, std::string NewRange);
534 void redo();
535 void undo();
536
537private:
538 std::string ClassName;
540 std::string AttributeName;
541 std::string NewAttributeRange;
542 std::string OldAttributeRange;
543};
544
562
563class SetAttributeMultiCommand : public QUndoCommand
564{
565public:
568 void redo();
569 void undo();
570
571private:
572 std::string ClassName;
574 std::string AttributeName;
577};
578
579class SetAttributeIsNullCommand : public QUndoCommand
580{
581public:
584 void redo();
585 void undo();
586
587private:
588 std::string ClassName;
590 std::string AttributeName;
593};
594
595class SetAttributeInitialValuesCommand : public QUndoCommand
596{
597public:
600 std::string NewValues);
602 void redo();
603 void undo();
604
605private:
606 std::string ClassName;
608 std::string AttributeName;
611};
612
613class AddAttributeCommand : public QUndoCommand
614{
615public:
617 std::string name,
618 std::string type,
619 bool is_mv,
620 std::string range,
621 std::string init_values,
622 std::string description,
623 bool is_null,
626 void redo();
627 void undo();
628
629private:
630 std::string ClassName;
632 std::string SchemaName;
633 std::string SchemaType;
635 std::string SchemaRange;
636 std::string SchemaInitValues;
637 std::string SchemaDescription;
640};
641
642class RemoveAttributeCommand : public QUndoCommand
643{
644public:
647 std::string name,
648 std::string type,
649 bool is_mv,
650 std::string range,
651 std::string init_values,
652 std::string description,
653 bool is_null,
656 void redo();
657 void undo();
658
659private:
660 std::string ClassName;
662 std::string SchemaName;
663 std::string SchemaType;
665 std::string SchemaRange;
666 std::string SchemaInitValues;
667 std::string SchemaDescription;
670};
671
672} // namespace dbse
673
674#endif // SCHEMACOMMAND_H
AddAttributeCommand(dunedaq::oks::OksClass *Class, std::string name, std::string type, bool is_mv, std::string range, std::string init_values, std::string description, bool is_null, dunedaq::oks::OksAttribute::Format format=dunedaq::oks::OksAttribute::Format::Dec)
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksAttribute::Format SchemaFormat
AddMethodCommand(dunedaq::oks::OksClass *Class, std::string name, std::string description)
dunedaq::oks::OksMethod * SchemaMethod
dunedaq::oks::OksMethod * SchemaMethod
AddMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
dunedaq::oks::OksRelationship::CardinalityConstraint RelationshipLowCc
dunedaq::oks::OksRelationship::CardinalityConstraint RelationshipHighCc
std::string RelationshipDescription
dunedaq::oks::OksRelationship * SchemaRelationship
AddRelationship(dunedaq::oks::OksClass *Class, std::string Name, std::string Description, std::string Type, bool Composite, bool Exclusive, bool Dependent, dunedaq::oks::OksRelationship::CardinalityConstraint LowCc, dunedaq::oks::OksRelationship::CardinalityConstraint HighCc)
AddSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
CreateClassCommand(std::string ClassName, std::string ClassDescription, bool Abstract)
dunedaq::oks::OksClass * SchemaClass
dunedaq::oks::OksAttribute::Format SchemaFormat
RemoveAttributeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string name, std::string type, bool is_mv, std::string range, std::string init_values, std::string description, bool is_null, dunedaq::oks::OksAttribute::Format format=dunedaq::oks::OksAttribute::Format::Dec)
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksClass * SchemaClass
RemoveClassCommand(dunedaq::oks::OksClass *Class, std::string ClassName, std::string ClassDescription, bool Abstract)
RemoveMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name, std::string description)
dunedaq::oks::OksMethod * SchemaMethod
dunedaq::oks::OksMethod * SchemaMethod
RemoveMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
dunedaq::oks::OksRelationship::CardinalityConstraint RelationshipLowCc
dunedaq::oks::OksRelationship * SchemaRelationship
dunedaq::oks::OksRelationship::CardinalityConstraint RelationshipHighCc
RemoveRelationship(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Name, std::string Description, std::string Type, bool Composite, bool Exclusive, bool Dependent, dunedaq::oks::OksRelationship::CardinalityConstraint LowCc, dunedaq::oks::OksRelationship::CardinalityConstraint HighCc)
RemoveSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
SetAbstractClassCommand(dunedaq::oks::OksClass *Class, bool Value)
SetAttributeDescriptionCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewDescription)
dunedaq::oks::OksAttribute * SchemaAttribute
SetAttributeFormatCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, dunedaq::oks::OksAttribute::Format NewFormat)
dunedaq::oks::OksAttribute::Format OldAttributeFormat
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksAttribute::Format NewAttributeFormat
dunedaq::oks::OksAttribute * SchemaAttribute
SetAttributeInitialValuesCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewValues)
SetAttributeIsNullCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsNull)
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksAttribute * SchemaAttribute
SetAttributeMultiCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsMulti)
dunedaq::oks::OksAttribute * SchemaAttribute
SetAttributeNameCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewName)
SetAttributeRangeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewRange)
dunedaq::oks::OksAttribute * SchemaAttribute
SetAttributeTypeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewType)
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksRelationship * SchemaRelationship
SetClassTypeRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string ClassType)
SetDescriptionClassCommand(dunedaq::oks::OksClass *Class, std::string Description)
SetDescriptionMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string description)
dunedaq::oks::OksMethod * SchemaMethod
dunedaq::oks::OksRelationship * SchemaRelationship
SetDescriptionRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Description)
dunedaq::oks::OksRelationship::CardinalityConstraint NewHighCc
dunedaq::oks::OksRelationship::CardinalityConstraint OldHighCc
dunedaq::oks::OksRelationship * SchemaRelationship
SetHighCcRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
SetIsCompositeRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
dunedaq::oks::OksRelationship * SchemaRelationship
SetIsDependentRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
dunedaq::oks::OksRelationship * SchemaRelationship
SetIsExclusiveRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
dunedaq::oks::OksRelationship * SchemaRelationship
SetLowCcRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
dunedaq::oks::OksRelationship::CardinalityConstraint OldLowCc
dunedaq::oks::OksRelationship * SchemaRelationship
dunedaq::oks::OksRelationship::CardinalityConstraint NewLowCc
SetMethodImplementationBody(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
dunedaq::oks::OksMethodImplementation * SchemaImplementation
dunedaq::oks::OksMethodImplementation * SchemaImplementation
SetMethodImplementationLanguage(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Language)
dunedaq::oks::OksMethodImplementation * SchemaImplementation
SetMethodImplementationPrototype(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Prototype)
dunedaq::oks::OksMethod * SchemaMethod
SetNameMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name)
dunedaq::oks::OksRelationship * SchemaRelationship
SetNameRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Name)
OKS attribute class.
Definition attribute.hpp:94
The OKS class.
Definition class.hpp:223
OKS method implementation class.
Definition method.hpp:39
OKS method class.
Definition method.hpp:147
Including QT Headers.
The DUNE-DAQ namespace.
Definition ral.hpp:59