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

#include <SchemaCommand.hpp>

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

Public Member Functions

 SetAttributeFormatCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, dunedaq::oks::OksAttribute::Format NewFormat)
 ~SetAttributeFormatCommand ()
void redo ()
void undo ()

Private Attributes

std::string ClassName
dunedaq::oks::OksAttributeSchemaAttribute
std::string AttributeName
dunedaq::oks::OksAttribute::Format NewAttributeFormat
dunedaq::oks::OksAttribute::Format OldAttributeFormat

Detailed Description

Definition at line 486 of file SchemaCommand.hpp.

Constructor & Destructor Documentation

◆ SetAttributeFormatCommand()

dbse::SetAttributeFormatCommand::SetAttributeFormatCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
dunedaq::oks::OksAttribute::Format NewFormat )

Definition at line 901 of file SchemaCommand.cpp.

904 : ClassName ( Class->get_name() ),
905 SchemaAttribute ( Attribute ),
906 AttributeName ( Attribute->get_name() ),
907 NewAttributeFormat ( NewFormat ),
908 OldAttributeFormat ( SchemaAttribute->get_format() )
909{
910 setText( QString::fromStdString("Set new format for attribute \"" + Attribute->get_name() + "\" of class \"" + ClassName + "\""));
911}
dunedaq::oks::OksAttribute::Format OldAttributeFormat
dunedaq::oks::OksAttribute * SchemaAttribute
dunedaq::oks::OksAttribute::Format NewAttributeFormat
const std::string & get_name() const noexcept
out stream operator
const std::string & get_name() const noexcept
Definition class.hpp:368

◆ ~SetAttributeFormatCommand()

dbse::SetAttributeFormatCommand::~SetAttributeFormatCommand ( )

Definition at line 913 of file SchemaCommand.cpp.

914{
915}

Member Function Documentation

◆ redo()

void dbse::SetAttributeFormatCommand::redo ( )

Definition at line 917 of file SchemaCommand.cpp.

918{
920 if(a != nullptr) {
921 SchemaAttribute = a;
922 }
923
924 SchemaAttribute->set_format ( NewAttributeFormat );
925 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
926}
static KernelWrapper & GetInstance()
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
void ClassUpdated(QString ClassName)
OksAttribute * find_direct_attribute(const std::string &name) const noexcept
Find direct attribute.
Definition class.cpp:1019

◆ undo()

void dbse::SetAttributeFormatCommand::undo ( )

Definition at line 928 of file SchemaCommand.cpp.

929{
930 SchemaAttribute->set_format ( OldAttributeFormat );
931 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
932}

Member Data Documentation

◆ AttributeName

std::string dbse::SetAttributeFormatCommand::AttributeName
private

Definition at line 496 of file SchemaCommand.hpp.

◆ ClassName

std::string dbse::SetAttributeFormatCommand::ClassName
private

Definition at line 494 of file SchemaCommand.hpp.

◆ NewAttributeFormat

dunedaq::oks::OksAttribute::Format dbse::SetAttributeFormatCommand::NewAttributeFormat
private

Definition at line 497 of file SchemaCommand.hpp.

◆ OldAttributeFormat

dunedaq::oks::OksAttribute::Format dbse::SetAttributeFormatCommand::OldAttributeFormat
private

Definition at line 498 of file SchemaCommand.hpp.

◆ SchemaAttribute

dunedaq::oks::OksAttribute* dbse::SetAttributeFormatCommand::SchemaAttribute
private

Definition at line 495 of file SchemaCommand.hpp.


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