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
9using namespace dunedaq;
10using namespace dunedaq::oks;
11
13{
14 static KernelWrapper KernelManager;
15 return KernelManager;
16}
17
19{
20 return Kernel;
21}
22
23void dbse::KernelWrapper::SetActiveSchema ( const std::string & ActiveSchema )
24{
25 OksFile * File = Kernel->find_schema_file ( ActiveSchema );
26
27 if ( File && IsFileWritable( ActiveSchema ))
28 {
29 Kernel->set_active_schema ( File );
30 }
31}
32
33void dbse::KernelWrapper::GetClassList ( std::vector<OksClass *> & ClassList ) const
34{
35 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
36 i != Kernel->classes().end(); ++i )
37 {
38 ClassList.push_back ( i->second );
39 }
40}
41
42void dbse::KernelWrapper::GetClassListString ( QStringList & ClassListString ) const
43{
44 std::vector<OksClass *> ClassList;
45
46 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
47 i != Kernel->classes().end(); ++i )
48 {
49 ClassList.push_back ( i->second );
50 }
51
52 for ( OksClass * ClassInfo : ClassList )
53 {
54 ClassListString.append ( QString::fromStdString ( ClassInfo->get_name() ) );
55 }
56}
57
59{
60 auto file = Kernel->get_active_schema();
61 if ( file) {
62 return file->get_full_file_name();
63 }
64 else {
65 return "";
66 }
67}
68
69// void dbse::KernelWrapper::AddInclude( std::string IncludeFile ) const
70// {
71// auto ActiveSchema = Kernel->get_active_schema();
72// ActiveSchema->add_include_file( IncludeFile );
73// Kernel->load_schema( IncludeFile, ActiveSchema );
74// }
75void dbse::KernelWrapper::AddInclude( std::string schemaFile, std::string IncludeFile ) const
76{
77 auto ParentSchema = Kernel->find_schema_file( schemaFile );
78 if ( ParentSchema != nullptr) {
79 ParentSchema->add_include_file( IncludeFile );
80 Kernel->load_schema( IncludeFile, ParentSchema );
81 }
82}
83
84void dbse::KernelWrapper::RemoveInclude( std::string schemaFile, std::string IncludeFile ) const
85{
86 auto ParentSchema = Kernel->find_schema_file( schemaFile );
87 if (ParentSchema != nullptr) {
88 std::cout << "Calling remove_include_file()\n";
89 ParentSchema->remove_include_file( IncludeFile );
90 std::cout << "Called remove_include_file()\n";
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::GetIncludedList ( const std::string & FileName,
104 std::set<std::string> & IncludedFiles )
105{
106 Kernel->get_includes ( FileName, IncludedFiles );
107}
108
109bool dbse::KernelWrapper::IsFileWritable (const std::string & FileName ) const
110{
111 OksFile * File = Kernel->find_schema_file ( FileName );
112
113 if ( File )
114 {
115 return ( !File->is_read_only() );
116 }
117
118 return false;
119}
120
121OksClass * dbse::KernelWrapper::FindClass ( std::string ClassName ) const
122{
123 return Kernel->find_class ( ClassName );
124}
125
126void dbse::KernelWrapper::LoadSchema ( const std::string & SchemaName ) const
127{
128 Kernel->load_schema ( SchemaName );
129}
130
132{
133 Kernel->save_all_schema();
134}
135
137{
138 std::string modified{""};
139 for (auto [name, file] : Kernel->schema_files()) {
140 if (file->is_updated()) {
141 modified += file->get_full_file_name() + "\n\n";
142 }
143 }
144 return modified;
145}
146
148{
149 std::string saved{""};
150 for (auto [name, file] : Kernel->schema_files()) {
151 if (file->is_updated()) {
152 Kernel->save_schema(file);
153 saved += file->get_full_file_name() + "\n\n";
154 }
155 }
156 return saved;
157}
158
159void dbse::KernelWrapper::SaveSchema(const std::string& schema_file) const
160{
161 OksFile * file = Kernel->find_schema_file ( schema_file );
162 Kernel->save_schema(file);
163}
164
165
167{
168 Kernel->close_all_schema();
169}
170
171void dbse::KernelWrapper::CreateNewSchema ( const std::string & SchemaName ) const
172{
173 Kernel->new_schema ( SchemaName );
174}
175
177{
178 std::vector<OksClass *> ClassList;
179 GetClassList ( ClassList );
180
181 for ( OksClass * ClassInfo : ClassList )
182 {
183 const std::list<OksRelationship *> * RelationshipList = ClassInfo->direct_relationships();
184
185 if ( RelationshipList != nullptr )
186 {
187 for ( OksRelationship * RelationshipInfo : *RelationshipList )
188 {
189 if ( RelationshipInfo->get_class_type()->get_name() == SchemaClass->get_name() )
190 {
191 return true;
192 }
193 }
194 }
195 }
196
197 return false;
198}
199
201 OksRelationship * SchemaRelationship ) const
202{
203 QString RelationshipLowCc (
205 QString RelationshipHighCc (
207
208 if ( RelationshipLowCc == "zero" )
209 {
210 RelationshipLowCc = "0";
211 }
212 else if ( RelationshipLowCc == "one" )
213 {
214 RelationshipLowCc = "1";
215 }
216 else if ( RelationshipLowCc == "many" )
217 {
218 RelationshipLowCc = "n";
219 }
220
221 if ( RelationshipHighCc == "zero" )
222 {
223 RelationshipHighCc = "0";
224 }
225 else if ( RelationshipHighCc == "one" )
226 {
227 RelationshipHighCc = "1";
228 }
229 else if ( RelationshipHighCc == "many" )
230 {
231 RelationshipHighCc = "n";
232 }
233
234 return QString ( RelationshipLowCc + ':' + RelationshipHighCc );
235}
236
238{
239 OksFile * ActiveSchemaFile = Kernel->get_active_schema();
240 return ( ActiveSchemaFile != nullptr );
241}
242
244{
245 InheritanceMode = Mode;
246}
247
249{
250 return InheritanceMode;
251}
252
254{
255 return CommandStack;
256}
257
259{
260 try
261 {
262 CommandStack->push ( new SetAbstractClassCommand ( Class, Value ) );
263 }
264 catch ( oks::exception & Ex )
265 {
266 QMessageBox::warning ( 0, "Schema editor",
267 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
268 }
269}
270
272 std::string Description )
273{
274 try
275 {
276 CommandStack->push ( new SetDescriptionClassCommand ( Class, Description ) );
277 }
278 catch ( oks::exception & Ex )
279 {
280 QMessageBox::warning ( 0, "Schema editor",
281 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
282 }
283}
284
286 std::string SuperClass )
287{
288 try
289 {
290 CommandStack->push ( new AddSuperClassCommand ( Class, SuperClass ) );
291 }
292 catch ( oks::exception & Ex )
293 {
294 QMessageBox::warning ( 0, "Schema editor",
295 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
296 }
297}
298
300 std::string SuperClass )
301{
302 try
303 {
304 CommandStack->push ( new RemoveSuperClassCommand ( Class, SuperClass ) );
305 }
306 catch ( oks::exception & Ex )
307 {
308 QMessageBox::warning ( 0, "Schema editor",
309 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
310 }
311}
312
314 std::string ClassDescription,
315 bool Abstract )
316{
317 try
318 {
319 CommandStack->push ( new CreateClassCommand ( ClassName, ClassDescription, Abstract ) );
320 }
321 catch ( ... )
322 {
323 QMessageBox::warning ( 0, "Schema editor", QString ( "Error" ) );
324 }
325}
326
327void dbse::KernelWrapper::PushRemoveClassCommand ( OksClass * Class, std::string ClassName,
328 std::string ClassDescription, bool Abstract )
329{
330 try
331 {
332 CommandStack->push ( new RemoveClassCommand ( Class, ClassName, ClassDescription,
333 Abstract ) );
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 OksRelationship * Relationship,
344 std::string Name )
345{
346 try
347 {
348 CommandStack->push ( new SetNameRelationshipCommand ( Class, Relationship, Name ) );
349 }
350 catch ( oks::exception & Ex )
351 {
352 QMessageBox::warning ( 0, "Schema editor",
353 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
354 }
355}
356
358 OksRelationship * Relationship,
359 std::string ClassType )
360{
361 try
362 {
363 CommandStack->push ( new SetClassTypeRelationshipCommand ( Class, Relationship, ClassType ) );
364 }
365 catch ( oks::exception & Ex )
366 {
367 QMessageBox::warning ( 0, "Schema editor",
368 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
369 }
370}
371
373 OksClass* Class,
374 OksRelationship * Relationship,
375 std::string Description )
376{
377 try
378 {
379 CommandStack->push ( new SetDescriptionRelationshipCommand ( Class, Relationship, Description ) );
380 }
381 catch ( oks::exception & Ex )
382 {
383 QMessageBox::warning ( 0, "Schema editor",
384 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
385 }
386}
387
389 OksClass* Class, OksRelationship * Relationship, OksRelationship::CardinalityConstraint NewCardinality )
390{
391 try
392 {
393 CommandStack->push ( new SetLowCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
394 }
395 catch ( oks::exception & Ex )
396 {
397 QMessageBox::warning ( 0, "Schema editor",
398 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
399 }
400}
401
403 OksClass* Class, OksRelationship * Relationship, OksRelationship::CardinalityConstraint NewCardinality )
404{
405 try
406 {
407 CommandStack->push ( new SetHighCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
408 }
409 catch ( oks::exception & Ex )
410 {
411 QMessageBox::warning ( 0, "Schema editor",
412 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
413 }
414}
415
417 OksClass* Class, OksRelationship * Relationship,
418 bool Value )
419{
420 try
421 {
422 CommandStack->push ( new SetIsCompositeRelationshipCommand ( Class, Relationship, Value ) );
423 }
424 catch ( oks::exception & Ex )
425 {
426 QMessageBox::warning ( 0, "Schema editor",
427 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
428 }
429}
430
432 OksClass* Class,
433 OksRelationship * Relationship,
434 bool Value )
435{
436 try
437 {
438 CommandStack->push ( new SetIsDependentRelationshipCommand ( Class, Relationship, Value ) );
439 }
440 catch ( oks::exception & Ex )
441 {
442 QMessageBox::warning ( 0, "Schema editor",
443 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
444 }
445}
446
448 OksClass* Class,
449 OksRelationship * Relationship,
450 bool Value )
451{
452 try
453 {
454 CommandStack->push ( new SetIsExclusiveRelationshipCommand ( Class, Relationship, Value ) );
455 }
456 catch ( oks::exception & Ex )
457 {
458 QMessageBox::warning ( 0, "Schema editor",
459 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
460 }
461}
462
463void dbse::KernelWrapper::PushAddRelationship ( OksClass * Class, std::string Name,
464 std::string Description, std::string Type,
465 bool Composite, bool Exclusive, bool Dependent,
468{
469 try
470 {
471 CommandStack->push (
472 new AddRelationship ( Class, Name, Description, Type, Composite, Exclusive, Dependent,
473 LowCc, HighCc ) );
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 OksRelationship * Relationship,
484 std::string Name, std::string Description,
485 std::string Type, bool Composite, bool Exclusive,
486 bool Dependent,
489{
490 try
491 {
492 CommandStack->push (
493 new RemoveRelationship ( Class, Relationship, Name, Description, Type, Composite,
494 Exclusive, Dependent, LowCc, HighCc ) );
495 }
496 catch ( oks::exception & Ex )
497 {
498 QMessageBox::warning ( 0, "Schema editor",
499 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
500 }
501}
502
504 OksMethod * Method,
505 OksMethodImplementation * Implementation,
506 std::string Language )
507{
508 try
509 {
510 CommandStack->push ( new SetMethodImplementationLanguage ( Class, Method, Implementation, Language ) );
511 }
512 catch ( oks::exception & Ex )
513 {
514 QMessageBox::warning ( 0, "Schema editor",
515 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
516 }
517}
518
520 OksClass * Class, OksMethod * Method, OksMethodImplementation * Implementation, std::string Prototype )
521{
522 try
523 {
524 CommandStack->push ( new SetMethodImplementationPrototype ( Class, Method, Implementation, Prototype ) );
525 }
526 catch ( oks::exception & Ex )
527 {
528 QMessageBox::warning ( 0, "Schema editor",
529 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
530 }
531}
532
534 OksMethod * Method,
535 OksMethodImplementation * Implementation,
536 std::string Body )
537{
538 try
539 {
540 CommandStack->push ( new SetMethodImplementationBody ( Class, Method, Implementation, Body ) );
541 }
542 catch ( oks::exception & Ex )
543 {
544 QMessageBox::warning ( 0, "Schema editor",
545 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
546 }
547}
548
550 OksMethod * Method,
551 std::string Language,
552 std::string Prototype, std::string Body )
553{
554 try
555 {
556 CommandStack->push ( new AddMethodImplementationComand ( Class, Method, Language, Prototype,
557 Body ) );
558 }
559 catch ( oks::exception & Ex )
560 {
561 QMessageBox::warning ( 0, "Schema editor",
562 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
563 }
564}
565
567 OksMethod * Method,
568 std::string Language,
569 std::string Prototype,
570 std::string Body )
571{
572 try
573 {
574 CommandStack->push ( new RemoveMethodImplementationComand ( Class, Method, Language, Prototype,
575 Body ) );
576 }
577 catch ( oks::exception & Ex )
578 {
579 QMessageBox::warning ( 0, "Schema editor",
580 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
581 }
582}
583
584void dbse::KernelWrapper::PushSetNameMethodCommand ( OksClass * Class, OksMethod * Method, std::string name )
585{
586 try
587 {
588 CommandStack->push ( new SetNameMethodCommand ( Class, Method, name ) );
589 }
590 catch ( oks::exception & Ex )
591 {
592 QMessageBox::warning ( 0, "Schema editor",
593 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
594 }
595}
596
598 std::string description )
599{
600 try
601 {
602 CommandStack->push ( new SetDescriptionMethodCommand ( Class, Method, description ) );
603 }
604 catch ( oks::exception & Ex )
605 {
606 QMessageBox::warning ( 0, "Schema editor",
607 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
608 }
609}
610
612 std::string description )
613{
614 try
615 {
616 CommandStack->push ( new AddMethodCommand ( Class, name, description ) );
617 }
618 catch ( oks::exception & Ex )
619 {
620 QMessageBox::warning ( 0, "Schema editor",
621 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
622 }
623}
624
626 std::string name, std::string description )
627{
628 try
629 {
630 CommandStack->push ( new RemoveMethodCommand ( Class, Method, name, description ) );
631 }
632 catch ( oks::exception & Ex )
633 {
634 QMessageBox::warning ( 0, "Schema editor",
635 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
636 }
637}
638
640 OksAttribute * Attribute,
641 std::string NewName )
642{
643 try
644 {
645 CommandStack->push ( new SetAttributeNameCommand ( Class, Attribute, NewName ) );
646 }
647 catch ( oks::exception & Ex )
648 {
649 QMessageBox::warning ( 0, "Schema editor",
650 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
651 }
652}
653
655 OksAttribute * Attribute,
656 std::string NewDescription )
657{
658 try
659 {
660 CommandStack->push ( new SetAttributeDescriptionCommand ( Class, Attribute, NewDescription ) );
661 }
662 catch ( oks::exception & Ex )
663 {
664 QMessageBox::warning ( 0, "Schema editor",
665 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
666 }
667}
668
670 OksAttribute * Attribute,
671 std::string NewType )
672{
673 try
674 {
675 CommandStack->push ( new SetAttributeTypeCommand ( Class, Attribute, NewType ) );
676 }
677 catch ( oks::exception & Ex )
678 {
679 QMessageBox::warning ( 0, "Schema editor",
680 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
681 }
682}
683
685 OksAttribute * Attribute,
686 std::string NewRange )
687{
688 try
689 {
690 CommandStack->push ( new SetAttributeRangeCommand ( Class, Attribute, NewRange ) );
691 }
692 catch ( oks::exception & Ex )
693 {
694 QMessageBox::warning ( 0, "Schema editor",
695 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
696 }
697}
698
700 OksAttribute * Attribute,
701 OksAttribute::Format NewFormat )
702{
703 try
704 {
705 CommandStack->push ( new SetAttributeFormatCommand ( Class, Attribute, NewFormat ) );
706 }
707 catch ( oks::exception & Ex )
708 {
709 QMessageBox::warning ( 0, "Schema editor",
710 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
711 }
712}
713
715 OksAttribute * Attribute,
716 bool NewIsMulti )
717{
718 try
719 {
720 CommandStack->push ( new SetAttributeMultiCommand ( Class, Attribute, NewIsMulti ) );
721 }
722 catch ( oks::exception & Ex )
723 {
724 QMessageBox::warning ( 0, "Schema editor",
725 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
726 }
727}
728
730 OksAttribute * Attribute,
731 bool NewIsNull )
732{
733 try
734 {
735 CommandStack->push ( new SetAttributeIsNullCommand ( Class, Attribute, NewIsNull ) );
736 }
737 catch ( oks::exception & Ex )
738 {
739 QMessageBox::warning ( 0, "Schema editor",
740 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
741 }
742}
743
745 OksAttribute * Attribute,
746 std::string NewValues )
747{
748 try
749 {
750 CommandStack->push ( new SetAttributeInitialValuesCommand ( Class, Attribute, NewValues ) );
751 }
752 catch ( oks::exception & Ex )
753 {
754 QMessageBox::warning ( 0, "Schema editor",
755 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
756 }
757}
758
760 std::string type,
761 bool is_mv, std::string range,
762 std::string init_values, std::string description,
763 bool is_null, OksAttribute::Format format )
764{
765 try
766 {
767 CommandStack->push (
768 new AddAttributeCommand ( Class, name, type, is_mv, range, init_values, description,
769 is_null, format ) );
770 }
771 catch ( oks::exception & Ex )
772 {
773 QMessageBox::warning ( 0, "Schema editor",
774 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
775 }
776}
777
779 OksAttribute * Attribute,
780 std::string name, std::string type, bool is_mv,
781 std::string range, std::string init_values,
782 std::string description, bool is_null,
783 OksAttribute::Format format )
784{
785 try
786 {
787 CommandStack->push (
788 new RemoveAttributeCommand ( Class, Attribute, name, type, is_mv, range, init_values,
789 description, is_null, format ) );
790 }
791 catch ( oks::exception & Ex )
792 {
793 QMessageBox::warning ( 0, "Schema editor",
794 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
795 }
796}
797
799 : QObject ( parent ),
800 Kernel ( new OksKernel() ),
801 CommandStack ( new QUndoStack() ),
802 InheritanceMode ( false )
803{
804}
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)
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 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.
void PushSetMethodImplementationBody(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
void GetSchemaFiles(std::vector< std::string > &SchemaFiles)
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
Including Qt Headers.
DAC value out of range
Message.
Definition DACNode.hpp:32