Arduino Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
identity.hpp
Go to the documentation of this file.
1 // Author: Mario S. Könz <mskoenz@gmx.net>
2 // Date: 23.07.2013 05:09:57 EDT
3 // File: identity.hpp
4 
5 /* This program is free software. It comes without any warranty, to
6  * the extent permitted by applicable law. You can redistribute it
7  * and/or modify it under the terms of the Do What The Fuck You Want
8  * To Public License, Version 2, as published by Sam Hocevar. See
9  * http://www.wtfpl.net/ or COPYING for more details. */
10 
11 #ifndef __IDENTITY_HEADER
12 #define __IDENTITY_HEADER
13 
14 #include "realization.hpp"
15 
16 namespace ustd {
17  template<typename T>
19  public:
20  //------------------- ctors -------------------
21  identity_filter(): val_() {
22  }
23  identity_filter(identity_filter const & arg): val_(arg.val_) {
24  }
25  identity_filter(T const & arg): val_(arg) {
26  }
27  //------------------- ops -------------------
28  identity_filter & operator=(T const & in) {
29  val_ = in;
30  return (*this);
31  }
32  identity_filter & operator<<(T const & in) {
33  val_ = in;
34  return (*this);
35  }
36  //------------------- converter -------------------
37  T value() const {
38  return val_;
39  }
40  operator T() const {
41  return value();
42  }
43  private:
44  T val_;
45  };
46  //------------------- realization for filter -------------------
47  template<typename T, typename _base>
48  struct realization<T, tag::identity, _base> {
50  };
51 }//end namespace ustd
52 #endif //__IDENTITY_HEADER
identity_filter(identity_filter const &arg)
Definition: identity.hpp:23
Definition: realization.hpp:19
T value() const
Definition: identity.hpp:37
identity_filter()
Definition: identity.hpp:21
identity_filter & operator<<(T const &in)
Definition: identity.hpp:32
identity_filter< T > type
Definition: identity.hpp:49
Definition: identity.hpp:18
identity_filter & operator=(T const &in)
Definition: identity.hpp:28
identity_filter(T const &arg)
Definition: identity.hpp:25