unary_expr.h
Go to the documentation of this file.
1 /*
2  * This file is a part of TiledArray.
3  * Copyright (C) 2013 Virginia Tech
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Justus Calvin
19  * Department of Chemistry, Virginia Tech
20  *
21  * unary_expr.h
22  * Apr 1, 2014
23  *
24  */
25 
26 #ifndef TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
27 #define TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
28 
31 
32 namespace TiledArray {
33 namespace expressions {
34 
35 template <typename Derived>
36 class UnaryExpr : public Expr<Derived> {
37  public:
39  typedef typename ExprTrait<Derived>::argument_type
41 
42  private:
43  argument_type arg_;
44 
45  public:
46  // Compiler generated functions
47  UnaryExpr(const UnaryExpr_&) = default;
48  UnaryExpr(UnaryExpr_&&) = default;
49  ~UnaryExpr() = default;
50  UnaryExpr_& operator=(const UnaryExpr_&) = delete;
52 
54 
56  UnaryExpr(const argument_type& arg) : arg_(arg) {}
57 
59 
61  const argument_type& arg() const { return arg_; }
62 
63 }; // class UnaryExpr
64 
65 } // namespace expressions
66 } // namespace TiledArray
67 
68 #endif // TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
const argument_type & arg() const
Argument expression accessor.
Definition: unary_expr.h:61
UnaryExpr_ & operator=(UnaryExpr_ &&)=delete
Base class for expression evaluation.
Definition: expr.h:97
ExprTrait< Derived >::argument_type argument_type
The expression type.
Definition: unary_expr.h:40
UnaryExpr< Derived > UnaryExpr_
Definition: unary_expr.h:38
UnaryExpr_ & operator=(const UnaryExpr_ &)=delete
UnaryExpr(UnaryExpr_ &&)=default
UnaryExpr(const argument_type &arg)
Constructor.
Definition: unary_expr.h:56
UnaryExpr(const UnaryExpr_ &)=default