3 $Date: 2010/03/11 14:42:04 $
8 * Copyright (c) 2001 by Peter Simons <simons@cryp.to>.
12 #ifndef RESETABLE_VARIABLE_H
13 #define RESETABLE_VARIABLE_H
15 // This is a wrapper class about variables where you want to keep
16 // track of whether it has been assigened yet or not.
20 template <typename varT>
23 template <typename varT1>
24 friend std::ostream & operator<<(std::ostream & o, RESETABLE<varT1> v);
26 typedef varT value_type;
28 //-------------------------------------------------------------------------
34 //-------------------------------------------------------------------------
35 RESETABLE<value_type>(const RESETABLE<value_type> & rvalue)
36 : value(rvalue.value),
40 //-------------------------------------------------------------------------
41 RESETABLE(const value_type& val)
46 //-------------------------------------------------------------------------
47 RESETABLE<value_type> & operator=(const RESETABLE<value_type> & rvalue)
50 is_set = rvalue.is_set;
53 //-------------------------------------------------------------------------
54 RESETABLE<value_type> & operator= (const value_type& rhs)
60 //-------------------------------------------------------------------------
61 const value_type& const_data() const throw()
65 //-------------------------------------------------------------------------
66 value_type& data() throw()
70 //-------------------------------------------------------------------------
71 operator const value_type&() const throw()
75 //-------------------------------------------------------------------------
76 bool res_empty() const throw()
80 //-------------------------------------------------------------------------
85 //-------------------------------------------------------------------------
90 //-----------------------------------------------------------------------------
91 template <typename varT>
92 std::ostream & operator<<(std::ostream & o, RESETABLE<varT> v)
96 //-------------------------------------------------------------------------
97 #endif // RESETABLE_VARIABLE_H