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