IDL compiler front-end library
Loading...
Searching...
No Matches
Operation.h
Go to the documentation of this file.
1
2/*
3* Nirvana IDL front-end library.
4*
5* This is a part of the Nirvana project.
6*
7* Author: Igor Popov
8*
9* Copyright (c) 2021 Igor Popov.
10*
11* This program is free software; you can redistribute it and/or modify
12* it under the terms of the GNU Lesser General Public License as published by
13* the Free Software Foundation; either version 3 of the License, or
14* (at your option) any later version.
15*
16* This program is distributed in the hope that it will be useful,
17* but WITHOUT ANY WARRANTY; without even the implied warranty of
18* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19* GNU General Public License for more details.
20*
21* You should have received a copy of the GNU Lesser General Public
22* License along with this library. If not, see <http://www.gnu.org/licenses/>.
23*
24* Send comments and/or bug reports to:
25* popov.nirvana@gmail.com
26*/
27#ifndef IDLFE_AST_OPERATION_H_
28#define IDLFE_AST_OPERATION_H_
29#pragma once
30
31#include "OperationBase.h"
32
33namespace AST {
34
39class Operation :
40 public OperationBase,
41 public Type
42{
43public:
45 bool oneway () const noexcept
46 {
47 return oneway_;
48 }
49
51 typedef std::vector <std::string> Context;
52
54 const Context& context () const noexcept
55 {
56 return context_;
57 }
58
59private:
60 template <class T> friend class Ptr;
61
62 Operation (Builder& builder, bool oneway, Type&& type, const SimpleDeclarator& name) :
63 OperationBase (Item::Kind::OPERATION, builder, name),
64 Type (std::move (type)),
65 oneway_ (oneway)
66 {}
67
68 friend class Builder;
69
70 void oneway_clear ()
71 {
72 oneway_ = false;
73 }
74
75 void context (Context&& strings)
76 {
77 context_ = std::move (strings);
78 }
79
80private:
81 bool oneway_;
82 Context context_;
83};
84
85}
86
87#endif
The AST builder.
Definition Builder.h:60
An AST item.
Definition Item.h:41
@ OPERATION
class Operation
const Identifier & name() const noexcept
Definition NamedItem.h:48
An operation base.
An operation.
Definition Operation.h:42
const Context & context() const noexcept
Definition Operation.h:54
std::vector< std::string > Context
The context.
Definition Operation.h:51
bool oneway() const noexcept
Definition Operation.h:45
AST item smart pointer.
Definition Item.h:134
The IDL simple declarator.
Definition Declarators.h:41
An IDL type.
Definition Type.h:47
Kind
The kind of type.
Definition Type.h:51
Abstract Syntax Tree namespace.
Definition Array.h:34