TBTK
Field.h
Go to the documentation of this file.
1 /* Copyright 2017 Kristofer Bj√∂rnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_FIELD
24 #define COM_DAFER45_TBTK_FIELD
25 
26 #include "TBTK/TBTKMacros.h"
27 
28 #include <initializer_list>
29 
30 namespace TBTK{
31 
33 template<typename DataType, typename ArgumentType>
34 class Field{
35 public:
37  Field(bool isCompact = false);
38 
40  virtual DataType operator()(std::initializer_list<ArgumentType> argument) const = 0;
41 
44  bool getIsCompact() const;
45 
47 // virtual const std::vector<double>& getCoordinates() const = 0;
48  virtual const std::vector<ArgumentType>& getCoordinates() const;
49 
51 // virtual double getExtent() const = 0;
52  virtual ArgumentType getExtent() const;
53 private:
55  bool isCompact;
56 };
57 
58 template<typename DataType, typename ArgumentType>
60  this->isCompact = isCompact;
61 }
62 
63 template<typename DataType, typename ArgumentType>
65  return isCompact;
66 }
67 
68 template<typename DataType, typename ArgumentType>
69 const std::vector<ArgumentType>& Field<DataType, ArgumentType>::getCoordinates() const{
70  TBTKExit(
71  "Field::getCoordinates()",
72  "The Field is not compact.",
73  ""
74  );
75 }
76 
77 template<typename DataType, typename ArgumentType>
79  TBTKExit(
80  "Field::getCoordinates()",
81  "Field is not compact.",
82  ""
83  );
84 }
85 
86 }; //End namespace TBTK
87 
88 #endif
Field(bool isCompact=false)
Definition: Field.h:59
Precompiler macros.
virtual ArgumentType getExtent() const
Definition: Field.h:78
virtual const std::vector< ArgumentType > & getCoordinates() const
Definition: Field.h:69
Definition: Field.h:34
Definition: ModelFactory.h:35
bool getIsCompact() const
Definition: Field.h:64
virtual DataType operator()(std::initializer_list< ArgumentType > argument) const =0