DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaKernelWrapper.cpp
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 src/SchemaEditor/SchemaKernelWrapper.cpp to apps/SchemaEditor/SchemaKernelWrapper.cpp).
5
7#include <QMessageBox>
11#include "oks/class.hpp"
12#include "oks/file.hpp"
13#include "oks/kernel.hpp"
14
15using namespace dunedaq;
16using namespace dunedaq::oks;
17
20{
21 static KernelWrapper KernelManager;
22 return KernelManager;
23}
24
30
31void
32dbse::KernelWrapper::SetActiveSchema(const std::string& ActiveSchema)
33{
34 OksFile* File = Kernel->find_schema_file(ActiveSchema);
35
36 if (File && IsFileWritable(ActiveSchema)) {
37 Kernel->set_active_schema(File);
38 emit active_updated();
39 }
40}
41
42void
43dbse::KernelWrapper::GetClassList(std::vector<OksClass*>& ClassList) const
44{
45 for (OksClass::Map::const_iterator i = Kernel->classes().begin(); i != Kernel->classes().end(); ++i) {
46 ClassList.push_back(i->second);
47 }
48}
49
50void
51dbse::KernelWrapper::GetClassListString(QStringList& ClassListString) const
52{
53 std::vector<OksClass*> ClassList;
54
55 for (OksClass::Map::const_iterator i = Kernel->classes().begin(); i != Kernel->classes().end(); ++i) {
56 ClassList.push_back(i->second);
57 }
58
59 for (OksClass* ClassInfo : ClassList) {
60 ClassListString.append(QString::fromStdString(ClassInfo->get_name()));
61 }
62}
63
64std::string
66{
67 auto file = Kernel->get_active_schema();
68 if (file) {
69 return file->get_full_file_name();
70 } else {
71 return "";
72 }
73}
74
75// void dbse::KernelWrapper::AddInclude( std::string IncludeFile ) const
76// {
77// auto ActiveSchema = Kernel->get_active_schema();
78// ActiveSchema->add_include_file( IncludeFile );
79// Kernel->load_schema( IncludeFile, ActiveSchema );
80// }
81void
82dbse::KernelWrapper::AddInclude(std::string schemaFile, std::string IncludeFile) const
83{
84 auto ParentSchema = Kernel->find_schema_file(schemaFile);
85 if (ParentSchema != nullptr) {
86 ParentSchema->add_include_file(IncludeFile);
87 Kernel->load_schema(IncludeFile, ParentSchema);
88 }
89}
90
91void
92dbse::KernelWrapper::RemoveInclude(std::string schemaFile, std::string IncludeFile) const
93{
94 auto ParentSchema = Kernel->find_schema_file(schemaFile);
95 if (ParentSchema != nullptr) {
96 ParentSchema->remove_include_file(IncludeFile);
97 }
98}
99
100void
101dbse::KernelWrapper::GetSchemaFiles(std::vector<std::string>& SchemaFiles)
102{
103 for (OksFile::Map::const_iterator i = Kernel->schema_files().begin(); i != Kernel->schema_files().end(); ++i) {
104 SchemaFiles.push_back(*(i->first));
105 }
106}
107
108void
109dbse::KernelWrapper::GetSchemaFiles(std::vector<OksFile*>& SchemaFiles)
110{
111 for (auto [name, file] : Kernel->schema_files()) {
112 SchemaFiles.push_back(file);
113 }
114}
115
116std::vector<OksClass*>
118{
119 auto file = Kernel->find_schema_file(filename);
120 std::vector<OksClass*> list;
121 auto klist = Kernel->create_list_of_schema_classes(file);
122 if (klist != nullptr) {
123 for (auto cls : *klist) {
124 list.push_back(cls /*->get_name()*/);
125 }
126 delete klist;
127 }
128 return list;
129}
130
131void
132dbse::KernelWrapper::GetIncludedList(const std::string& filename, std::set<std::string>& included_files)
133{
134 Kernel->get_includes(filename, included_files);
135}
136void
137dbse::KernelWrapper::get_all_includes(const std::string& filename, std::set<std::string>& included_files)
138{
139 auto parentschema = Kernel->find_schema_file(filename);
140 if (parentschema != nullptr) {
141 std::set<OksFile*> includes;
142 parentschema->get_all_include_files(Kernel, includes);
143 for (auto file : includes) {
144 included_files.insert(file->get_full_file_name());
145 }
146 }
147}
148
149void
150dbse::KernelWrapper::get_direct_includes(const std::string& filename, std::set<std::string>& included_files)
151{
152 auto parentschema = Kernel->find_schema_file(filename);
153 if (parentschema != nullptr) {
154 for (auto file : parentschema->get_include_files()) {
155 included_files.insert(file);
156 }
157 }
158}
159
160bool
161dbse::KernelWrapper::IsFileWritable(const std::string& FileName) const
162{
163 OksFile* File = Kernel->find_schema_file(FileName);
164
165 if (File) {
166 return (!File->is_read_only());
167 }
168
169 return false;
170}
171
172bool
173dbse::KernelWrapper::is_file_modified(const std::string& FileName) const
174{
175 OksFile* file = Kernel->find_schema_file(FileName);
176 if (file != nullptr) {
177 return file->is_updated();
178 }
179 return false;
180}
181
183dbse::KernelWrapper::FindClass(std::string ClassName) const
184{
185 return Kernel->find_class(ClassName);
186}
187
188OksFile*
189dbse::KernelWrapper::LoadSchema(const std::string& SchemaName) const
190{
191 return Kernel->load_schema(SchemaName);
192}
193
194void
196{
197 Kernel->save_all_schema();
198}
199
200std::string
202{
203 std::string modified{ "" };
204 for (auto [name, file] : Kernel->schema_files()) {
205 if (file->is_updated()) {
206 modified += file->get_full_file_name() + "\n\n";
207 }
208 }
209 return modified;
210}
211
212std::vector<std::string>
214{
215 std::vector<std::string> modified;
216 for (auto [name, file] : Kernel->schema_files()) {
217 if (file->is_updated()) {
218 modified.push_back(file->get_full_file_name());
219 }
220 }
221 return modified;
222}
223
224std::string
226{
227 std::string saved{ "" };
228 for (auto [name, file] : Kernel->schema_files()) {
229 if (file->is_updated()) {
230 Kernel->save_schema(file);
231 saved += file->get_full_file_name() + "\n\n";
232 }
233 }
234 return saved;
235}
236
237void
238dbse::KernelWrapper::SaveSchema(const std::string& schema_file) const
239{
240 OksFile* file = Kernel->find_schema_file(schema_file);
241 Kernel->save_schema(file);
242}
243
244void
246{
247 Kernel->close_all_schema();
248}
249
250void
251dbse::KernelWrapper::CreateNewSchema(const std::string& SchemaName) const
252{
253 Kernel->new_schema(SchemaName);
254}
255
256bool
258{
259 std::vector<OksClass*> ClassList;
260 GetClassList(ClassList);
261
262 for (OksClass* ClassInfo : ClassList) {
263 const std::list<OksRelationship*>* RelationshipList = ClassInfo->direct_relationships();
264
265 if (RelationshipList != nullptr) {
266 for (OksRelationship* RelationshipInfo : *RelationshipList) {
267 if (RelationshipInfo->get_class_type()->get_name() == SchemaClass->get_name()) {
268 return true;
269 }
270 }
271 }
272 }
273
274 return false;
275}
276
277QString
279{
280 QString RelationshipLowCc(OksRelationship::card2str(SchemaRelationship->get_low_cardinality_constraint()));
281 QString RelationshipHighCc(OksRelationship::card2str(SchemaRelationship->get_high_cardinality_constraint()));
282
283 if (RelationshipLowCc == "zero") {
284 RelationshipLowCc = "0";
285 } else if (RelationshipLowCc == "one") {
286 RelationshipLowCc = "1";
287 } else if (RelationshipLowCc == "many") {
288 RelationshipLowCc = "n";
289 }
290
291 if (RelationshipHighCc == "zero") {
292 RelationshipHighCc = "0";
293 } else if (RelationshipHighCc == "one") {
294 RelationshipHighCc = "1";
295 } else if (RelationshipHighCc == "many") {
296 RelationshipHighCc = "n";
297 }
298
299 return QString(RelationshipLowCc + ':' + RelationshipHighCc);
300}
301
302bool
304{
305 OksFile* ActiveSchemaFile = Kernel->get_active_schema();
306 return (ActiveSchemaFile != nullptr);
307}
308
309void
314
315bool
320
321QUndoStack*
326
327void
329{
330 try {
331 CommandStack->push(new SetAbstractClassCommand(Class, Value));
332 } catch (oks::exception& Ex) {
333 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
334 }
335}
336
337void
339{
340 try {
341 CommandStack->push(new SetDescriptionClassCommand(Class, Description));
342 } catch (oks::exception& Ex) {
343 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
344 }
345}
346
347void
349{
350 try {
351 CommandStack->push(new AddSuperClassCommand(Class, SuperClass));
352 } catch (oks::exception& Ex) {
353 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
354 }
355}
356
357void
359{
360 try {
361 CommandStack->push(new RemoveSuperClassCommand(Class, SuperClass));
362 } catch (oks::exception& Ex) {
363 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
364 }
365}
366
367void
368dbse::KernelWrapper::PushCreateClassCommand(std::string ClassName, std::string ClassDescription, bool Abstract)
369{
370 try {
371 CommandStack->push(new CreateClassCommand(ClassName, ClassDescription, Abstract));
372 } catch (...) {
373 QMessageBox::warning(0, "Schema editor", QString("Error"));
374 }
375}
376
377void
379 std::string ClassName,
380 std::string ClassDescription,
381 bool Abstract)
382{
383 try {
384 CommandStack->push(new RemoveClassCommand(Class, ClassName, ClassDescription, Abstract));
385 } catch (oks::exception& Ex) {
386 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
387 }
388}
389
390void
392{
393 try {
394 CommandStack->push(new SetNameRelationshipCommand(Class, Relationship, Name));
395 } catch (oks::exception& Ex) {
396 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
397 }
398}
399
400void
402 OksRelationship* Relationship,
403 std::string ClassType)
404{
405 try {
406 CommandStack->push(new SetClassTypeRelationshipCommand(Class, Relationship, ClassType));
407 } catch (oks::exception& Ex) {
408 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
409 }
410}
411
412void
414 OksRelationship* Relationship,
415 std::string Description)
416{
417 try {
418 CommandStack->push(new SetDescriptionRelationshipCommand(Class, Relationship, Description));
419 } catch (oks::exception& Ex) {
420 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
421 }
422}
423
424void
426 OksRelationship* Relationship,
428{
429 try {
430 CommandStack->push(new SetLowCcRelationshipCommand(Class, Relationship, NewCardinality));
431 } catch (oks::exception& Ex) {
432 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
433 }
434}
435
436void
438 OksRelationship* Relationship,
440{
441 try {
442 CommandStack->push(new SetHighCcRelationshipCommand(Class, Relationship, NewCardinality));
443 } catch (oks::exception& Ex) {
444 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
445 }
446}
447
448void
450{
451 try {
452 CommandStack->push(new SetIsCompositeRelationshipCommand(Class, Relationship, Value));
453 } catch (oks::exception& Ex) {
454 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
455 }
456}
457
458void
460{
461 try {
462 CommandStack->push(new SetIsDependentRelationshipCommand(Class, Relationship, Value));
463 } catch (oks::exception& Ex) {
464 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
465 }
466}
467
468void
470{
471 try {
472 CommandStack->push(new SetIsExclusiveRelationshipCommand(Class, Relationship, Value));
473 } catch (oks::exception& Ex) {
474 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
475 }
476}
477
478void
480 std::string Name,
481 std::string Description,
482 std::string Type,
483 bool Composite,
484 bool Exclusive,
485 bool Dependent,
488{
489 try {
490 CommandStack->push(
491 new AddRelationship(Class, Name, Description, Type, Composite, Exclusive, Dependent, LowCc, HighCc));
492 } catch (oks::exception& Ex) {
493 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
494 }
495}
496
497void
499 OksRelationship* Relationship,
500 std::string Name,
501 std::string Description,
502 std::string Type,
503 bool Composite,
504 bool Exclusive,
505 bool Dependent,
508{
509 try {
511 Class, Relationship, Name, Description, Type, Composite, Exclusive, Dependent, LowCc, HighCc));
512 } catch (oks::exception& Ex) {
513 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
514 }
515}
516
517void
519 OksMethod* Method,
520 OksMethodImplementation* Implementation,
521 std::string Language)
522{
523 try {
524 CommandStack->push(new SetMethodImplementationLanguage(Class, Method, Implementation, Language));
525 } catch (oks::exception& Ex) {
526 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
527 }
528}
529
530void
532 OksMethod* Method,
533 OksMethodImplementation* Implementation,
534 std::string Prototype)
535{
536 try {
537 CommandStack->push(new SetMethodImplementationPrototype(Class, Method, Implementation, Prototype));
538 } catch (oks::exception& Ex) {
539 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
540 }
541}
542
543void
545 OksMethod* Method,
546 OksMethodImplementation* Implementation,
547 std::string Body)
548{
549 try {
550 CommandStack->push(new SetMethodImplementationBody(Class, Method, Implementation, Body));
551 } catch (oks::exception& Ex) {
552 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
553 }
554}
555
556void
558 OksMethod* Method,
559 std::string Language,
560 std::string Prototype,
561 std::string Body)
562{
563 try {
564 CommandStack->push(new AddMethodImplementationComand(Class, Method, Language, Prototype, Body));
565 } catch (oks::exception& Ex) {
566 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
567 }
568}
569
570void
572 OksMethod* Method,
573 std::string Language,
574 std::string Prototype,
575 std::string Body)
576{
577 try {
578 CommandStack->push(new RemoveMethodImplementationComand(Class, Method, Language, Prototype, Body));
579 } catch (oks::exception& Ex) {
580 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
581 }
582}
583
584void
586{
587 try {
588 CommandStack->push(new SetNameMethodCommand(Class, Method, name));
589 } catch (oks::exception& Ex) {
590 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
591 }
592}
593
594void
596{
597 try {
598 CommandStack->push(new SetDescriptionMethodCommand(Class, Method, description));
599 } catch (oks::exception& Ex) {
600 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
601 }
602}
603
604void
605dbse::KernelWrapper::PushAddMethodCommand(OksClass* Class, std::string name, std::string description)
606{
607 try {
608 CommandStack->push(new AddMethodCommand(Class, name, description));
609 } catch (oks::exception& Ex) {
610 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
611 }
612}
613
614void
616 OksMethod* Method,
617 std::string name,
618 std::string description)
619{
620 try {
621 CommandStack->push(new RemoveMethodCommand(Class, Method, name, description));
622 } catch (oks::exception& Ex) {
623 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
624 }
625}
626
627void
629{
630 try {
631 CommandStack->push(new SetAttributeNameCommand(Class, Attribute, NewName));
632 } catch (oks::exception& Ex) {
633 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
634 }
635}
636
637void
639 OksAttribute* Attribute,
640 std::string NewDescription)
641{
642 try {
643 CommandStack->push(new SetAttributeDescriptionCommand(Class, Attribute, NewDescription));
644 } catch (oks::exception& Ex) {
645 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
646 }
647}
648
649void
651{
652 try {
653 CommandStack->push(new SetAttributeTypeCommand(Class, Attribute, NewType));
654 } catch (oks::exception& Ex) {
655 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
656 }
657}
658
659void
661{
662 try {
663 CommandStack->push(new SetAttributeRangeCommand(Class, Attribute, NewRange));
664 } catch (oks::exception& Ex) {
665 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
666 }
667}
668
669void
671 OksAttribute* Attribute,
672 OksAttribute::Format NewFormat)
673{
674 try {
675 CommandStack->push(new SetAttributeFormatCommand(Class, Attribute, NewFormat));
676 } catch (oks::exception& Ex) {
677 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
678 }
679}
680
681void
683{
684 try {
685 CommandStack->push(new SetAttributeMultiCommand(Class, Attribute, NewIsMulti));
686 } catch (oks::exception& Ex) {
687 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
688 }
689}
690
691void
693{
694 try {
695 CommandStack->push(new SetAttributeIsNullCommand(Class, Attribute, NewIsNull));
696 } catch (oks::exception& Ex) {
697 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
698 }
699}
700
701void
703 OksAttribute* Attribute,
704 std::string NewValues)
705{
706 try {
707 CommandStack->push(new SetAttributeInitialValuesCommand(Class, Attribute, NewValues));
708 } catch (oks::exception& Ex) {
709 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
710 }
711}
712
713void
715 std::string name,
716 std::string type,
717 bool is_mv,
718 std::string range,
719 std::string init_values,
720 std::string description,
721 bool is_null,
723{
724 try {
725 CommandStack->push(
726 new AddAttributeCommand(Class, name, type, is_mv, range, init_values, description, is_null, format));
727 } catch (oks::exception& Ex) {
728 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
729 }
730}
731
732void
734 OksAttribute* Attribute,
735 std::string name,
736 std::string type,
737 bool is_mv,
738 std::string range,
739 std::string init_values,
740 std::string description,
741 bool is_null,
743{
744 try {
746 Class, Attribute, name, type, is_mv, range, init_values, description, is_null, format));
747 } catch (oks::exception& Ex) {
748 QMessageBox::warning(0, "Schema editor", QString("Error : \n\n %1").arg(Ex.what()));
749 }
750}
751
753 : QObject(parent)
754 , Kernel(new OksKernel())
755 , CommandStack(new QUndoStack())
756 , InheritanceMode(false)
757{
758}
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)
AddMethodCommand(dunedaq::oks::OksClass *Class, std::string name, std::string description)
AddMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
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)
void PushSetIsCompositeRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
void PushRemoveSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
void PushSetAttributeDescriptionCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewDescription)
void PushSetAttributeIsNullCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsNull)
std::string GetActiveSchema() const
void GetClassListString(QStringList &ClassListString) const
void GetIncludedList(const std::string &FileName, std::set< std::string > &IncludedFiles)
std::string SaveModifiedSchema() const
static KernelWrapper & GetInstance()
void PushSetAttributeRangeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewRange)
void GetClassList(std::vector< dunedaq::oks::OksClass * > &ClassList) const
QUndoStack * GetUndoStack()
Stack Functions.
dunedaq::oks::OksFile * LoadSchema(const std::string &SchemaName) const
dunedaq::oks::OksKernel * GetKernel()
QString GetCardinalityStringRelationship(dunedaq::oks::OksRelationship *SchemaRelationship) const
void PushSetMethodImplementationLanguage(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Language)
Method implementation commands.
void PushSetHighCcRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
void PushSetAttributeFormatCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, dunedaq::oks::OksAttribute::Format NewFormat)
void SetActiveSchema(const std::string &ActiveSchema)
void PushSetAbstractClassCommand(dunedaq::oks::OksClass *Class, bool Value)
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
void PushSetIsDependentRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
void RemoveInclude(std::string schemaFile, std::string IncludeFile) const
void SaveSchema(const std::string &file) const
void PushAddSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
void PushSetMethodImplementationPrototype(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Prototype)
void PushRemoveAttributeCommand(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)
void PushAddRelationship(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)
void PushAddMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
std::vector< std::string > get_modified_schema_files() const
void PushSetIsExclusiveRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
void PushSetDescriptionClassCommand(dunedaq::oks::OksClass *Class, std::string Description)
std::string ModifiedSchemaFiles() const
void PushSetAttributeMultiCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsMulti)
bool AnyClassReferenceThis(dunedaq::oks::OksClass *SchemaClass)
void PushSetAttributeInitialValuesCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewValues)
void PushSetDescriptionMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string description)
KernelWrapper(QObject *parent=nullptr)
void SetInheritanceMode(bool Mode)
Editor Functions.
void PushSetClassTypeRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string ClassType)
dunedaq::oks::OksKernel * Kernel
void PushRemoveMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
void CreateNewSchema(const std::string &SchemaName) const
void PushSetNameMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name)
Method commands.
void PushRemoveRelationship(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)
void PushSetAttributeTypeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewType)
void PushAddAttributeCommand(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)
void PushRemoveClassCommand(dunedaq::oks::OksClass *Class, std::string ClassName, std::string ClassDescription, bool Abstract)
void PushSetLowCcRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
bool IsFileWritable(const std::string &FileName) const
void AddInclude(std::string schemaFile, std::string IncludeFile) const
void PushSetDescriptionRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Description)
void PushAddMethodCommand(dunedaq::oks::OksClass *Class, std::string name, std::string description)
void get_all_includes(const std::string &FileName, std::set< std::string > &IncludedFiles)
void PushRemoveMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name, std::string description)
void PushCreateClassCommand(std::string ClassName, std::string ClassDescription, bool Abstract)
void PushSetNameRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Name)
Relationship commands.
void PushSetAttributeNameCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewName)
Attribute commands.
std::vector< dunedaq::oks::OksClass * > get_schema_classes(std::string &filename)
void PushSetMethodImplementationBody(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
bool is_file_modified(const std::string &FileName) const
void GetSchemaFiles(std::vector< std::string > &SchemaFiles)
void get_direct_includes(const std::string &FileName, std::set< std::string > &IncludedFiles)
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)
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)
RemoveMethodImplementationComand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
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)
SetAttributeFormatCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, dunedaq::oks::OksAttribute::Format NewFormat)
SetAttributeInitialValuesCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewValues)
SetAttributeIsNullCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsNull)
SetAttributeMultiCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsMulti)
SetAttributeNameCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewName)
SetAttributeRangeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewRange)
SetAttributeTypeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewType)
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)
SetDescriptionRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Description)
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)
SetIsDependentRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
SetIsExclusiveRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
SetLowCcRelationshipCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
SetMethodImplementationBody(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
SetMethodImplementationLanguage(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Language)
SetMethodImplementationPrototype(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Prototype)
SetNameMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name)
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
const std::string & get_name() const noexcept
Definition class.hpp:374
Provides interface to the OKS XML schema and data files.
Definition file.hpp:355
bool is_read_only() const
Return read-only status of OKS file.
Definition file.hpp:626
Provides interface to the OKS kernel.
Definition kernel.hpp:615
OKS method implementation class.
Definition method.hpp:39
OKS method class.
Definition method.hpp:147
CardinalityConstraint get_high_cardinality_constraint() const noexcept
Get relationship high cardinality constraint.
static const char * card2str(CardinalityConstraint) noexcept
CardinalityConstraint get_low_cardinality_constraint() const noexcept
Get relationship low cardinality constraint.
virtual const char * what() const noexcept
The DUNE-DAQ namespace.
DAC value out of range
Message.
Definition DACNode.hpp:32