OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Title.cpp
Go to the documentation of this file.
1//
2// Class Title
3// The class for OPAL TITLE command.
4//
5// Copyright (c) 2000 - 2021, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#include "BasicActions/Title.h"
19
22
24 : Action(1, "TITLE",
25 "The \"TITLE\" statement defines a new page title for subsequent "
26 "output.") {
27 itsAttr[0] = Attributes::makeString("STRING", "The title string");
28
30}
31
32Title::Title(const std::string& name, Title* parent) : Action(name, parent) {}
33
35
36Title* Title::clone(const std::string& name) { return new Title(name, this); }
37
39 std::string title = Attributes::getString(itsAttr[0]);
41}
42
43void Title::parse(Statement& statement) { parseShortcut(statement); }
The base class for all OPAL actions.
Definition Action.h:29
virtual void parseShortcut(Statement &, bool eval=true)
Parser for single-attribute commands.
Definition Object.cpp:113
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
Definition Object.cpp:169
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:210
void storeTitle(const std::string &)
Store the page title.
Definition OpalData.cpp:559
static OpalData * getInstance()
Definition OpalData.cpp:193
Interface for statements.
Definition Statement.h:37
Definition Title.h:23
Title()
Exemplar constructor.
Definition Title.cpp:23
virtual void parse(Statement &)
Parse command (special for one-attribute command).
Definition Title.cpp:43
virtual ~Title()
Definition Title.cpp:34
virtual void execute()
Execute the command.
Definition Title.cpp:38
virtual Title * clone(const std::string &name)
Make clone.
Definition Title.cpp:36
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.