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

Attributes commands. More...

#include <SchemaCommand.hpp>

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

Public Member Functions

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

Private Attributes

std::string ClassName
dunedaq::oks::OksAttribute * SchemaAttribute
std::string NewAttributeName
std::string OldAttributeName

Detailed Description

Attributes commands.

Definition at line 480 of file SchemaCommand.hpp.

Constructor & Destructor Documentation

◆ SetAttributeNameCommand()

dbse::SetAttributeNameCommand::SetAttributeNameCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewName )

Definition at line 834 of file SchemaCommand.cpp.

835 : ClassName(Class->get_name())
836 , SchemaAttribute(Attribute)
837 , NewAttributeName(NewName)
839{
840 setText(QString::fromStdString("Set new name \"" + NewName + "\" to attribute \"" + Attribute->get_name() +
841 "\" of class \"" + ClassName + "\""));
842}
dunedaq::oks::OksAttribute * SchemaAttribute
const std::string & get_name() const noexcept
out stream operator
const std::string & get_name() const noexcept
Definition class.hpp:374

◆ ~SetAttributeNameCommand()

dbse::SetAttributeNameCommand::~SetAttributeNameCommand ( )

Definition at line 844 of file SchemaCommand.cpp.

844{}

Member Function Documentation

◆ redo()

void dbse::SetAttributeNameCommand::redo ( )

Definition at line 847 of file SchemaCommand.cpp.

848{
850 if (a != nullptr) {
851 SchemaAttribute = a;
852 }
853
855 emit KernelWrapper::GetInstance().ClassUpdated(QString::fromStdString(ClassName));
856}
static KernelWrapper & GetInstance()
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
void ClassUpdated(QString ClassName)
void set_name(const std::string &name)
Set attribute name.
OksAttribute * find_direct_attribute(const std::string &name) const noexcept
Find direct attribute.
Definition class.cpp:973

◆ undo()

void dbse::SetAttributeNameCommand::undo ( )

Definition at line 859 of file SchemaCommand.cpp.

860{
862 emit KernelWrapper::GetInstance().ClassUpdated(QString::fromStdString(ClassName));
863}

Member Data Documentation

◆ ClassName

std::string dbse::SetAttributeNameCommand::ClassName
private

Definition at line 489 of file SchemaCommand.hpp.

◆ NewAttributeName

std::string dbse::SetAttributeNameCommand::NewAttributeName
private

Definition at line 491 of file SchemaCommand.hpp.

◆ OldAttributeName

std::string dbse::SetAttributeNameCommand::OldAttributeName
private

Definition at line 492 of file SchemaCommand.hpp.

◆ SchemaAttribute

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

Definition at line 490 of file SchemaCommand.hpp.


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