1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
26 virtual void getValue(IValue
&) = 0;
27 virtual void setValue(IValue
&) = 0;
29 virtual bool operator==(IValue
*) const = 0 ;
30 virtual bool operator<(IValue
&) = 0;
31 virtual bool operator>(IValue
&) = 0;
34 template<class T
> class CValue
: public IValue
{
40 CValue(const CValue
<T
> &);
41 virtual void getValue(IValue
&);
42 virtual void setValue(IValue
&);
44 // virtual CValue<T> &operator=(T);
46 virtual bool operator==(IValue
*) const;
47 bool operator<(IValue
&);
48 bool operator>(IValue
&);
51 virtual void setValue(T
);
54 template<class T
> CValue
<T
>::CValue()
58 template<class T
> CValue
<T
>::CValue(T value
)
63 template<class T
> CValue
<T
>::CValue(const CValue
<T
> &value
)
65 _Value
= value
.getValue();
68 template<class T
> void CValue
<T
>::getValue(IValue
&value
)
70 ( (CValue
<T
> &)value
)._Value
= _Value
;
73 template<class T
> void CValue
<T
>::setValue(IValue
&value
)
75 _Value
= ( ( (CValue
<T
> &)value
).getValue() );
78 template<class T
> bool CValue
<T
>::operator==(IValue
*value
) const
80 return ( _Value
== ( ( (CValue
<T
> *)value
)->getValue() ) );
83 template<class T
> bool CValue
<T
>::operator<(IValue
&value
)
85 if ( _Value
< ( ( (CValue
<T
> &)value
).getValue() ) )
91 template<class T
> bool CValue
<T
>::operator>(IValue
&value
)
93 if ( _Value
> ( ( (CValue
<T
> &)value
).getValue() ) )
99 template<class T
> void CValue
<T
>::setValue(T value
)
104 template<class T
> T CValue
<T
>::getValue()