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::OksAttribute * SchemaAttribute
std::string AttributeName
std::string NewAttributeType
std::string OldAttributeType

Detailed Description

Definition at line 513 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 865 of file SchemaCommand.cpp.

866 : ClassName(Class->get_name())
867 , SchemaAttribute(Attribute)
868 , AttributeName(Attribute->get_name())
869 , NewAttributeType(NewType)
871{
872 setText(QString::fromStdString("Set new type \"" + NewType + "\" to attribute \"" + Attribute->get_name() +
873 "\" of class \"" + ClassName + "\""));
874}
dunedaq::oks::OksAttribute * SchemaAttribute
const std::string & get_type() const noexcept
Get attribute string type.
const std::string & get_name() const noexcept
out stream operator
const std::string & get_name() const noexcept
Definition class.hpp:374

◆ ~SetAttributeTypeCommand()

dbse::SetAttributeTypeCommand::~SetAttributeTypeCommand ( )

Definition at line 876 of file SchemaCommand.cpp.

876{}

Member Function Documentation

◆ redo()

void dbse::SetAttributeTypeCommand::redo ( )

Definition at line 879 of file SchemaCommand.cpp.

880{
882 if (a != nullptr) {
883 SchemaAttribute = a;
884 }
885
887 emit KernelWrapper::GetInstance().ClassUpdated(QString::fromStdString(ClassName));
888}
static KernelWrapper & GetInstance()
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
void ClassUpdated(QString ClassName)
void set_type(const std::string &type, bool skip_init=false)
Set attribute type.
OksAttribute * find_direct_attribute(const std::string &name) const noexcept
Find direct attribute.
Definition class.cpp:973

◆ undo()

void dbse::SetAttributeTypeCommand::undo ( )

Definition at line 891 of file SchemaCommand.cpp.

892{
894 emit KernelWrapper::GetInstance().ClassUpdated(QString::fromStdString(ClassName));
895}

Member Data Documentation

◆ AttributeName

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

Definition at line 524 of file SchemaCommand.hpp.

◆ ClassName

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

Definition at line 522 of file SchemaCommand.hpp.

◆ NewAttributeType

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

Definition at line 525 of file SchemaCommand.hpp.

◆ OldAttributeType

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

Definition at line 526 of file SchemaCommand.hpp.

◆ SchemaAttribute

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

Definition at line 523 of file SchemaCommand.hpp.


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