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

#include <SchemaCommand.hpp>

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

Public Member Functions

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

Private Attributes

std::string ClassName
dunedaq::oks::OksAttributeSchemaAttribute
std::string AttributeName
std::string NewAttributeRange
std::string OldAttributeRange

Detailed Description

Definition at line 466 of file SchemaCommand.hpp.

Constructor & Destructor Documentation

◆ SetAttributeRangeCommand()

dbse::SetAttributeRangeCommand::SetAttributeRangeCommand ( dunedaq::oks::OksClass * Class,
dunedaq::oks::OksAttribute * Attribute,
std::string NewRange )

Definition at line 863 of file SchemaCommand.cpp.

866 : ClassName ( Class->get_name() ),
867 SchemaAttribute ( Attribute ),
868 AttributeName ( Attribute->get_name() ),
869 NewAttributeRange ( NewRange ),
870 OldAttributeRange ( SchemaAttribute->get_range() )
871{
872 setText( QString::fromStdString("Set new range \"" + NewRange + "\" to attribute \"" + Attribute->get_name() + "\" of class \"" + ClassName + "\""));
873}
dunedaq::oks::OksAttribute * SchemaAttribute
const std::string & get_name() const noexcept
out stream operator
const std::string & get_name() const noexcept
Definition class.hpp:363

◆ ~SetAttributeRangeCommand()

dbse::SetAttributeRangeCommand::~SetAttributeRangeCommand ( )

Definition at line 875 of file SchemaCommand.cpp.

876{
877}

Member Function Documentation

◆ redo()

void dbse::SetAttributeRangeCommand::redo ( )

Definition at line 879 of file SchemaCommand.cpp.

880{
882 if(a != nullptr) {
883 SchemaAttribute = a;
884 }
885
886 SchemaAttribute->set_range ( NewAttributeRange );
887 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
888}
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:1014

◆ undo()

void dbse::SetAttributeRangeCommand::undo ( )

Definition at line 890 of file SchemaCommand.cpp.

891{
892 SchemaAttribute->set_range ( OldAttributeRange );
893 emit KernelWrapper::GetInstance().ClassUpdated ( QString::fromStdString(ClassName) );
894}

Member Data Documentation

◆ AttributeName

std::string dbse::SetAttributeRangeCommand::AttributeName
private

Definition at line 476 of file SchemaCommand.hpp.

◆ ClassName

std::string dbse::SetAttributeRangeCommand::ClassName
private

Definition at line 474 of file SchemaCommand.hpp.

◆ NewAttributeRange

std::string dbse::SetAttributeRangeCommand::NewAttributeRange
private

Definition at line 477 of file SchemaCommand.hpp.

◆ OldAttributeRange

std::string dbse::SetAttributeRangeCommand::OldAttributeRange
private

Definition at line 478 of file SchemaCommand.hpp.

◆ SchemaAttribute

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

Definition at line 475 of file SchemaCommand.hpp.


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