Update of /cvsroot/boost/boost/boost/bimap/support
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24149/boost/bimap/support
Added Files:
data_type_by.hpp iterator_type_by.hpp key_type_by.hpp
lambda.hpp map_by.hpp map_type_by.hpp value_type_by.hpp
Log Message:
first bimap commit
--- NEW FILE: data_type_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/data_type_by.hpp
/// \brief Metafunction to access the data types of a bimap
#ifndef BOOST_BIMAP_SUPPORT_DATA_TYPE_BY_HPP
#define BOOST_BIMAP_SUPPORT_DATA_TYPE_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/detail/metadata_access_builder.hpp>
/** \struct boost::bimaps::support::data_type_by
\brief Metafunction to obtain the data type of one of the sides in a bimap
The tag parameter can be either a user defined tag or \c member_at::{side}.
This is the actual data type stored in the bimap.
\code
template< class Tag, class Bimap >
struct data_type_by
{
typedef typename Bimap::{side}_data_type type;
};
\endcode
The following holds:
\code
BOOST_STATIC_ASSERT
(
is_same< data_type_by< member_at::left, bimap<A,B> >::type, A >::value
);
\endcode
See also member_at.
\ingroup bimap_group
**/
namespace boost {
namespace bimaps {
namespace support {
// Implementation of data type of metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
data_type_by,
left_data_type,
right_data_type
);
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_SUPPORT_DATA_TYPE_BY_HPP
--- NEW FILE: iterator_type_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/iterator_type_by.hpp
/// \brief Metafunctions to access the iterator types of a bimap
#ifndef BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
#define BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/detail/metadata_access_builder.hpp>
#include <boost/bimap/relation/detail/static_access_builder.hpp>
#include <boost/bimap/relation/support/pair_type_by.hpp>
#include <boost/bimap/detail/map_view_iterator.hpp>
/** \struct boost::bimaps::support::iterator_type_by
\brief Metafunction to obtain the iterator type of the map view by one of the
sides.
\code
template< class Tag, class Bimap >
struct iterator_type_by
{
typedef -unspecified- type;
};
template< class Tag, class Bimap >
struct const_iterator_type_by
{
typedef -unspecified- type;
};
template< class Tag, class Bimap >
struct reverse_iterator_type_by
{
typedef -unspecified- type;
};
template< class Tag, class Bimap >
struct const_reverse_iterator_type_by
{
typedef -unspecified- type;
};
template< class Tag, class Bimap >
struct local_iterator_type_by
{
typedef -unspecified- type;
};
template< class Tag, class Bimap >
struct const_local_iterator_type_by
{
typedef -unspecified- type;
};
\endcode
See also member_at.
\ingroup bimap_group
**/
#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
namespace boost {
namespace bimaps {
namespace support {
// Implementation of iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
iterator_type_by,
left_iterator,
right_iterator
);
// Implementation of const iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
const_iterator_type_by,
left_const_iterator,
right_const_iterator
);
// Implementation of reverse iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
(
core_reverse_iterator_type_by,
BimapCore,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
::type::reverse_iterator type,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
::type::reverse_iterator type
);
template< class Tag, class BimapCore >
struct reverse_iterator_type_by
{
typedef ::boost::bimaps::detail::map_view_iterator
<
Tag,
BOOST_DEDUCED_TYPENAME BimapCore::relation,
BOOST_DEDUCED_TYPENAME
core_reverse_iterator_type_by<Tag,BimapCore>::type
> type;
};
// Implementation of const reverse iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
(
core_const_reverse_iterator_type_by,
BimapCore,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
::type::const_reverse_iterator type,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
::type::const_reverse_iterator type
);
template< class Tag, class BimapCore >
struct const_reverse_iterator_type_by
{
typedef ::boost::bimaps::detail::map_view_iterator
<
Tag,
BOOST_DEDUCED_TYPENAME BimapCore::relation,
BOOST_DEDUCED_TYPENAME
core_const_reverse_iterator_type_by<Tag,BimapCore>::type
> type;
};
// Implementation of local iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
(
core_local_iterator_type_by,
BimapCore,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
::type::local_iterator type,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
::type::local_iterator type
);
template< class Tag, class BimapCore >
struct local_iterator_type_by
{
typedef ::boost::bimaps::detail::map_view_iterator
<
Tag,
BOOST_DEDUCED_TYPENAME BimapCore::relation,
BOOST_DEDUCED_TYPENAME core_local_iterator_type_by<Tag,BimapCore>::type
> type;
};
// Implementation of const local iterator type by metafunction
BOOST_BIMAP_SYMMETRIC_STATIC_ACCESS_BUILDER
(
core_const_local_iterator_type_by,
BimapCore,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::left_tag>
::type::const_local_iterator type,
typedef BOOST_DEDUCED_TYPENAME BimapCore::core_type::BOOST_NESTED_TEMPLATE
index<BOOST_DEDUCED_TYPENAME BimapCore::right_tag>
::type::const_local_iterator type
);
template< class Tag, class BimapCore >
struct const_local_iterator_type_by
{
typedef ::boost::bimaps::detail::map_view_iterator
<
Tag,
BOOST_DEDUCED_TYPENAME BimapCore::relation,
BOOST_DEDUCED_TYPENAME
core_const_local_iterator_type_by<Tag,BimapCore>::type
> type;
};
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
#endif // BOOST_BIMAP_SUPPORT_ITERATOR_TYPE_BY_HPP
--- NEW FILE: key_type_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/key_type_by.hpp
/// \brief Metafunction to access the set types of a bimap
#ifndef BOOST_BIMAP_SUPPORT_KEY_TYPE_BY_HPP
#define BOOST_BIMAP_SUPPORT_KEY_TYPE_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/detail/metadata_access_builder.hpp>
/** \struct boost::bimaps::support::key_type_by
\brief Metafunction to obtain the key type of one of the sides in a bimap
The tag parameter can be either a user defined tag or \c member_at::{side}.
The returned type is one of the {SetType}_of definition classes.
\code
template< class Tag, class Bimap >
struct key_type_by
{
typedef typename Bimap::{side}_key_type type;
};
\endcode
See also member_at.
\ingroup bimap_group
**/
namespace boost {
namespace bimaps {
namespace support {
// Implementation of key type type of metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
key_type_by,
left_key_type,
right_key_type
);
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_SUPPORT_KEY_TYPE_BY_HPP
--- NEW FILE: lambda.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/lambda.hpp
/// \brief Placeholders definition to help in bimap modify function
#ifndef BOOST_BIMAP_SUPPORT_LAMBDA_HPP
#define BOOST_BIMAP_SUPPORT_LAMBDA_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/lambda/lambda.hpp>
namespace boost {
namespace bimaps {
namespace {
/*
boost::lambda::placeholder1_type & _first = boost::lambda::_1;
boost::lambda::placeholder2_type & _second = boost::lambda::_2;
boost::lambda::placeholder1_type & _left = boost::lambda::_1;
boost::lambda::placeholder2_type & _right = boost::lambda::_2;
*/
boost::lambda::placeholder1_type & _key = boost::lambda::_1;
boost::lambda::placeholder1_type & _data = boost::lambda::_1;
}
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_SUPPORT_LAMBDA_HPP
--- NEW FILE: map_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/map_by.hpp
/// \brief map_by<tag>(b) function
#ifndef BOOST_BIMAP_SUPPORT_MAP_BY_HPP
#define BOOST_BIMAP_SUPPORT_MAP_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/support/map_type_by.hpp>
#include <boost/bimap/relation/detail/access_builder.hpp>
#ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
namespace boost {
namespace bimaps {
namespace support {
/** \brief Gets a map view of a bidirectional map
Convertible to \c map_type_by<Tag,Bimap>::type
Instead of using \c map_type_by<Tag,Bimap>::type this functions use
\b Boost.call_traits to find the best way to return this value. To help
the user of this function the following metafunction is provided
\code
namespace result_of {
template< class Tag, class Bimap >
struct map_by( Bimap & b );
} // namespace result_of
\endcode
See also member_at, value_type_of.
\ingroup bimap_group
**/
template< class Tag, class Bimap >
BOOST_DEDUCED_TYPENAME result_of::map_by<Tag,Bimap>::type
map_by( Bimap & b );
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
#ifndef BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
namespace boost {
namespace bimaps {
namespace support {
// Since it is very error-prone to directly write the hole bunch
// of relation accesor. They are buil from litle macro blocks that
// are both more readable, leading to self docummenting code and a
// lot more easier to understand and mantain.
// It is very important to note that the three building blocks have
// to laid in the same namespace in order to work. There is also
// important to keep them in order.
// The forward declaration are not necesary but they help a lot to
// the reader, as they undercover what is the signature of the
// result code.
// In the end, it is not quicker to do it in this way because you
// write a lot. But this code has no complexity at all and almost
// every word writed is for documentation.
// Result of
// -------------------------------------------------------------------------
/*
namespace result_of {
template< class Tag, class Bimap >
struct map_by<Tag,Bimap>;
{
typedef -unspecified- type;
};
} // namespace result_of
*/
BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
(
map_by,
map_type_by
);
// Implementation
// -------------------------------------------------------------------------
BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
(
map_by,
Bimap,
b,
return b.left,
return b.right
);
// Interface
// --------------------------------------------------------------------------
BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
(
map_by
);
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
#endif // BOOST_BIMAP_SUPPORT_MAP_BY_HPP
--- NEW FILE: map_type_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/map_type_by.hpp
/// \brief Metafunction to access the map view types of a bimap
#ifndef BOOST_BIMAP_SUPPORT_MAP_TYPE_BY_HPP
#define BOOST_BIMAP_SUPPORT_MAP_TYPE_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/detail/metadata_access_builder.hpp>
/** \struct boost::bimaps::support::map_type_by
\brief Metafunction to obtain the map view type of a bimap indexed by one of
the sides.
The tag parameter can be either a user defined tag or \c member_at::{side}.
The returned type is signature-compatible with std::pair.
\code
template< class Tag, class Bimap >
struct map_type_by
{
typedef typename Bimap::{side}_map_type type;
};
\endcode
See also member_at.
\ingroup bimap_group
**/
namespace boost {
namespace bimaps {
namespace support {
// Implementation of map type by metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
map_type_by,
left_map,
right_map
);
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_SUPPORT_MAP_TYPE_BY_HPP
--- NEW FILE: value_type_by.hpp ---
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file support/value_type_by.hpp
/// \brief Metafunction to access the value types (std::pair compatibles) of a
bimap
#ifndef BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_HPP
#define BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/detail/metadata_access_builder.hpp>
/** \struct boost::bimaps::support::value_type_by
\brief Metafunction to obtain the value type of a bimap indexed by one of the
sides.
The tag parameter can be either a user defined tag or \c member_at::{side}.
The returned type is signature-compatible with std::pair.
\code
template< class Tag, class Bimap >
struct value_type_by
{
typedef typename Bimap::{side}_value_type type;
};
\endcode
See also member_at.
\ingroup bimap_group
**/
namespace boost {
namespace bimaps {
namespace support {
// Implementation of value type by metafunction
BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
(
value_type_by,
left_value_type,
right_value_type
);
} // namespace support
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_HPP
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs