Commit 3eba104e authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Introduce literal::min and literal::max.

	* milena/headers.mk: add new headers to distribution.

	* milena/mln/literal/all.hh: include new headers.

	* milena/mln/literal/max.hh,
	* milena/mln/literal/min.hh: New literals. They use mln_{max,min}
	internaly.

	* milena/tests/unit_test/Makefile.am,
	* milena/tests/unit_test/mln_literal_max.cc,
	* milena/tests/unit_test/mln_literal_min.cc: new unit tests.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3192 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent f59e67a2
2009-01-23 Guillaume Lazzara <z@lrde.epita.fr>
Introduce literal::min and literal::max.
* milena/headers.mk: add new headers to distribution.
* milena/mln/literal/all.hh: include new headers.
* milena/mln/literal/max.hh,
* milena/mln/literal/min.hh: New literals. They use mln_{max,min}
internaly.
* milena/tests/unit_test/Makefile.am,
* milena/tests/unit_test/mln_literal_max.cc,
* milena/tests/unit_test/mln_literal_min.cc: new unit tests.
2009-01-23 Guillaume Lazzara <z@lrde.epita.fr>
 
Fix various operator issues with value::shell.
......@@ -44,6 +44,7 @@ mln/pw/cst.hh \
mln/pw/var.hh \
mln/pw/essential.hh \
mln/literal/zero.hh \
mln/literal/max.hh \
mln/literal/ops.hh \
mln/literal/origin.hh \
mln/literal/grays.hh \
......@@ -51,6 +52,7 @@ mln/literal/all.hh \
mln/literal/colors.hh \
mln/literal/black.hh \
mln/literal/one.hh \
mln/literal/min.hh \
mln/literal/white.hh \
mln/literal/essential.hh \
mln/registration/get_rtransf.hh \
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -64,6 +64,9 @@ namespace mln
# include <mln/literal/grays.hh>
# include <mln/literal/colors.hh>
# include <mln/literal/max.hh>
# include <mln/literal/min.hh>
# include <mln/literal/ops.hh>
......
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_LITERAL_MAX_HH
# define MLN_LITERAL_MAX_HH
/// \file mln/literal/max.hh
///
/// Definition of the literal of mln::max.
# include <mln/core/concept/literal.hh>
# include <mln/trait/value_.hh>
namespace mln
{
namespace literal
{
/// Type of literal max.
struct max_t : public Literal<max_t>
{
template <typename T>
operator T () const;
};
/// Literal max.
extern const max_t& max;
# ifndef MLN_INCLUDE_ONLY
template <typename T>
inline
max_t::operator T () const
{
return mln_max(T);
}
const max_t& max = max_t();
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
} // end of namespace mln
#endif // ! MLN_LITERAL_MAX_HH
// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_LITERAL_MIN_HH
# define MLN_LITERAL_MIN_HH
/// \file mln/literal/min.hh
///
/// Definition of the literal of mln::min.
# include <mln/core/concept/literal.hh>
# include <mln/trait/value_.hh>
namespace mln
{
namespace literal
{
/// Type of literal min.
struct min_t : public Literal<min_t>
{
template <typename T>
operator T () const;
};
/// Literal min.
extern const min_t& min;
# ifndef MLN_INCLUDE_ONLY
template <typename T>
inline
min_t::operator T () const
{
return mln_min(T);
}
const min_t& min = min_t();
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
} // end of namespace mln
#endif // ! MLN_LITERAL_MIN_HH
......@@ -44,6 +44,7 @@ mln_pw_cst \
mln_pw_var \
mln_pw_essential \
mln_literal_zero \
mln_literal_max \
mln_literal_ops \
mln_literal_origin \
mln_literal_grays \
......@@ -51,6 +52,7 @@ mln_literal_all \
mln_literal_colors \
mln_literal_black \
mln_literal_one \
mln_literal_min \
mln_literal_white \
mln_literal_essential \
mln_registration_get_rtransf \
......@@ -1065,6 +1067,7 @@ mln_pw_cst_SOURCES = mln_pw_cst.cc
mln_pw_var_SOURCES = mln_pw_var.cc
mln_pw_essential_SOURCES = mln_pw_essential.cc
mln_literal_zero_SOURCES = mln_literal_zero.cc
mln_literal_max_SOURCES = mln_literal_max.cc
mln_literal_ops_SOURCES = mln_literal_ops.cc
mln_literal_origin_SOURCES = mln_literal_origin.cc
mln_literal_grays_SOURCES = mln_literal_grays.cc
......@@ -1072,6 +1075,7 @@ mln_literal_all_SOURCES = mln_literal_all.cc
mln_literal_colors_SOURCES = mln_literal_colors.cc
mln_literal_black_SOURCES = mln_literal_black.cc
mln_literal_one_SOURCES = mln_literal_one.cc
mln_literal_min_SOURCES = mln_literal_min.cc
mln_literal_white_SOURCES = mln_literal_white.cc
mln_literal_essential_SOURCES = mln_literal_essential.cc
mln_registration_get_rtransf_SOURCES = mln_registration_get_rtransf.cc
......
// Unit test for mln/literal/max.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/literal/max.hh>
#include <mln/literal/max.hh>
int main()
{
// Nothing.
}
// Unit test for mln/literal/min.hh.
// Generated by ./build_unit_test.sh, do not modify.
// Include the file twice, so we detect missing inclusion guards.
#include <mln/literal/min.hh>
#include <mln/literal/min.hh>
int main()
{
// Nothing.
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment