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 ()
 
void active_updated ()
 

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 GetSchemaFiles (std::vector< dunedaq::oks::OksFile * > &SchemaFiles)
 
std::vector< dunedaq::oks::OksClass * > get_schema_classes (std::string &filename)
 
void GetIncludedList (const std::string &FileName, std::set< std::string > &IncludedFiles)
 
void get_direct_includes (const std::string &FileName, std::set< std::string > &IncludedFiles)
 
void get_all_includes (const std::string &FileName, std::set< std::string > &IncludedFiles)
 
bool IsFileWritable (const std::string &FileName) const
 
bool is_file_modified (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::vector< std::string > get_modified_schema_files () 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 25 of file SchemaKernelWrapper.hpp.

Constructor & Destructor Documentation

◆ KernelWrapper()

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

Definition at line 864 of file SchemaKernelWrapper.cpp.

865 : QObject ( parent ),
866 Kernel ( new OksKernel() ),
867 CommandStack ( new QUndoStack() ),
868 InheritanceMode ( false )
869{
870}
dunedaq::oks::OksKernel * Kernel
Provides interface to the OKS kernel.
Definition kernel.hpp:577

Member Function Documentation

◆ active_updated

void dbse::KernelWrapper::active_updated ( )
signal

◆ AddInclude()

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

Definition at line 77 of file SchemaKernelWrapper.cpp.

78{
79 auto ParentSchema = Kernel->find_schema_file( schemaFile );
80 if ( ParentSchema != nullptr) {
81 ParentSchema->add_include_file( IncludeFile );
82 Kernel->load_schema( IncludeFile, ParentSchema );
83 }
84}
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 242 of file SchemaKernelWrapper.cpp.

243{
244 std::vector<OksClass *> ClassList;
245 GetClassList ( ClassList );
246
247 for ( OksClass * ClassInfo : ClassList )
248 {
249 const std::list<OksRelationship *> * RelationshipList = ClassInfo->direct_relationships();
250
251 if ( RelationshipList != nullptr )
252 {
253 for ( OksRelationship * RelationshipInfo : *RelationshipList )
254 {
255 if ( RelationshipInfo->get_class_type()->get_name() == SchemaClass->get_name() )
256 {
257 return true;
258 }
259 }
260 }
261 }
262
263 return false;
264}
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 232 of file SchemaKernelWrapper.cpp.

233{
235}
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 237 of file SchemaKernelWrapper.cpp.

238{
239 Kernel->new_schema ( SchemaName );
240}
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 176 of file SchemaKernelWrapper.cpp.

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

◆ get_all_includes()

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

Definition at line 131 of file SchemaKernelWrapper.cpp.

133{
134 auto parentschema = Kernel->find_schema_file( filename );
135 if ( parentschema != nullptr) {
136 std::set<OksFile*> includes;
137 parentschema->get_all_include_files(Kernel, includes);
138 for (auto file : includes) {
139 included_files.insert(file->get_full_file_name());
140 }
141 }
142}

◆ get_direct_includes()

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

Definition at line 144 of file SchemaKernelWrapper.cpp.

146{
147 auto parentschema = Kernel->find_schema_file( filename );
148 if ( parentschema != nullptr) {
149 for (auto file : parentschema->get_include_files()) {
150 included_files.insert(file);
151 }
152 }
153}

◆ get_modified_schema_files()

std::vector< std::string > dbse::KernelWrapper::get_modified_schema_files ( ) const

Definition at line 202 of file SchemaKernelWrapper.cpp.

203{
204 std::vector<std::string> modified;
205 for (auto [name, file] : Kernel->schema_files()) {
206 if (file->is_updated()) {
207 modified.push_back(file->get_full_file_name());
208 }
209 }
210 return modified;
211}
const OksFile::Map & schema_files() const
Get all schema files.
Definition kernel.hpp:1223

◆ get_schema_classes()

std::vector< OksClass * > dbse::KernelWrapper::get_schema_classes ( std::string & filename)

Definition at line 112 of file SchemaKernelWrapper.cpp.

113{
115 std::vector<OksClass*> list;
116 auto klist = Kernel->create_list_of_schema_classes(file);
117 if (klist != nullptr) {
118 for (auto cls: *klist) {
119 list.push_back(cls/*->get_name()*/);
120 }
121 delete klist;
122 }
123 return list;
124}
std::list< OksClass * > * create_list_of_schema_classes(OksFile *) const
Creates list of classes which belong to given file.
Definition kernel.cpp:2950

◆ GetActiveSchema()

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

Definition at line 60 of file SchemaKernelWrapper.cpp.

61{
63 if ( file) {
64 return file->get_full_file_name();
65 }
66 else {
67 return "";
68 }
69}
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 266 of file SchemaKernelWrapper.cpp.

268{
269 QString RelationshipLowCc (
271 QString RelationshipHighCc (
273
274 if ( RelationshipLowCc == "zero" )
275 {
276 RelationshipLowCc = "0";
277 }
278 else if ( RelationshipLowCc == "one" )
279 {
280 RelationshipLowCc = "1";
281 }
282 else if ( RelationshipLowCc == "many" )
283 {
284 RelationshipLowCc = "n";
285 }
286
287 if ( RelationshipHighCc == "zero" )
288 {
289 RelationshipHighCc = "0";
290 }
291 else if ( RelationshipHighCc == "one" )
292 {
293 RelationshipHighCc = "1";
294 }
295 else if ( RelationshipHighCc == "many" )
296 {
297 RelationshipHighCc = "n";
298 }
299
300 return QString ( RelationshipLowCc + ':' + RelationshipHighCc );
301}
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 35 of file SchemaKernelWrapper.cpp.

36{
37 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
38 i != Kernel->classes().end(); ++i )
39 {
40 ClassList.push_back ( i->second );
41 }
42}
const OksClass::Map & classes() const
Get classes.
Definition kernel.hpp:1767

◆ GetClassListString()

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

Definition at line 44 of file SchemaKernelWrapper.cpp.

45{
46 std::vector<OksClass *> ClassList;
47
48 for ( OksClass::Map::const_iterator i = Kernel->classes().begin();
49 i != Kernel->classes().end(); ++i )
50 {
51 ClassList.push_back ( i->second );
52 }
53
54 for ( OksClass * ClassInfo : ClassList )
55 {
56 ClassListString.append ( QString::fromStdString ( ClassInfo->get_name() ) );
57 }
58}

◆ GetIncludedList()

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

Definition at line 126 of file SchemaKernelWrapper.cpp.

128{
129 Kernel->get_includes ( filename, included_files );
130}
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 314 of file SchemaKernelWrapper.cpp.

315{
316 return InheritanceMode;
317}

◆ GetInstance()

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

Definition at line 13 of file SchemaKernelWrapper.cpp.

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

◆ GetKernel()

OksKernel * dbse::KernelWrapper::GetKernel ( )

Definition at line 19 of file SchemaKernelWrapper.cpp.

20{
21 return Kernel;
22}

◆ GetSchemaFiles() [1/2]

void dbse::KernelWrapper::GetSchemaFiles ( std::vector< dunedaq::oks::OksFile * > & SchemaFiles)

Definition at line 103 of file SchemaKernelWrapper.cpp.

104{
105 for (auto [name, file]: Kernel->schema_files())
106 {
107 SchemaFiles.push_back ( file );
108 }
109}

◆ GetSchemaFiles() [2/2]

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}

◆ GetUndoStack()

QUndoStack * dbse::KernelWrapper::GetUndoStack ( )

Stack Functions.

Definition at line 319 of file SchemaKernelWrapper.cpp.

320{
321 return CommandStack;
322}

◆ is_file_modified()

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

Definition at line 167 of file SchemaKernelWrapper.cpp.

168{
169 OksFile* file = Kernel->find_schema_file ( FileName );
170 if (file != nullptr) {
171 return file->is_updated();
172 }
173 return false;
174}
Provides interface to the OKS XML schema and data files.
Definition file.hpp:340

◆ IsActive()

bool dbse::KernelWrapper::IsActive ( ) const

Definition at line 303 of file SchemaKernelWrapper.cpp.

304{
305 OksFile * ActiveSchemaFile = Kernel->get_active_schema();
306 return ( ActiveSchemaFile != nullptr );
307}

◆ IsFileWritable()

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

Definition at line 155 of file SchemaKernelWrapper.cpp.

156{
157 OksFile * File = Kernel->find_schema_file ( FileName );
158
159 if ( File )
160 {
161 return ( !File->is_read_only() );
162 }
163
164 return false;
165}
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 181 of file SchemaKernelWrapper.cpp.

182{
183 Kernel->load_schema ( SchemaName );
184}

◆ ModifiedSchemaFiles()

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

Definition at line 191 of file SchemaKernelWrapper.cpp.

192{
193 std::string modified{""};
194 for (auto [name, file] : Kernel->schema_files()) {
195 if (file->is_updated()) {
196 modified += file->get_full_file_name() + "\n\n";
197 }
198 }
199 return modified;
200}

◆ 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 825 of file SchemaKernelWrapper.cpp.

830{
831 try
832 {
833 CommandStack->push (
834 new AddAttributeCommand ( Class, name, type, is_mv, range, init_values, description,
835 is_null, format ) );
836 }
837 catch ( oks::exception & Ex )
838 {
839 QMessageBox::warning ( 0, "Schema editor",
840 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
841 }
842}
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 677 of file SchemaKernelWrapper.cpp.

679{
680 try
681 {
682 CommandStack->push ( new AddMethodCommand ( Class, name, description ) );
683 }
684 catch ( oks::exception & Ex )
685 {
686 QMessageBox::warning ( 0, "Schema editor",
687 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
688 }
689}

◆ 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 615 of file SchemaKernelWrapper.cpp.

619{
620 try
621 {
622 CommandStack->push ( new AddMethodImplementationComand ( Class, Method, Language, Prototype,
623 Body ) );
624 }
625 catch ( oks::exception & Ex )
626 {
627 QMessageBox::warning ( 0, "Schema editor",
628 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
629 }
630}

◆ 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 529 of file SchemaKernelWrapper.cpp.

534{
535 try
536 {
537 CommandStack->push (
538 new AddRelationship ( Class, Name, Description, Type, Composite, Exclusive, Dependent,
539 LowCc, HighCc ) );
540 }
541 catch ( oks::exception & Ex )
542 {
543 QMessageBox::warning ( 0, "Schema editor",
544 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
545 }
546}

◆ PushAddSuperClassCommand()

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

Definition at line 351 of file SchemaKernelWrapper.cpp.

353{
354 try
355 {
356 CommandStack->push ( new AddSuperClassCommand ( Class, SuperClass ) );
357 }
358 catch ( oks::exception & Ex )
359 {
360 QMessageBox::warning ( 0, "Schema editor",
361 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
362 }
363}

◆ PushCreateClassCommand()

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

Definition at line 379 of file SchemaKernelWrapper.cpp.

382{
383 try
384 {
385 CommandStack->push ( new CreateClassCommand ( ClassName, ClassDescription, Abstract ) );
386 }
387 catch ( ... )
388 {
389 QMessageBox::warning ( 0, "Schema editor", QString ( "Error" ) );
390 }
391}

◆ 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 844 of file SchemaKernelWrapper.cpp.

850{
851 try
852 {
853 CommandStack->push (
854 new RemoveAttributeCommand ( Class, Attribute, name, type, is_mv, range, init_values,
855 description, is_null, format ) );
856 }
857 catch ( oks::exception & Ex )
858 {
859 QMessageBox::warning ( 0, "Schema editor",
860 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
861 }
862}

◆ PushRemoveClassCommand()

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

Definition at line 393 of file SchemaKernelWrapper.cpp.

395{
396 try
397 {
398 CommandStack->push ( new RemoveClassCommand ( Class, ClassName, ClassDescription,
399 Abstract ) );
400 }
401 catch ( oks::exception & Ex )
402 {
403 QMessageBox::warning ( 0, "Schema editor",
404 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
405 }
406}

◆ PushRemoveMethodCommand()

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

Definition at line 691 of file SchemaKernelWrapper.cpp.

693{
694 try
695 {
696 CommandStack->push ( new RemoveMethodCommand ( Class, Method, name, description ) );
697 }
698 catch ( oks::exception & Ex )
699 {
700 QMessageBox::warning ( 0, "Schema editor",
701 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
702 }
703}

◆ 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 632 of file SchemaKernelWrapper.cpp.

637{
638 try
639 {
640 CommandStack->push ( new RemoveMethodImplementationComand ( Class, Method, Language, Prototype,
641 Body ) );
642 }
643 catch ( oks::exception & Ex )
644 {
645 QMessageBox::warning ( 0, "Schema editor",
646 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
647 }
648}

◆ 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 548 of file SchemaKernelWrapper.cpp.

555{
556 try
557 {
558 CommandStack->push (
559 new RemoveRelationship ( Class, Relationship, Name, Description, Type, Composite,
560 Exclusive, Dependent, LowCc, HighCc ) );
561 }
562 catch ( oks::exception & Ex )
563 {
564 QMessageBox::warning ( 0, "Schema editor",
565 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
566 }
567}

◆ PushRemoveSuperClassCommand()

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

Definition at line 365 of file SchemaKernelWrapper.cpp.

367{
368 try
369 {
370 CommandStack->push ( new RemoveSuperClassCommand ( Class, SuperClass ) );
371 }
372 catch ( oks::exception & Ex )
373 {
374 QMessageBox::warning ( 0, "Schema editor",
375 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
376 }
377}

◆ PushSetAbstractClassCommand()

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

Commands Functions Class commands

Definition at line 324 of file SchemaKernelWrapper.cpp.

325{
326 try
327 {
328 CommandStack->push ( new SetAbstractClassCommand ( Class, Value ) );
329 }
330 catch ( oks::exception & Ex )
331 {
332 QMessageBox::warning ( 0, "Schema editor",
333 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
334 }
335}

◆ PushSetAttributeDescriptionCommand()

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

Definition at line 720 of file SchemaKernelWrapper.cpp.

723{
724 try
725 {
726 CommandStack->push ( new SetAttributeDescriptionCommand ( Class, Attribute, NewDescription ) );
727 }
728 catch ( oks::exception & Ex )
729 {
730 QMessageBox::warning ( 0, "Schema editor",
731 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
732 }
733}

◆ PushSetAttributeFormatCommand()

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

Definition at line 765 of file SchemaKernelWrapper.cpp.

768{
769 try
770 {
771 CommandStack->push ( new SetAttributeFormatCommand ( Class, Attribute, NewFormat ) );
772 }
773 catch ( oks::exception & Ex )
774 {
775 QMessageBox::warning ( 0, "Schema editor",
776 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
777 }
778}

◆ PushSetAttributeInitialValuesCommand()

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

Definition at line 810 of file SchemaKernelWrapper.cpp.

813{
814 try
815 {
816 CommandStack->push ( new SetAttributeInitialValuesCommand ( Class, Attribute, NewValues ) );
817 }
818 catch ( oks::exception & Ex )
819 {
820 QMessageBox::warning ( 0, "Schema editor",
821 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
822 }
823}

◆ PushSetAttributeIsNullCommand()

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

Definition at line 795 of file SchemaKernelWrapper.cpp.

798{
799 try
800 {
801 CommandStack->push ( new SetAttributeIsNullCommand ( Class, Attribute, NewIsNull ) );
802 }
803 catch ( oks::exception & Ex )
804 {
805 QMessageBox::warning ( 0, "Schema editor",
806 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
807 }
808}

◆ PushSetAttributeMultiCommand()

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

Definition at line 780 of file SchemaKernelWrapper.cpp.

783{
784 try
785 {
786 CommandStack->push ( new SetAttributeMultiCommand ( Class, Attribute, NewIsMulti ) );
787 }
788 catch ( oks::exception & Ex )
789 {
790 QMessageBox::warning ( 0, "Schema editor",
791 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
792 }
793}

◆ PushSetAttributeNameCommand()

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

Attribute commands.

Definition at line 705 of file SchemaKernelWrapper.cpp.

708{
709 try
710 {
711 CommandStack->push ( new SetAttributeNameCommand ( Class, Attribute, NewName ) );
712 }
713 catch ( oks::exception & Ex )
714 {
715 QMessageBox::warning ( 0, "Schema editor",
716 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
717 }
718}

◆ PushSetAttributeRangeCommand()

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

Definition at line 750 of file SchemaKernelWrapper.cpp.

753{
754 try
755 {
756 CommandStack->push ( new SetAttributeRangeCommand ( Class, Attribute, NewRange ) );
757 }
758 catch ( oks::exception & Ex )
759 {
760 QMessageBox::warning ( 0, "Schema editor",
761 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
762 }
763}

◆ PushSetAttributeTypeCommand()

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

Definition at line 735 of file SchemaKernelWrapper.cpp.

738{
739 try
740 {
741 CommandStack->push ( new SetAttributeTypeCommand ( Class, Attribute, NewType ) );
742 }
743 catch ( oks::exception & Ex )
744 {
745 QMessageBox::warning ( 0, "Schema editor",
746 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
747 }
748}

◆ PushSetClassTypeRelationshipCommand()

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

Definition at line 423 of file SchemaKernelWrapper.cpp.

426{
427 try
428 {
429 CommandStack->push ( new SetClassTypeRelationshipCommand ( Class, Relationship, ClassType ) );
430 }
431 catch ( oks::exception & Ex )
432 {
433 QMessageBox::warning ( 0, "Schema editor",
434 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
435 }
436}

◆ PushSetDescriptionClassCommand()

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

Definition at line 337 of file SchemaKernelWrapper.cpp.

339{
340 try
341 {
342 CommandStack->push ( new SetDescriptionClassCommand ( Class, Description ) );
343 }
344 catch ( oks::exception & Ex )
345 {
346 QMessageBox::warning ( 0, "Schema editor",
347 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
348 }
349}

◆ PushSetDescriptionMethodCommand()

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

Definition at line 663 of file SchemaKernelWrapper.cpp.

665{
666 try
667 {
668 CommandStack->push ( new SetDescriptionMethodCommand ( Class, Method, description ) );
669 }
670 catch ( oks::exception & Ex )
671 {
672 QMessageBox::warning ( 0, "Schema editor",
673 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
674 }
675}

◆ PushSetDescriptionRelationshipCommand()

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

Definition at line 438 of file SchemaKernelWrapper.cpp.

442{
443 try
444 {
445 CommandStack->push ( new SetDescriptionRelationshipCommand ( Class, Relationship, Description ) );
446 }
447 catch ( oks::exception & Ex )
448 {
449 QMessageBox::warning ( 0, "Schema editor",
450 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
451 }
452}

◆ PushSetHighCcRelationshipCommand()

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

Definition at line 468 of file SchemaKernelWrapper.cpp.

470{
471 try
472 {
473 CommandStack->push ( new SetHighCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
474 }
475 catch ( oks::exception & Ex )
476 {
477 QMessageBox::warning ( 0, "Schema editor",
478 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
479 }
480}

◆ PushSetIsCompositeRelationshipCommand()

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

Definition at line 482 of file SchemaKernelWrapper.cpp.

485{
486 try
487 {
488 CommandStack->push ( new SetIsCompositeRelationshipCommand ( Class, Relationship, Value ) );
489 }
490 catch ( oks::exception & Ex )
491 {
492 QMessageBox::warning ( 0, "Schema editor",
493 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
494 }
495}

◆ PushSetIsDependentRelationshipCommand()

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

Definition at line 497 of file SchemaKernelWrapper.cpp.

501{
502 try
503 {
504 CommandStack->push ( new SetIsDependentRelationshipCommand ( Class, Relationship, Value ) );
505 }
506 catch ( oks::exception & Ex )
507 {
508 QMessageBox::warning ( 0, "Schema editor",
509 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
510 }
511}

◆ PushSetIsExclusiveRelationshipCommand()

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

Definition at line 513 of file SchemaKernelWrapper.cpp.

517{
518 try
519 {
520 CommandStack->push ( new SetIsExclusiveRelationshipCommand ( Class, Relationship, Value ) );
521 }
522 catch ( oks::exception & Ex )
523 {
524 QMessageBox::warning ( 0, "Schema editor",
525 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
526 }
527}

◆ PushSetLowCcRelationshipCommand()

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

Definition at line 454 of file SchemaKernelWrapper.cpp.

456{
457 try
458 {
459 CommandStack->push ( new SetLowCcRelationshipCommand ( Class, Relationship, NewCardinality ) );
460 }
461 catch ( oks::exception & Ex )
462 {
463 QMessageBox::warning ( 0, "Schema editor",
464 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
465 }
466}

◆ PushSetMethodImplementationBody()

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

Definition at line 599 of file SchemaKernelWrapper.cpp.

603{
604 try
605 {
606 CommandStack->push ( new SetMethodImplementationBody ( Class, Method, Implementation, Body ) );
607 }
608 catch ( oks::exception & Ex )
609 {
610 QMessageBox::warning ( 0, "Schema editor",
611 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
612 }
613}

◆ 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 569 of file SchemaKernelWrapper.cpp.

573{
574 try
575 {
576 CommandStack->push ( new SetMethodImplementationLanguage ( Class, Method, Implementation, Language ) );
577 }
578 catch ( oks::exception & Ex )
579 {
580 QMessageBox::warning ( 0, "Schema editor",
581 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
582 }
583}

◆ PushSetMethodImplementationPrototype()

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

Definition at line 585 of file SchemaKernelWrapper.cpp.

587{
588 try
589 {
590 CommandStack->push ( new SetMethodImplementationPrototype ( Class, Method, Implementation, Prototype ) );
591 }
592 catch ( oks::exception & Ex )
593 {
594 QMessageBox::warning ( 0, "Schema editor",
595 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
596 }
597}

◆ PushSetNameMethodCommand()

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

Method commands.

Definition at line 650 of file SchemaKernelWrapper.cpp.

651{
652 try
653 {
654 CommandStack->push ( new SetNameMethodCommand ( Class, Method, name ) );
655 }
656 catch ( oks::exception & Ex )
657 {
658 QMessageBox::warning ( 0, "Schema editor",
659 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
660 }
661}

◆ PushSetNameRelationshipCommand()

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

Relationship commands.

Definition at line 408 of file SchemaKernelWrapper.cpp.

411{
412 try
413 {
414 CommandStack->push ( new SetNameRelationshipCommand ( Class, Relationship, Name ) );
415 }
416 catch ( oks::exception & Ex )
417 {
418 QMessageBox::warning ( 0, "Schema editor",
419 QString ( "Error : \n\n %1" ).arg ( Ex.what() ) );
420 }
421}

◆ RebuildAttributeModel

void dbse::KernelWrapper::RebuildAttributeModel ( )
signal

◆ RemoveInclude()

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

Definition at line 86 of file SchemaKernelWrapper.cpp.

87{
88 auto ParentSchema = Kernel->find_schema_file( schemaFile );
89 if (ParentSchema != nullptr) {
90 ParentSchema->remove_include_file( IncludeFile );
91 }
92}

◆ SaveAllSchema()

void dbse::KernelWrapper::SaveAllSchema ( ) const

Definition at line 186 of file SchemaKernelWrapper.cpp.

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

◆ SaveModifiedSchema()

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

Definition at line 213 of file SchemaKernelWrapper.cpp.

214{
215 std::string saved{""};
216 for (auto [name, file] : Kernel->schema_files()) {
217 if (file->is_updated()) {
218 Kernel->save_schema(file);
219 saved += file->get_full_file_name() + "\n\n";
220 }
221 }
222 return saved;
223}
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 225 of file SchemaKernelWrapper.cpp.

226{
227 OksFile * file = Kernel->find_schema_file ( schema_file );
228 Kernel->save_schema(file);
229}

◆ SetActiveSchema()

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

Definition at line 24 of file SchemaKernelWrapper.cpp.

25{
26 OksFile * File = Kernel->find_schema_file ( ActiveSchema );
27
28 if ( File && IsFileWritable( ActiveSchema ))
29 {
30 Kernel->set_active_schema ( File );
31 emit active_updated();
32 }
33}
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 309 of file SchemaKernelWrapper.cpp.

310{
311 InheritanceMode = Mode;
312}

Friends And Related Symbol Documentation

◆ SchemaAttributeEditor

friend class SchemaAttributeEditor
friend

Definition at line 29 of file SchemaKernelWrapper.hpp.

◆ SchemaClassEditor

friend class SchemaClassEditor
friend

Definition at line 28 of file SchemaKernelWrapper.hpp.

◆ SchemaMainWindow

friend class SchemaMainWindow
friend

Definition at line 27 of file SchemaKernelWrapper.hpp.

◆ SchemaMethodEditor

friend class SchemaMethodEditor
friend

Definition at line 30 of file SchemaKernelWrapper.hpp.

◆ SchemaRelationshipEditor

friend class SchemaRelationshipEditor
friend

Definition at line 31 of file SchemaKernelWrapper.hpp.

Member Data Documentation

◆ CommandStack

QUndoStack* dbse::KernelWrapper::CommandStack
private

Definition at line 148 of file SchemaKernelWrapper.hpp.

◆ InheritanceMode

bool dbse::KernelWrapper::InheritanceMode
private

Definition at line 149 of file SchemaKernelWrapper.hpp.

◆ Kernel

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

Definition at line 147 of file SchemaKernelWrapper.hpp.


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