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

#include <SchemaCommand.hpp>

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

Public Member Functions

 SetAttributeTypeCommand (dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string NewType)
 ~SetAttributeTypeCommand ()
void redo ()
void undo ()

Private Attributes

std::string ClassName
dunedaq::oks::OksAttributeSchemaAttribute
std::string AttributeName
std::string NewAttributeType
std::string OldAttributeType

Detailed Description

Definition at line 456 of file SchemaCommand.hpp.

Constructor & Destructor Documentation

◆ SetAttributeTypeCommand()

dbse::SetAttributeTypeCommand::SetAttributeTypeCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewType )

Definition at line 835 of file SchemaCommand.cpp.

838 : ClassName ( Class->get_name() ),
839 SchemaAttribute ( Attribute ),
840 AttributeName ( Attribute->get_name() ),
841 NewAttributeType ( NewType ),
842 OldAttributeType ( SchemaAttribute->get_type() )
843{
844 setText( QString::fromStdString("Set new type \"" + NewType + "\" to attribute \"" + Attribute->get_name() + "\" of class \"" + ClassName + "\""));
845}
dunedaq::oks::OksAttribute * SchemaAttribute
const std::string & get_name() const noexcept
out stream operator
const std::string & get_name() const noexcept
Definition class.hpp:368

◆ ~SetAttributeTypeCommand()

dbse::SetAttributeTypeCommand::~SetAttributeTypeCommand ( )

Definition at line 847 of file SchemaCommand.cpp.

848{
849}

Member Function Documentation

◆ redo()

void dbse::SetAttributeTypeCommand::redo ( )

Definition at line 851 of file SchemaCommand.cpp.

852{
854 if(a != nullptr) {
855 SchemaAttribute = a;
856 }
857
858 SchemaAttribute->set_type ( NewAttributeType );
859 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
860}
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::SetAttributeTypeCommand::undo ( )

Definition at line 862 of file SchemaCommand.cpp.

863{
864 SchemaAttribute->set_type ( OldAttributeType );
865 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
866}

Member Data Documentation

◆ AttributeName

std::string dbse::SetAttributeTypeCommand::AttributeName
private

Definition at line 466 of file SchemaCommand.hpp.

◆ ClassName

std::string dbse::SetAttributeTypeCommand::ClassName
private

Definition at line 464 of file SchemaCommand.hpp.

◆ NewAttributeType

std::string dbse::SetAttributeTypeCommand::NewAttributeType
private

Definition at line 467 of file SchemaCommand.hpp.

◆ OldAttributeType

std::string dbse::SetAttributeTypeCommand::OldAttributeType
private

Definition at line 468 of file SchemaCommand.hpp.

◆ SchemaAttribute

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

Definition at line 465 of file SchemaCommand.hpp.


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