ecto
parameters.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <ecto/abi.hpp>
4 #include <string>
5 #include <stdint.h>
6 
7 #define ECTO_COMMON_TYPES \
8  (char)(int)(long)(float)(double)(uint8_t)(uint16_t)(uint32_t)(uint64_t)
9 
10 namespace ecto
11 {
12  template<typename T>
13  struct bounded
14  {
15  bounded(const T& value, const T& min, const T& max);
16 
17  explicit bounded(const T& value);
18 
19  bounded&
20  operator=(const T& value);
21 
22  void set(const T& value);
23 
24  bool
25  check(const T& value) const;
26 
27  std::string
28  bounds() const;
29 
30  operator T() const;
31 
32  T value, min, max;
33  bool has_bounds;
34  };
35 
36 }
bounded(const T &value, const T &min, const T &max)
Definition: parameters.hpp:14
T max
Definition: parameters.hpp:32
Definition: parameters.hpp:11
bounded & operator=(const T &value)
Definition: parameters.hpp:44
std::string bounds() const
Definition: parameters.hpp:63
Definition: parameters.hpp:13
bool has_bounds
Definition: parameters.hpp:33
T min
Definition: parameters.hpp:32
bool check(const T &value) const
Definition: parameters.hpp:52
T value
Definition: parameters.hpp:32