OpenASIP  2.0
OperationTriggeredFormat.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2021 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file OperationTriggeredFormat.hh
26  *
27  * Declaration of OperationTriggeredFormat class.
28  *
29  * @author Kari Hepola 2022 (kari.hepola@tuni.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_OPERATION_TRIGGERED_FORMAT_HH
34 #define TTA_OPERATION_TRIGGERED_FORMAT_HH
35 
36 #include "MachinePart.hh"
37 #include <vector>
38 
39 namespace TTAMachine {
40 
41 class Machine;
42 class OperationTriggeredOperand;
43 
45 public:
46  OperationTriggeredFormat(const std::string& name, Machine& owner);
47 
48  OperationTriggeredFormat(const ObjectState* state, Machine& owner);
49 
50  virtual ~OperationTriggeredFormat();
51 
52  void addOperation(const std::string& op);
53  void removeOperation(const std::string& op);
54 
55  std::vector<std::string> operations() const;
56 
57  int operationCount() const;
58  std::string operation(int index) const;
59  bool hasOperation(const std::string& opName) const;
60 
61 
63  std::vector<OperationTriggeredOperand*> operands() const;
64 
65  virtual void setMachine(Machine& machine);
66  virtual void unsetMachine();
67 
68  // methods inherited from Serializable interface
69  virtual void loadState(const ObjectState* state);
70  virtual ObjectState* saveState() const;
71 
72  static const std::string OSNAME_FORMAT;
73  static const std::string OSKEY_OPERATION;
74 
75 
76 private:
77 
78  std::vector<std::string> operations_;
79  std::vector<OperationTriggeredOperand*> operands_;
80 
81 };
82 }
83 
84 #endif
TTAMachine::OperationTriggeredFormat::operations
std::vector< std::string > operations() const
Definition: OperationTriggeredFormat.cc:108
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
TTAMachine::OperationTriggeredFormat::operands
std::vector< OperationTriggeredOperand * > operands() const
Definition: OperationTriggeredFormat.cc:151
TTAMachine::OperationTriggeredFormat::operation
std::string operation(int index) const
Definition: OperationTriggeredFormat.cc:132
TTAMachine::OperationTriggeredFormat::removeOperation
void removeOperation(const std::string &op)
Definition: OperationTriggeredFormat.cc:118
ObjectState
Definition: ObjectState.hh:59
TTAMachine::OperationTriggeredFormat::OperationTriggeredFormat
OperationTriggeredFormat(const std::string &name, Machine &owner)
Definition: OperationTriggeredFormat.cc:56
TTAMachine::OperationTriggeredOperand
Definition: OperationTriggeredOperand.hh:44
TTAMachine::OperationTriggeredFormat::OSKEY_OPERATION
static const std::string OSKEY_OPERATION
Definition: OperationTriggeredFormat.hh:73
MachinePart.hh
TTAMachine::OperationTriggeredFormat::saveState
virtual ObjectState * saveState() const
Definition: OperationTriggeredFormat.cc:226
TTAMachine::OperationTriggeredFormat::operands_
std::vector< OperationTriggeredOperand * > operands_
Definition: OperationTriggeredFormat.hh:79
TTAMachine::OperationTriggeredFormat::setMachine
virtual void setMachine(Machine &machine)
Definition: OperationTriggeredFormat.cc:170
TTAMachine::OperationTriggeredFormat::operationCount
int operationCount() const
Definition: OperationTriggeredFormat.cc:127
TTAMachine::OperationTriggeredFormat::operations_
std::vector< std::string > operations_
Definition: OperationTriggeredFormat.hh:78
TTAMachine::OperationTriggeredFormat::OSNAME_FORMAT
static const std::string OSNAME_FORMAT
Definition: OperationTriggeredFormat.hh:72
TTAMachine::Component
Definition: MachinePart.hh:90
TTAMachine::OperationTriggeredFormat::~OperationTriggeredFormat
virtual ~OperationTriggeredFormat()
Definition: OperationTriggeredFormat.cc:100
TTAMachine::OperationTriggeredFormat
Definition: OperationTriggeredFormat.hh:44
TTAMachine::OperationTriggeredFormat::addOperation
void addOperation(const std::string &op)
Definition: OperationTriggeredFormat.cc:113
TTAMachine::OperationTriggeredFormat::loadState
virtual void loadState(const ObjectState *state)
Definition: OperationTriggeredFormat.cc:190
TTAMachine::Component::machine
virtual Machine * machine() const
TTAMachine::OperationTriggeredFormat::addOperand
void addOperand(OperationTriggeredOperand &operand)
Definition: OperationTriggeredFormat.cc:156
TTAMachine
Definition: Assembler.hh:48
TTAMachine::OperationTriggeredFormat::unsetMachine
virtual void unsetMachine()
Definition: OperationTriggeredFormat.cc:182
TTAMachine::OperationTriggeredFormat::hasOperation
bool hasOperation(const std::string &opName) const
Definition: OperationTriggeredFormat.cc:141
TTAMachine::Machine
Definition: Machine.hh:73