DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaKernelWrapper.cpp
Go to the documentation of this file.
1
2#include <QMessageBox>
6#include "oks/kernel.hpp"
7#include "oks/class.hpp"
8#include "oks/file.hpp"
9
10using namespace dunedaq;
11using namespace dunedaq::oks;
12
14{
15 static KernelWrapper KernelManager;
16 return KernelManager;
17}
18
20{
21 return Kernel;
22}
23
24void dbse::KernelWrapper::SetActiveSchema ( const std::string & ActiveSchema )
25{
26 OksFile * File = Kernel->find_schema_file ( ActiveSchema );
27
28 if ( File && IsFileWritable( ActiveSchema ))
29 {
30 Kernel->set_active_schema ( File );
31 emit active_updated();
32 }
33}
34
35void dbse::KernelWrapper::GetClassList ( std::vector<OksClass *> & ClassList ) const
36{
37 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
38 i != Kernel->classes().end(); ++i )
39 {
40 ClassList.push_back ( i->second );
41 }
42}
43
44void dbse::KernelWrapper::GetClassListString ( QStringList & ClassListString ) const
45{
46 std::vector<OksClass *> ClassList;
47
48 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
49 i != Kernel->classes().end(); ++i )
50 {
51 ClassList.push_back ( i->second );
52 }
53
54 for ( OksClass * ClassInfo : ClassList )
55 {
56 ClassListString.append ( QString::fromStdString ( ClassInfo->get_name() ) );
57 }
58}
59
61{
62 auto file = Kernel->get_active_schema();
63 if ( file) {
64 return file->get_full_file_name();
65 }
66 else {
67 return "";
68 }
69}
70
71// void dbse::KernelWrapper::AddInclude( std::string IncludeFile ) const
72// {
73// auto ActiveSchema = Kernel->get_active_schema();
74// ActiveSchema->add_include_file( IncludeFile );
75// Kernel->load_schema( IncludeFile, ActiveSchema );
76// }
77void dbse::KernelWrapper::AddInclude( std::string schemaFile, std::string IncludeFile ) const
78{
79 auto ParentSchema = Kernel->find_schema_file( schemaFile );
80 if ( ParentSchema != nullptr) {
81 ParentSchema->add_include_file( IncludeFile );
82 Kernel->load_schema( IncludeFile, ParentSchema );
83 }
84}
85
86void dbse::KernelWrapper::RemoveInclude( std::string schemaFile, std::string IncludeFile ) const
87{
88 auto ParentSchema = Kernel->find_schema_file( schemaFile );
89 if (ParentSchema != nullptr) {
90 ParentSchema->remove_include_file( IncludeFile );
91 }
92}
93
94void dbse::KernelWrapper::GetSchemaFiles ( std::vector<std::string> & SchemaFiles )
95{
96 for ( OksFile::Map::const_iterator i = Kernel->schema_files().begin();
97 i != Kernel->schema_files().end(); ++i )
98 {
99 SchemaFiles.push_back ( * ( i->first ) );
100 }
101}
102
103void dbse::KernelWrapper::GetSchemaFiles ( std::vector<OksFile*> & SchemaFiles )
104{
105 for (auto [name, file]: Kernel->schema_files())
106 {
107 SchemaFiles.push_back ( file );
108 }
109}
110
111std::vector<OksClass*>
113{
114 auto file = Kernel->find_schema_file ( filename );
115 std::vector<OksClass*> list;
116 auto klist = Kernel->create_list_of_schema_classes(file);
117 if (klist != nullptr) {
118 for (auto cls: *klist) {
119 list.push_back(cls/*->get_name()*/);
120 }
121 delete klist;
122 }
123 return list;
124}
125
127 std::set<std::string> & included_files )
128{
129 Kernel->get_includes ( filename, included_files );
130}
132 std::set<std::string> & included_files )
133{
134 auto parentschema = Kernel->find_schema_file( filename );
135 if ( parentschema != nullptr) {
136 std::set<OksFile*> includes;
137 parentschema->get_all_include_files(Kernel, includes);
138 for (auto file : includes) {
139 included_files.insert(file->get_full_file_name());
140 }
141 }
142}
143
145 std::set<std::string> & included_files )
146{
147 auto parentschema = Kernel->find_schema_file( filename );
148 if ( parentschema != nullptr) {
149 for (auto file : parentschema->get_include_files()) {
150 included_files.insert(file);
151 }
152 }
153}
154
155bool dbse::KernelWrapper::IsFileWritable (const std::string & FileName ) const
156{
157 OksFile * File = Kernel->find_schema_file ( FileName );
158
159 if ( File )
160 {
161 return ( !File->is_read_only() );
162 }
163
164 return false;
165}
166
167bool dbse::KernelWrapper::is_file_modified (const std::string & FileName ) const
168{
169 OksFile* file = Kernel->find_schema_file ( FileName );
170 if (file != nullptr) {
171 return file->is_updated();
172 }
173 return false;
174}
175
176OksClass * dbse::KernelWrapper::FindClass ( std::string ClassName ) const
177{
178 return Kernel->find_class ( ClassName );
179}
180
181void dbse::KernelWrapper::LoadSchema ( const std::string & SchemaName ) const
182{
183 Kernel->load_schema ( SchemaName );
184}
185
187{
188 Kernel->save_all_schema();
189}
190
192{
193 std::string modified{""};
194 for (auto [name, file] : Kernel->schema_files()) {
195 if (file->is_updated()) {
196 modified += file->get_full_file_name() + "\n\n";
197 }
198 }
199 return modified;
200}
201
203{
204 std::vector<std::string> modified;
205 for (auto [name, file] : Kernel->schema_files()) {
206 if (file->is_updated()) {
207 modified.push_back(file->get_full_file_name());
208 }
209 }
210 return modified;
211}
212
214{
215 std::string saved{""};
216 for (auto [name, file] : Kernel->schema_files()) {
217 if (file->is_updated()) {
218 Kernel->save_schema(file);
219 saved += file->get_full_file_name() + "\n\n";
220 }
221 }
222 return saved;
223}
224
225void dbse::KernelWrapper::SaveSchema(const std::string& schema_file) const
226{
227 OksFile * file = Kernel->find_schema_file ( schema_file );
228 Kernel->save_schema(file);
229}
230
231
233{
234 Kernel->close_all_schema();
235}
236
237void dbse::KernelWrapper::CreateNewSchema ( const std::string & SchemaName ) const
238{
239 Kernel->new_schema ( SchemaName );
240}
241
243{
244 std::vector<OksClass *> ClassList;
245 GetClassList ( ClassList );
246
247 for ( OksClass * ClassInfo : ClassList )
248 {
249 const std::list<OksRelationship *> * RelationshipList = ClassInfo->direct_relationships();
250
251 if ( RelationshipList != nullptr )
252 {
253 for ( OksRelationship * RelationshipInfo : *RelationshipList )
254 {
255 if ( RelationshipInfo->get_class_type()->get_name() == SchemaClass->get_name() )
256 {
257 return true;
258 }
259 }
260 }
261 }
262
263 return false;
264}
265
267 OksRelationship * SchemaRelationship ) const
268{
269 QString RelationshipLowCc (
271 QString RelationshipHighCc (
273
274 if ( RelationshipLowCc == "zero" )
275 {
276 RelationshipLowCc = "0";
277 }
278 else if ( RelationshipLowCc == "one" )
279 {
280 RelationshipLowCc = "1";
281 }
282 else if ( RelationshipLowCc == "many" )
283 {
284 RelationshipLowCc = "n";
285 }
286
287 if ( RelationshipHighCc == "zero" )
288 {
289 RelationshipHighCc = "0";
290 }
291 else if ( RelationshipHighCc == "one" )
292 {
293 RelationshipHighCc = "1";
294 }
295 else if ( RelationshipHighCc == "many" )
296 {
297 RelationshipHighCc = "n";
298 }
299
300 return QString ( RelationshipLowCc + ':' + RelationshipHighCc );
301}
302
304{
305 OksFile * ActiveSchemaFile = Kernel->get_active_schema();
306 return ( ActiveSchemaFile != nullptr );
307}
308
310{
311 InheritanceMode = Mode;
312}
313
315{
316 return InheritanceMode;
317}
318
320{
321 return CommandStack;
322}
323
325{
326 try
327 {
328 CommandStack->push ( new SetAbstractClassCommand ( Class, Value ) );
329 }
330 catch ( oks::exception & Ex )
331 {
332 QMessageBox::warning ( 0, "Schema editor",
333 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
334 }
335}
336
338 std::string Description )
339{
340 try
341 {
342 CommandStack->push ( new SetDescriptionClassCommand ( Class, Description ) );
343 }
344 catch ( oks::exception & Ex )
345 {
346 QMessageBox::warning ( 0, "Schema editor",
347 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
348 }
349}
350
352 std::string SuperClass )
353{
354 try
355 {
356 CommandStack->push ( new AddSuperClassCommand ( Class, SuperClass ) );
357 }
358 catch ( oks::exception & Ex )
359 {
360 QMessageBox::warning ( 0, "Schema editor",
361 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
362 }
363}
364
366 std::string SuperClass )
367{
368 try
369 {
370 CommandStack->push ( new RemoveSuperClassCommand ( Class, SuperClass ) );
371 }
372 catch ( oks::exception & Ex )
373 {
374 QMessageBox::warning ( 0, "Schema editor",
375 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
376 }
377}
378
380 std::string ClassDescription,
381 bool Abstract )
382{
383 try
384 {
385 CommandStack->push ( new CreateClassCommand ( ClassName, ClassDescription, Abstract ) );
386 }
387 catch ( ... )
388 {
389 QMessageBox::warning ( 0, "Schema editor", QString ( "Error" ) );
390 }
391}
392
393void dbse::KernelWrapper::PushRemoveClassCommand ( OksClass * Class, std::string ClassName,
394 std::string ClassDescription, bool Abstract )
395{
396 try
397 {
398 CommandStack->push ( new RemoveClassCommand ( Class, ClassName, ClassDescription,
399 Abstract ) );
400 }
401 catch ( oks::exception & Ex )
402 {
403 QMessageBox::warning ( 0, "Schema editor",
404 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
405 }
406}
407
409 OksRelationship * Relationship,
410 std::string Name )
411{
412 try
413 {
414 CommandStack->push ( new SetNameRelationshipCommand ( Class, Relationship, Name ) );
415 }
416 catch ( oks::exception & Ex )
417 {
418 QMessageBox::warning ( 0, "Schema editor",
419 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
420 }
421}
422
424 OksRelationship * Relationship,
425 std::string ClassType )
426{
427 try
428 {
429 CommandStack->push ( new SetClassTypeRelationshipCommand ( Class, Relationship, ClassType ) );
430 }
431 catch ( oks::exception & Ex )
432 {
433 QMessageBox::warning ( 0, "Schema editor",
434 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
435 }
436}
437
439 OksClass* Class,
440 OksRelationship * Relationship,
441 std::string Description )
442{
443 try
444 {
445 CommandStack->push ( new SetDescriptionRelationshipCommand ( Class, Relationship, Description ) );
446 }
447 catch ( oks::exception & Ex )
448 {
449 QMessageBox::warning ( 0, "Schema editor",
450 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
451 }
452}
453
455 OksClass* Class, OksRelationship * Relationship, OksRelationship::CardinalityConstraint NewCardinality )
456{
457 try
458 {
459 CommandStack->push ( new SetLowCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
460 }
461 catch ( oks::exception & Ex )
462 {
463 QMessageBox::warning ( 0, "Schema editor",
464 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
465 }
466}
467
469 OksClass* Class, OksRelationship * Relationship, OksRelationship::CardinalityConstraint NewCardinality )
470{
471 try
472 {
473 CommandStack->push ( new SetHighCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
474 }
475 catch ( oks::exception & Ex )
476 {
477 QMessageBox::warning ( 0, "Schema editor",
478 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
479 }
480}
481
483 OksClass* Class, OksRelationship * Relationship,
484 bool Value )
485{
486 try
487 {
488 CommandStack->push ( new SetIsCompositeRelationshipCommand ( Class, Relationship, Value ) );
489 }
490 catch ( oks::exception & Ex )
491 {
492 QMessageBox::warning ( 0, "Schema editor",
493 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
494 }
495}
496
498 OksClass* Class,
499 OksRelationship * Relationship,
500 bool Value )
501{
502 try
503 {
504 CommandStack->push ( new SetIsDependentRelationshipCommand ( Class, Relationship, Value ) );
505 }
506 catch ( oks::exception & Ex )
507 {
508 QMessageBox::warning ( 0, "Schema editor",
509 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
510 }
511}
512
514 OksClass* Class,
515 OksRelationship * Relationship,
516 bool Value )
517{
518 try
519 {
520 CommandStack->push ( new SetIsExclusiveRelationshipCommand ( Class, Relationship, Value ) );
521 }
522 catch ( oks::exception & Ex )
523 {
524 QMessageBox::warning ( 0, "Schema editor",
525 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
526 }
527}
528
529void dbse::KernelWrapper::PushAddRelationship ( OksClass * Class, std::string Name,
530 std::string Description, std::string Type,
531 bool Composite, bool Exclusive, bool Dependent,
534{
535 try
536 {
537 CommandStack->push (
538 new AddRelationship ( Class, Name, Description, Type, Composite, Exclusive, Dependent,
539 LowCc, HighCc ) );
540 }
541 catch ( oks::exception & Ex )
542 {
543 QMessageBox::warning ( 0, "Schema editor",
544 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
545 }
546}
547
549 OksRelationship * Relationship,
550 std::string Name, std::string Description,
551 std::string Type, bool Composite, bool Exclusive,
552 bool Dependent,
555{
556 try
557 {
558 CommandStack->push (
559 new RemoveRelationship ( Class, Relationship, Name, Description, Type, Composite,
560 Exclusive, Dependent, LowCc, HighCc ) );
561 }
562 catch ( oks::exception & Ex )
563 {
564 QMessageBox::warning ( 0, "Schema editor",
565 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
566 }
567}
568
570 OksMethod * Method,
571 OksMethodImplementation * Implementation,
572 std::string Language )
573{
574 try
575 {
576 CommandStack->push ( new SetMethodImplementationLanguage ( Class, Method, Implementation, Language ) );
577 }
578 catch ( oks::exception & Ex )
579 {
580 QMessageBox::warning ( 0, "Schema editor",
581 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
582 }
583}
584
586 OksClass * Class, OksMethod * Method, OksMethodImplementation * Implementation, std::string Prototype )
587{
588 try
589 {
590 CommandStack->push ( new SetMethodImplementationPrototype ( Class, Method, Implementation, Prototype ) );
591 }
592 catch ( oks::exception & Ex )
593 {
594 QMessageBox::warning ( 0, "Schema editor",
595 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
596 }
597}
598
600 OksMethod * Method,
601 OksMethodImplementation * Implementation,
602 std::string Body )
603{
604 try
605 {
606 CommandStack->push ( new SetMethodImplementationBody ( Class, Method, Implementation, Body ) );
607 }
608 catch ( oks::exception & Ex )
609 {
610 QMessageBox::warning ( 0, "Schema editor",
611 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
612 }
613}
614
616 OksMethod * Method,
617 std::string Language,
618 std::string Prototype, std::string Body )
619{
620 try
621 {
622 CommandStack->push ( new AddMethodImplementationComand ( Class, Method, Language, Prototype,
623 Body ) );
624 }
625 catch ( oks::exception & Ex )
626 {
627 QMessageBox::warning ( 0, "Schema editor",
628 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
629 }
630}
631
633 OksMethod * Method,
634 std::string Language,
635 std::string Prototype,
636 std::string Body )
637{
638 try
639 {
640 CommandStack->push ( new RemoveMethodImplementationComand ( Class, Method, Language, Prototype,
641 Body ) );
642 }
643 catch ( oks::exception & Ex )
644 {
645 QMessageBox::warning ( 0, "Schema editor",
646 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
647 }
648}
649
650void dbse::KernelWrapper::PushSetNameMethodCommand ( OksClass * Class, OksMethod * Method, std::string name )
651{
652 try
653 {
654 CommandStack->push ( new SetNameMethodCommand ( Class, Method, name ) );
655 }
656 catch ( oks::exception & Ex )
657 {
658 QMessageBox::warning ( 0, "Schema editor",
659 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
660 }
661}
662
664 std::string description )
665{
666 try
667 {
668 CommandStack->push ( new SetDescriptionMethodCommand ( Class, Method, description ) );
669 }
670 catch ( oks::exception & Ex )
671 {
672 QMessageBox::warning ( 0, "Schema editor",
673 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
674 }
675}
676
678 std::string description )
679{
680 try
681 {
682 CommandStack->push ( new AddMethodCommand ( Class, name, description ) );
683 }
684 catch ( oks::exception & Ex )
685 {
686 QMessageBox::warning ( 0, "Schema editor",
687 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
688 }
689}
690
692 std::string name, std::string description )
693{
694 try
695 {
696 CommandStack->push ( new RemoveMethodCommand ( Class, Method, name, description ) );
697 }
698 catch ( oks::exception & Ex )
699 {
700 QMessageBox::warning ( 0, "Schema editor",
701 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
702 }
703}
704
706 OksAttribute * Attribute,
707 std::string NewName )
708{
709 try
710 {
711 CommandStack->push ( new SetAttributeNameCommand ( Class, Attribute, NewName ) );
712 }
713 catch ( oks::exception & Ex )
714 {
715 QMessageBox::warning ( 0, "Schema editor",
716 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
717 }
718}
719
721 OksAttribute * Attribute,
722 std::string NewDescription )
723{
724 try
725 {
726 CommandStack->push ( new SetAttributeDescriptionCommand ( Class, Attribute, NewDescription ) );
727 }
728 catch ( oks::exception & Ex )
729 {
730 QMessageBox::warning ( 0, "Schema editor",
731 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
732 }
733}
734
736 OksAttribute * Attribute,
737 std::string NewType )
738{
739 try
740 {
741 CommandStack->push ( new SetAttributeTypeCommand ( Class, Attribute, NewType ) );
742 }
743 catch ( oks::exception & Ex )
744 {
745 QMessageBox::warning ( 0, "Schema editor",
746 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
747 }
748}
749
751 OksAttribute * Attribute,
752 std::string NewRange )
753{
754 try
755 {
756 CommandStack->push ( new SetAttributeRangeCommand ( Class, Attribute, NewRange ) );
757 }
758 catch ( oks::exception & Ex )
759 {
760 QMessageBox::warning ( 0, "Schema editor",
761 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
762 }
763}
764
766 OksAttribute * Attribute,
767 OksAttribute::Format NewFormat )
768{
769 try
770 {
771 CommandStack->push ( new SetAttributeFormatCommand ( Class, Attribute, NewFormat ) );
772 }
773 catch ( oks::exception & Ex )
774 {
775 QMessageBox::warning ( 0, "Schema editor",
776 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
777 }
778}
779
781 OksAttribute * Attribute,
782 bool NewIsMulti )
783{
784 try
785 {
786 CommandStack->push ( new SetAttributeMultiCommand ( Class, Attribute, NewIsMulti ) );
787 }
788 catch ( oks::exception & Ex )
789 {
790 QMessageBox::warning ( 0, "Schema editor",
791 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
792 }
793}
794
796 OksAttribute * Attribute,
797 bool NewIsNull )
798{
799 try
800 {
801 CommandStack->push ( new SetAttributeIsNullCommand ( Class, Attribute, NewIsNull ) );
802 }
803 catch ( oks::exception & Ex )
804 {
805 QMessageBox::warning ( 0, "Schema editor",
806 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
807 }
808}
809
811 OksAttribute * Attribute,
812 std::string NewValues )
813{
814 try
815 {
816 CommandStack->push ( new SetAttributeInitialValuesCommand ( Class, Attribute, NewValues ) );
817 }
818 catch ( oks::exception & Ex )
819 {
820 QMessageBox::warning ( 0, "Schema editor",
821 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
822 }
823}
824
826 std::string type,
827 bool is_mv, std::string range,
828 std::string init_values, std::string description,
829 bool is_null, OksAttribute::Format format )
830{
831 try
832 {
833 CommandStack->push (
834 new AddAttributeCommand ( Class, name, type, is_mv, range, init_values, description,
835 is_null, format ) );
836 }
837 catch ( oks::exception & Ex )
838 {
839 QMessageBox::warning ( 0, "Schema editor",
840 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
841 }
842}
843
845 OksAttribute * Attribute,
846 std::string name, std::string type, bool is_mv,
847 std::string range, std::string init_values,
848 std::string description, bool is_null,
849 OksAttribute::Format format )
850{
851 try
852 {
853 CommandStack->push (
854 new RemoveAttributeCommand ( Class, Attribute, name, type, is_mv, range, init_values,
855 description, is_null, format ) );
856 }
857 catch ( oks::exception & Ex )
858 {
859 QMessageBox::warning ( 0, "Schema editor",
860 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
861 }
862}
863
865 : QObject ( parent ),
866 Kernel ( new OksKernel() ),
867 CommandStack ( new QUndoStack() ),
868 InheritanceMode ( false )
869{
870}
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::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)
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 LoadSchema(const std::string &SchemaName) const
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)
Methods implementation commands.
OKS attribute class.
The OKS class.
Definition class.hpp:200
const std::string & get_name() const noexcept
Definition class.hpp:363
Provides interface to the OKS XML schema and data files.
Definition file.hpp:340
bool is_read_only() const
Return read-only status of OKS file.
Definition file.hpp:632
Provides interface to the OKS kernel.
Definition kernel.hpp:577
OKS method implementation class.
Definition method.hpp:35
OKS method class.
Definition method.hpp:153
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