DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbse::KernelWrapper Class Reference

#include <SchemaKernelWrapper.hpp>

Inheritance diagram for dbse::KernelWrapper:
[legend]
Collaboration diagram for dbse::KernelWrapper:
[legend]

Signals

void ClassCreated (QString ClassName)
 
void ClassRemoved (QString ClassName)
 
void ClassUpdated (QString ClassName)
 
void RebuildAttributeModel ()
 

Public Member Functions

dunedaq::oks::OksKernelGetKernel ()
 
void SetActiveSchema (const std::string &ActiveSchema)
 
void GetClassList (std::vector< dunedaq::oks::OksClass * > &ClassList) const
 
void GetClassListString (QStringList &ClassListString) const
 
void GetSchemaFiles (std::vector< std::string > &SchemaFiles)
 
void GetIncludedList (const std::string &FileName, std::set< std::string > &IncludedFiles)
 
bool IsFileWritable (const std::string &FileName) const
 
bool IsActive () const
 
dunedaq::oks::OksClassFindClass (std::string ClassName) const
 
void LoadSchema (const std::string &SchemaName) const
 
void SaveAllSchema () const
 
void SaveSchema (const std::string &file) const
 
std::string ModifiedSchemaFiles () const
 
std::string SaveModifiedSchema () const
 
std::string GetActiveSchema () const
 
void AddInclude (std::string schemaFile, std::string IncludeFile) const
 
void RemoveInclude (std::string schemaFile, std::string IncludeFile) const
 
void CloseAllSchema () const
 
void CreateNewSchema (const std::string &SchemaName) const
 
bool AnyClassReferenceThis (dunedaq::oks::OksClass *SchemaClass)
 
QString GetCardinalityStringRelationship (dunedaq::oks::OksRelationship *SchemaRelationship) const
 
void SetInheritanceMode (bool Mode)
 Editor Functions.
 
bool GetInheritanceMode () const
 
QUndoStack * GetUndoStack ()
 Stack Functions.
 
void PushSetAbstractClassCommand (dunedaq::oks::OksClass *Class, bool Value)
 
void PushSetDescriptionClassCommand (dunedaq::oks::OksClass *Class, std::string Description)
 
void PushAddSuperClassCommand (dunedaq::oks::OksClass *Class, std::string SuperClass)
 
void PushRemoveSuperClassCommand (dunedaq::oks::OksClass *Class, std::string SuperClass)
 
void PushCreateClassCommand (std::string ClassName, std::string ClassDescription, bool Abstract)
 
void PushRemoveClassCommand (dunedaq::oks::OksClass *Class, std::string ClassName, std::string ClassDescription, bool Abstract)
 
void PushSetNameRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Name)
 Relationship commands.
 
void PushSetClassTypeRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string ClassType)
 
void PushSetDescriptionRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Description)
 
void PushSetLowCcRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
 
void PushSetHighCcRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality)
 
void PushSetIsCompositeRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
 
void PushSetIsDependentRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
 
void PushSetIsExclusiveRelationshipCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, bool Value)
 
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 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 PushSetMethodImplementationLanguage (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Language)
 Method implementation commands.
 
void PushSetMethodImplementationPrototype (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Prototype)
 
void PushSetMethodImplementationBody (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, dunedaq::oks::OksMethodImplementation *Implementation, std::string Body)
 
void PushAddMethodImplementationComand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
 
void PushRemoveMethodImplementationComand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string Language, std::string Prototype, std::string Body)
 
void PushSetNameMethodCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name)
 Method commands.
 
void PushSetDescriptionMethodCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, 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 PushSetAttributeNameCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewName)
 Attribute commands.
 
void PushSetAttributeDescriptionCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewDescription)
 
void PushSetAttributeTypeCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewType)
 
void PushSetAttributeRangeCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewRange)
 
void PushSetAttributeFormatCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, dunedaq::oks::OksAttribute::Format NewFormat)
 
void PushSetAttributeMultiCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsMulti)
 
void PushSetAttributeIsNullCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, bool NewIsNull)
 
void PushSetAttributeInitialValuesCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewValues)
 
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 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)
 

Static Public Member Functions

static KernelWrapperGetInstance ()
 

Private Member Functions

 KernelWrapper (QObject *parent=nullptr)
 

Private Attributes

dunedaq::oks::OksKernelKernel
 
QUndoStack * CommandStack
 
bool InheritanceMode
 

Friends

class SchemaMainWindow
 
class SchemaClassEditor
 
class SchemaAttributeEditor
 
class SchemaMethodEditor
 
class SchemaRelationshipEditor
 

Detailed Description

Definition at line 23 of file SchemaKernelWrapper.hpp.

Constructor & Destructor Documentation

◆ KernelWrapper()

dbse::KernelWrapper::KernelWrapper ( QObject * parent = nullptr)
private

Definition at line 798 of file SchemaKernelWrapper.cpp.

799 : QObject ( parent ),
800 Kernel ( new OksKernel() ),
801 CommandStack ( new QUndoStack() ),
802 InheritanceMode ( false )
803{
804}
dunedaq::oks::OksKernel * Kernel
Provides interface to the OKS kernel.
Definition kernel.hpp:577

Member Function Documentation

◆ AddInclude()

void dbse::KernelWrapper::AddInclude ( std::string schemaFile,
std::string IncludeFile ) const

Definition at line 75 of file SchemaKernelWrapper.cpp.

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}
OksFile * find_schema_file(const std::string &s) const
Finds OKS schema file.
Definition kernel.cpp:2281
OksFile * load_schema(const std::string &name, const OksFile *parent=0)
Load OKS schema file.
Definition kernel.cpp:2297

◆ AnyClassReferenceThis()

bool dbse::KernelWrapper::AnyClassReferenceThis ( dunedaq::oks::OksClass * SchemaClass)

Definition at line 176 of file SchemaKernelWrapper.cpp.

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}
void GetClassList(std::vector< dunedaq::oks::OksClass * > &ClassList) const
The OKS class.
Definition class.hpp:200
const std::string & get_name() const noexcept
Definition class.hpp:363

◆ ClassCreated

void dbse::KernelWrapper::ClassCreated ( QString ClassName)
signal

◆ ClassRemoved

void dbse::KernelWrapper::ClassRemoved ( QString ClassName)
signal

◆ ClassUpdated

void dbse::KernelWrapper::ClassUpdated ( QString ClassName)
signal

◆ CloseAllSchema()

void dbse::KernelWrapper::CloseAllSchema ( ) const

Definition at line 166 of file SchemaKernelWrapper.cpp.

167{
169}
void close_all_schema()
Close all OKS schema files.
Definition kernel.cpp:2883

◆ CreateNewSchema()

void dbse::KernelWrapper::CreateNewSchema ( const std::string & SchemaName) const

Definition at line 171 of file SchemaKernelWrapper.cpp.

172{
173 Kernel->new_schema ( SchemaName );
174}
OksFile * new_schema(const std::string &name)
Create OKS schema file.
Definition kernel.cpp:2485

◆ FindClass()

OksClass * dbse::KernelWrapper::FindClass ( std::string ClassName) const

Definition at line 121 of file SchemaKernelWrapper.cpp.

122{
123 return Kernel->find_class ( ClassName );
124}
OksClass * find_class(const std::string &class_name) const
Find class by name (C++ string).
Definition kernel.hpp:1814

◆ GetActiveSchema()

std::string dbse::KernelWrapper::GetActiveSchema ( ) const

Definition at line 58 of file SchemaKernelWrapper.cpp.

59{
61 if ( file) {
62 return file->get_full_file_name();
63 }
64 else {
65 return "";
66 }
67}
OksFile * get_active_schema() const
Get active OKS schema file.
Definition kernel.hpp:1210

◆ GetCardinalityStringRelationship()

QString dbse::KernelWrapper::GetCardinalityStringRelationship ( dunedaq::oks::OksRelationship * SchemaRelationship) const

Definition at line 200 of file SchemaKernelWrapper.cpp.

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}
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.

◆ GetClassList()

void dbse::KernelWrapper::GetClassList ( std::vector< dunedaq::oks::OksClass * > & ClassList) const

Definition at line 33 of file SchemaKernelWrapper.cpp.

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}
const OksClass::Map & classes() const
Get classes.
Definition kernel.hpp:1767

◆ GetClassListString()

void dbse::KernelWrapper::GetClassListString ( QStringList & ClassListString) const

Definition at line 42 of file SchemaKernelWrapper.cpp.

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}

◆ GetIncludedList()

void dbse::KernelWrapper::GetIncludedList ( const std::string & FileName,
std::set< std::string > & IncludedFiles )

Definition at line 103 of file SchemaKernelWrapper.cpp.

105{
106 Kernel->get_includes ( FileName, IncludedFiles );
107}
void get_includes(const std::string &file_name, std::set< std::string > &includes, bool use_repository_name=false)
Opens file and reads its shallow includes.
Definition kernel.cpp:1914

◆ GetInheritanceMode()

bool dbse::KernelWrapper::GetInheritanceMode ( ) const

Definition at line 248 of file SchemaKernelWrapper.cpp.

249{
250 return InheritanceMode;
251}

◆ GetInstance()

dbse::KernelWrapper & dbse::KernelWrapper::GetInstance ( )
static

Definition at line 12 of file SchemaKernelWrapper.cpp.

13{
14 static KernelWrapper KernelManager;
15 return KernelManager;
16}
KernelWrapper(QObject *parent=nullptr)

◆ GetKernel()

OksKernel * dbse::KernelWrapper::GetKernel ( )

Definition at line 18 of file SchemaKernelWrapper.cpp.

19{
20 return Kernel;
21}

◆ GetSchemaFiles()

void dbse::KernelWrapper::GetSchemaFiles ( std::vector< std::string > & SchemaFiles)

Definition at line 94 of file SchemaKernelWrapper.cpp.

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}
const OksFile::Map & schema_files() const
Get all schema files.
Definition kernel.hpp:1223

◆ GetUndoStack()

QUndoStack * dbse::KernelWrapper::GetUndoStack ( )

Stack Functions.

Definition at line 253 of file SchemaKernelWrapper.cpp.

254{
255 return CommandStack;
256}

◆ IsActive()

bool dbse::KernelWrapper::IsActive ( ) const

Definition at line 237 of file SchemaKernelWrapper.cpp.

238{
239 OksFile * ActiveSchemaFile = Kernel->get_active_schema();
240 return ( ActiveSchemaFile != nullptr );
241}
Provides interface to the OKS XML schema and data files.
Definition file.hpp:340

◆ IsFileWritable()

bool dbse::KernelWrapper::IsFileWritable ( const std::string & FileName) const

Definition at line 109 of file SchemaKernelWrapper.cpp.

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}
bool is_read_only() const
Return read-only status of OKS file.
Definition file.hpp:632

◆ LoadSchema()

void dbse::KernelWrapper::LoadSchema ( const std::string & SchemaName) const

Definition at line 126 of file SchemaKernelWrapper.cpp.

127{
128 Kernel->load_schema ( SchemaName );
129}

◆ ModifiedSchemaFiles()

std::string dbse::KernelWrapper::ModifiedSchemaFiles ( ) const

Definition at line 136 of file SchemaKernelWrapper.cpp.

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}

◆ PushAddAttributeCommand()

void dbse::KernelWrapper::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 )

Definition at line 759 of file SchemaKernelWrapper.cpp.

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}
DAC value out of range
Message.
Definition DACNode.hpp:32

◆ PushAddMethodCommand()

void dbse::KernelWrapper::PushAddMethodCommand ( dunedaq::oks::OksClass * Class,
std::string name,
std::string description )

Definition at line 611 of file SchemaKernelWrapper.cpp.

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}

◆ PushAddMethodImplementationComand()

void dbse::KernelWrapper::PushAddMethodImplementationComand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
std::string Language,
std::string Prototype,
std::string Body )

Definition at line 549 of file SchemaKernelWrapper.cpp.

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}

◆ PushAddRelationship()

void dbse::KernelWrapper::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 )

Definition at line 463 of file SchemaKernelWrapper.cpp.

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}

◆ PushAddSuperClassCommand()

void dbse::KernelWrapper::PushAddSuperClassCommand ( dunedaq::oks::OksClass * Class,
std::string SuperClass )

Definition at line 285 of file SchemaKernelWrapper.cpp.

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}

◆ PushCreateClassCommand()

void dbse::KernelWrapper::PushCreateClassCommand ( std::string ClassName,
std::string ClassDescription,
bool Abstract )

Definition at line 313 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveAttributeCommand()

void dbse::KernelWrapper::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 )

Definition at line 778 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveClassCommand()

void dbse::KernelWrapper::PushRemoveClassCommand ( dunedaq::oks::OksClass * Class,
std::string ClassName,
std::string ClassDescription,
bool Abstract )

Definition at line 327 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveMethodCommand()

void dbse::KernelWrapper::PushRemoveMethodCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
std::string name,
std::string description )

Definition at line 625 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveMethodImplementationComand()

void dbse::KernelWrapper::PushRemoveMethodImplementationComand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
std::string Language,
std::string Prototype,
std::string Body )

Definition at line 566 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveRelationship()

void dbse::KernelWrapper::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 )

Definition at line 482 of file SchemaKernelWrapper.cpp.

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}

◆ PushRemoveSuperClassCommand()

void dbse::KernelWrapper::PushRemoveSuperClassCommand ( dunedaq::oks::OksClass * Class,
std::string SuperClass )

Definition at line 299 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAbstractClassCommand()

void dbse::KernelWrapper::PushSetAbstractClassCommand ( dunedaq::oks::OksClass * Class,
bool Value )

Commands Functions Class commands

Definition at line 258 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeDescriptionCommand()

void dbse::KernelWrapper::PushSetAttributeDescriptionCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewDescription )

Definition at line 654 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeFormatCommand()

void dbse::KernelWrapper::PushSetAttributeFormatCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
dunedaq::oks::OksAttribute::Format NewFormat )

Definition at line 699 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeInitialValuesCommand()

void dbse::KernelWrapper::PushSetAttributeInitialValuesCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewValues )

Definition at line 744 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeIsNullCommand()

void dbse::KernelWrapper::PushSetAttributeIsNullCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
bool NewIsNull )

Definition at line 729 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeMultiCommand()

void dbse::KernelWrapper::PushSetAttributeMultiCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
bool NewIsMulti )

Definition at line 714 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeNameCommand()

void dbse::KernelWrapper::PushSetAttributeNameCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewName )

Attribute commands.

Definition at line 639 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeRangeCommand()

void dbse::KernelWrapper::PushSetAttributeRangeCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewRange )

Definition at line 684 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetAttributeTypeCommand()

void dbse::KernelWrapper::PushSetAttributeTypeCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewType )

Definition at line 669 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetClassTypeRelationshipCommand()

void dbse::KernelWrapper::PushSetClassTypeRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
std::string ClassType )

Definition at line 357 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetDescriptionClassCommand()

void dbse::KernelWrapper::PushSetDescriptionClassCommand ( dunedaq::oks::OksClass * Class,
std::string Description )

Definition at line 271 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetDescriptionMethodCommand()

void dbse::KernelWrapper::PushSetDescriptionMethodCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
std::string description )

Definition at line 597 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetDescriptionRelationshipCommand()

void dbse::KernelWrapper::PushSetDescriptionRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
std::string Description )

Definition at line 372 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetHighCcRelationshipCommand()

void dbse::KernelWrapper::PushSetHighCcRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality )

Definition at line 402 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetIsCompositeRelationshipCommand()

void dbse::KernelWrapper::PushSetIsCompositeRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
bool Value )

Definition at line 416 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetIsDependentRelationshipCommand()

void dbse::KernelWrapper::PushSetIsDependentRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
bool Value )

Definition at line 431 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetIsExclusiveRelationshipCommand()

void dbse::KernelWrapper::PushSetIsExclusiveRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
bool Value )

Definition at line 447 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetLowCcRelationshipCommand()

void dbse::KernelWrapper::PushSetLowCcRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
dunedaq::oks::OksRelationship::CardinalityConstraint NewCardinality )

Definition at line 388 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetMethodImplementationBody()

void dbse::KernelWrapper::PushSetMethodImplementationBody ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
dunedaq::oks::OksMethodImplementation * Implementation,
std::string Body )

Definition at line 533 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetMethodImplementationLanguage()

void dbse::KernelWrapper::PushSetMethodImplementationLanguage ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
dunedaq::oks::OksMethodImplementation * Implementation,
std::string Language )

Method implementation commands.

Definition at line 503 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetMethodImplementationPrototype()

void dbse::KernelWrapper::PushSetMethodImplementationPrototype ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
dunedaq::oks::OksMethodImplementation * Implementation,
std::string Prototype )

Definition at line 519 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetNameMethodCommand()

void dbse::KernelWrapper::PushSetNameMethodCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksMethod * Method,
std::string name )

Method commands.

Definition at line 584 of file SchemaKernelWrapper.cpp.

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}

◆ PushSetNameRelationshipCommand()

void dbse::KernelWrapper::PushSetNameRelationshipCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksRelationship * Relationship,
std::string Name )

Relationship commands.

Definition at line 342 of file SchemaKernelWrapper.cpp.

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}

◆ RebuildAttributeModel

void dbse::KernelWrapper::RebuildAttributeModel ( )
signal

◆ RemoveInclude()

void dbse::KernelWrapper::RemoveInclude ( std::string schemaFile,
std::string IncludeFile ) const

Definition at line 84 of file SchemaKernelWrapper.cpp.

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}

◆ SaveAllSchema()

void dbse::KernelWrapper::SaveAllSchema ( ) const

Definition at line 131 of file SchemaKernelWrapper.cpp.

132{
134}
void save_all_schema()
Save all OKS schema files.
Definition kernel.cpp:2794

◆ SaveModifiedSchema()

std::string dbse::KernelWrapper::SaveModifiedSchema ( ) const

Definition at line 147 of file SchemaKernelWrapper.cpp.

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}
void save_schema(OksFile *file_h, bool force=false, OksFile *true_file_h=0)
Save OKS schema file.
Definition kernel.cpp:2538

◆ SaveSchema()

void dbse::KernelWrapper::SaveSchema ( const std::string & file) const

Definition at line 159 of file SchemaKernelWrapper.cpp.

160{
161 OksFile * file = Kernel->find_schema_file ( schema_file );
162 Kernel->save_schema(file);
163}

◆ SetActiveSchema()

void dbse::KernelWrapper::SetActiveSchema ( const std::string & ActiveSchema)

Definition at line 23 of file SchemaKernelWrapper.cpp.

24{
25 OksFile * File = Kernel->find_schema_file ( ActiveSchema );
26
27 if ( File && IsFileWritable( ActiveSchema ))
28 {
29 Kernel->set_active_schema ( File );
30 }
31}
bool IsFileWritable(const std::string &FileName) const
void set_active_schema(OksFile *file_h)
Set active OKS schema file.
Definition kernel.cpp:2903

◆ SetInheritanceMode()

void dbse::KernelWrapper::SetInheritanceMode ( bool Mode)

Editor Functions.

Definition at line 243 of file SchemaKernelWrapper.cpp.

244{
245 InheritanceMode = Mode;
246}

Friends And Related Symbol Documentation

◆ SchemaAttributeEditor

friend class SchemaAttributeEditor
friend

Definition at line 27 of file SchemaKernelWrapper.hpp.

◆ SchemaClassEditor

friend class SchemaClassEditor
friend

Definition at line 26 of file SchemaKernelWrapper.hpp.

◆ SchemaMainWindow

friend class SchemaMainWindow
friend

Definition at line 25 of file SchemaKernelWrapper.hpp.

◆ SchemaMethodEditor

friend class SchemaMethodEditor
friend

Definition at line 28 of file SchemaKernelWrapper.hpp.

◆ SchemaRelationshipEditor

friend class SchemaRelationshipEditor
friend

Definition at line 29 of file SchemaKernelWrapper.hpp.

Member Data Documentation

◆ CommandStack

QUndoStack* dbse::KernelWrapper::CommandStack
private

Definition at line 136 of file SchemaKernelWrapper.hpp.

◆ InheritanceMode

bool dbse::KernelWrapper::InheritanceMode
private

Definition at line 137 of file SchemaKernelWrapper.hpp.

◆ Kernel

dunedaq::oks::OksKernel* dbse::KernelWrapper::Kernel
private

Definition at line 135 of file SchemaKernelWrapper.hpp.


The documentation for this class was generated from the following files: