diff --git a/ndnboost/test/utils/algorithm.hpp b/ndnboost/test/utils/algorithm.hpp
new file mode 100644
index 0000000..8003dfe
--- /dev/null
+++ b/ndnboost/test/utils/algorithm.hpp
@@ -0,0 +1,228 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : addition to STL algorithms
+// ***************************************************************************
+
+#ifndef BOOST_ALGORITHM_HPP_062304GER
+#define BOOST_ALGORITHM_HPP_062304GER
+
+#include <utility>
+#include <algorithm> // std::find
+#include <functional> // std::bind1st
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+/// @brief this algorithm search through two collections for first mismatch position that get returned as a pair
+/// of iterators, first pointing to the mismatch position in first collection, second iterator in second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template <class InputIter1, class InputIter2>
+inline std::pair<InputIter1, InputIter2>
+mismatch( InputIter1 first1, InputIter1 last1,
+          InputIter2 first2, InputIter2 last2 )
+{
+    while( first1 != last1 && first2 != last2 && *first1 == *first2 ) {
+        ++first1;
+        ++first2;
+    }
+
+    return std::pair<InputIter1, InputIter2>(first1, first2);
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through two collections for first mismatch position that get returned as a pair
+/// of iterators, first pointing to the mismatch position in first collection, second iterator in second one. This algorithms
+/// uses supplied predicate for collection elements comparison
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template <class InputIter1, class InputIter2, class Predicate>
+inline std::pair<InputIter1, InputIter2>
+mismatch( InputIter1 first1, InputIter1 last1,
+          InputIter2 first2, InputIter2 last2,
+          Predicate pred )
+{
+    while( first1 != last1 && first2 != last2 && pred( *first1, *first2 ) ) {
+        ++first1;
+        ++first2;
+    }
+
+    return std::pair<InputIter1, InputIter2>(first1, first2);
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for first element that does not belong a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class ForwardIterator1, class ForwardIterator2>
+inline ForwardIterator1
+find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1, 
+                   ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+    while( first1 != last1 ) {
+        if( std::find( first2, last2, *first1 ) == last2 )
+            break;
+        ++first1;
+    }
+
+    return first1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for first element that does not satisfy binary 
+/// predicate in conjunction will any element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class ForwardIterator1, class ForwardIterator2, class Predicate>
+inline ForwardIterator1
+find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1, 
+                   ForwardIterator2 first2, ForwardIterator2 last2, 
+                   Predicate pred )
+{
+    while( first1 != last1 ) {
+        if( std::find_if( first2, last2, std::bind1st( pred, *first1 ) ) == last2 )
+            break;
+        ++first1;
+    }
+
+    return first1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that belongs to a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class BidirectionalIterator1, class ForwardIterator2>
+inline BidirectionalIterator1
+find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1, 
+              ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+    if( first1 == last1 || first2 == last2 )
+        return last1;
+
+    BidirectionalIterator1 it1 = last1;
+    while( --it1 != first1 && std::find( first2, last2, *it1 ) == last2 ) {}
+
+    return it1 == first1 && std::find( first2, last2, *it1 ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that satisfy binary 
+/// predicate in conjunction will at least one element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class BidirectionalIterator1, class ForwardIterator2, class Predicate>
+inline BidirectionalIterator1
+find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1, 
+              ForwardIterator2 first2, ForwardIterator2 last2, 
+              Predicate pred )
+{
+    if( first1 == last1 || first2 == last2 )
+        return last1;
+
+    BidirectionalIterator1 it1 = last1;
+    while( --it1 != first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ) {}
+
+    return it1 == first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that does not belong to a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class BidirectionalIterator1, class ForwardIterator2>
+inline BidirectionalIterator1
+find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1, 
+                  ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+    if( first1 == last1 || first2 == last2 )
+        return last1;
+
+    BidirectionalIterator1 it1 = last1;
+    while( --it1 != first1 && std::find( first2, last2, *it1 ) != last2 ) {}
+
+    return it1 == first1 && std::find( first2, last2, *it1 ) != last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that does not satisfy binary 
+/// predicate in conjunction will any element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class BidirectionalIterator1, class ForwardIterator2, class Predicate>
+inline BidirectionalIterator1
+find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1, 
+                  ForwardIterator2 first2, ForwardIterator2 last2, 
+                  Predicate pred )
+{
+    if( first1 == last1 || first2 == last2 )
+        return last1;
+
+    BidirectionalIterator1 it1 = last1;
+    while( --it1 != first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) != last2 ) {}
+
+    return it1 == first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_ALGORITHM_HPP_062304GER
+
+
diff --git a/ndnboost/test/utils/assign_op.hpp b/ndnboost/test/utils/assign_op.hpp
new file mode 100644
index 0000000..b3d7ca0
--- /dev/null
+++ b/ndnboost/test/utils/assign_op.hpp
@@ -0,0 +1,41 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : overloadable assignment
+// ***************************************************************************
+
+#ifndef BOOST_TEST_ASSIGN_OP_033005GER
+#define BOOST_TEST_ASSIGN_OP_033005GER
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************             generic assign operator          ************** //
+// ************************************************************************** //
+
+// generic
+template<typename T,typename S>
+inline void
+assign_op( T& t, S const& s, long )
+{
+    t = s;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#endif // BOOST_TEST_ASSIGN_OP_033005GER
+
diff --git a/ndnboost/test/utils/basic_cstring/basic_cstring.hpp b/ndnboost/test/utils/basic_cstring/basic_cstring.hpp
new file mode 100644
index 0000000..b3982df
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/basic_cstring.hpp
@@ -0,0 +1,731 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : class basic_cstring wraps C string and provide std_string like 
+//                interface
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp>
+#include <ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp>
+
+// STL
+#include <string>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************                basic_cstring                 ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class basic_cstring {
+    typedef basic_cstring<CharT>                        self_type;
+public:
+    // Subtypes
+    typedef ut_detail::bcs_char_traits<CharT>           traits_type;
+    typedef typename ut_detail::bcs_char_traits<CharT>::std_string  std_string;
+
+    typedef CharT                                       value_type;
+    typedef value_type*                                 pointer;
+    typedef value_type const*                           const_pointer;
+    typedef value_type&                                 reference;
+    typedef const value_type&                           const_reference;
+    typedef std::size_t                                 size_type;
+    typedef std::ptrdiff_t                              difference_type;
+
+    typedef value_type const*                           const_iterator;
+    typedef value_type*                                 iterator;
+
+    // !! should also present reverse_iterator, const_reverse_iterator
+
+#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+    enum npos_type { npos = static_cast<size_type>(-1) };
+#else
+    // IBM/VisualAge version 6 is not able to handle enums larger than 4 bytes.
+    // But size_type is 8 bytes in 64bit mode.
+    static const size_type npos = -1 ;
+#endif
+
+    static pointer  null_str();
+
+    // Constructors; default copy constructor is generated by compiler
+    basic_cstring();
+    basic_cstring( std_string const& s );
+    basic_cstring( pointer s );
+    basic_cstring( pointer s, size_type arg_size );
+    basic_cstring( pointer first, pointer last );
+
+    // data access methods
+    value_type      operator[]( size_type index ) const;
+    value_type      at( size_type index ) const;
+
+    // size operators
+    size_type       size() const;
+    bool            is_empty() const;
+    void            clear();
+    void            resize( size_type new_len );
+
+    // !! only for STL container conformance use is_empty instead
+    bool            empty() const; 
+
+    // Trimming
+    self_type&      trim_right( size_type trim_size );
+    self_type&      trim_left( size_type trim_size );
+    self_type&      trim_right( iterator it );
+    self_type&      trim_left( iterator it );
+#ifndef __IBMCPP__
+    self_type&      trim_left( self_type exclusions = self_type() ) ;
+    self_type&      trim_right( self_type exclusions = self_type() ) ;
+    self_type&      trim( self_type exclusions = self_type() ) ;
+#else
+    // VisualAge version 6 has in this case a problem with the default arguments.
+    self_type&      trim_left( self_type exclusions ) ;
+    self_type&      trim_right( self_type exclusions ) ;
+    self_type&      trim( self_type exclusions ) ;
+    self_type&      trim_left() { trim_left( self_type() ) ; }
+    self_type&      trim_right() { trim_right( self_type() ) ; }
+    self_type&      trim() { trim( self_type() ) ; }
+#endif
+
+    // Assignment operators
+    basic_cstring&  operator=( self_type const& s );
+    basic_cstring&  operator=( std_string const& s );
+    basic_cstring&  operator=( pointer s );
+
+    template<typename CharT2>
+    basic_cstring&  assign( basic_cstring<CharT2> const& s ) { *this = basic_cstring<CharT>( s.begin(), s.end() ); return *this; }
+    basic_cstring&  assign( self_type const& s, size_type pos, size_type len );
+    basic_cstring&  assign( std_string const& s );
+    basic_cstring&  assign( std_string const& s, size_type pos, size_type len );
+    basic_cstring&  assign( pointer s );
+    basic_cstring&  assign( pointer s, size_type len );
+    basic_cstring&  assign( pointer f, pointer l );
+
+    // swapping
+    void            swap( self_type& s );
+
+    // Iterators
+    iterator        begin();
+    const_iterator  begin() const;
+    iterator        end();
+    const_iterator  end() const;
+
+    // !! should have rbegin, rend
+
+    // substring search operation
+    size_type       find( basic_cstring ) const;
+    size_type       rfind( basic_cstring ) const;
+    self_type       substr( size_type beg_index, size_type end_index = npos ) const;
+
+private:
+    static self_type default_trim_ex();
+
+    // Data members
+    iterator        m_begin;
+    iterator        m_end;
+};
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::pointer
+basic_cstring<CharT>::null_str()
+{
+    static CharT null = 0;
+    return &null;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring()
+: m_begin( null_str() )
+, m_end( m_begin )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( std_string const& s )
+: m_begin( s.c_str() )
+, m_end( m_begin + s.size() )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer s )
+: m_begin( s ? s : null_str() )
+, m_end  ( m_begin + (s ? traits_type::length( s ) : 0 ) )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer s, size_type arg_size )
+: m_begin( s ), m_end( m_begin + arg_size )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer first, pointer last )
+: m_begin( first )
+, m_end( last )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+basic_cstring<CharT>::operator[]( size_type index ) const
+{
+    return m_begin[index];
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+basic_cstring<CharT>::at( size_type index ) const
+{
+    if( m_begin + index >= m_end )
+        return static_cast<value_type>(0);
+
+    return m_begin[index];
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::size() const
+{
+    return m_end - m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+basic_cstring<CharT>::is_empty() const
+{
+    return m_end == m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+basic_cstring<CharT>::empty() const
+{
+    return is_empty();
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::clear()
+{
+    m_begin = m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::resize( size_type new_len )
+{
+    if( m_begin + new_len < m_end )
+        m_end = m_begin + new_len;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( size_type trim_size )
+{
+    m_begin += trim_size;
+    if( m_end <= m_begin )
+        clear();
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( iterator it )
+{
+    m_begin = it;
+    if( m_end <= m_begin )
+        clear();
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( basic_cstring exclusions )
+{
+    if( exclusions.is_empty() )
+        exclusions = default_trim_ex();
+
+    iterator it;
+    for( it = begin(); it != end(); ++it ) {
+        if( traits_type::find( exclusions.begin(), exclusions.size(), *it ) == reinterpret_cast<pointer>(0) )
+            break;
+    }
+    
+    return trim_left( it );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( size_type trim_size )
+{
+    m_end  -= trim_size;
+    if( m_end <= m_begin )
+        clear();
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( iterator it )
+{
+    m_end = it;
+    if( m_end <= m_begin )
+        clear();
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( basic_cstring exclusions )
+{
+    if( exclusions.is_empty() )
+        exclusions = default_trim_ex();
+
+    iterator it;
+
+    for( it = end()-1; it != begin()-1; --it ) {
+        if( self_type::traits_type::find( exclusions.begin(),  exclusions.size(), *it ) == reinterpret_cast<pointer>(0) )
+            break;
+    }
+    
+    return trim_right( it+1 );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim( basic_cstring exclusions )
+{
+    trim_left( exclusions );
+    trim_right( exclusions );
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( basic_cstring<CharT> const& s )
+{
+    m_begin = s.m_begin;
+    m_end   = s.m_end;
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( std_string const& s )
+{
+    return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( pointer s )
+{
+    return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( basic_cstring<CharT> const& s, size_type pos, size_type len )
+{
+    return *this = self_type( s.m_begin + pos, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( std_string const& s )
+{
+    return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( std_string const& s, size_type pos, size_type len )
+{
+    return *this = self_type( s.c_str() + pos, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer s )
+{
+    return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer s, size_type len )
+{
+    return *this = self_type( s, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer f, pointer l )
+{
+    return *this = self_type( f, l );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::swap( basic_cstring<CharT>& s )
+{
+    // do not want to include alogrithm
+    pointer tmp1    = m_begin;
+    pointer tmp2    = m_end;
+
+    m_begin         = s.m_begin;
+    m_end           = s.m_end;
+
+    s.m_begin       = tmp1;
+    s.m_end         = tmp2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::iterator
+basic_cstring<CharT>::begin()
+{
+    return m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::const_iterator
+basic_cstring<CharT>::begin() const
+{
+    return m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::iterator
+basic_cstring<CharT>::end()
+{
+    return m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::const_iterator
+basic_cstring<CharT>::end() const
+{
+    return m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::find( basic_cstring<CharT> str ) const
+{
+    if( str.is_empty() || str.size() > size() )
+        return static_cast<size_type>(npos);
+
+    const_iterator it   = begin();
+    const_iterator last = end() - str.size() + 1;
+
+    while( it != last ) {
+        if( traits_type::compare( it, str.begin(), str.size() ) == 0 )
+            break;
+
+        ++it;
+    }
+
+    return it == last ? static_cast<size_type>(npos) : it - begin();
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::rfind( basic_cstring<CharT> str ) const
+{
+    if( str.is_empty() || str.size() > size() )
+        return static_cast<size_type>(npos);
+
+    const_iterator it   = end() - str.size();
+    const_iterator last = begin()-1;
+
+    while( it != last ) {
+        if( traits_type::compare( it, str.begin(), str.size() ) == 0 )
+            break;
+
+        --it;
+    }
+
+    return it == last ? static_cast<size_type>(npos) : static_cast<size_type>(it - begin());
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>
+basic_cstring<CharT>::substr( size_type beg_index, size_type end_index ) const
+{
+    return beg_index > size()
+            ?       self_type()
+            : end_index > size()
+                ?   self_type( m_begin + beg_index, m_end )
+                :   self_type( m_begin + beg_index, m_begin + end_index );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>
+basic_cstring<CharT>::default_trim_ex()
+{
+    static CharT ws[3] = { CharT(' '), CharT('\t'), CharT('\n') }; // !! wide case
+
+    return self_type( ws, 3 );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************             comparison operators             ************** //
+// ************************************************************************** //
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( basic_cstring<CharT1> const& s1, basic_cstring<CharT2> const& s2 )
+{
+    typedef typename basic_cstring<CharT1>::traits_type traits_type;
+    return s1.size() == s2.size() && 
+               traits_type::compare( s1.begin(), s2.begin(), s1.size() ) == 0;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( basic_cstring<CharT1> const& s1, CharT2* s2 )
+{
+#if !defined(__DMC__)
+    return s1 == basic_cstring<CharT2>( s2 );
+#else
+    return s1 == basic_cstring<CharT2 const>( s2 );
+#endif
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator==( basic_cstring<CharT> const& s1, typename basic_cstring<CharT>::std_string const& s2 )
+{
+    return s1 == basic_cstring<CharT>( s2 );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( CharT1* s2, basic_cstring<CharT2> const& s1 )
+{
+    return s1 == s2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator==( typename basic_cstring<CharT>::std_string const& s2, basic_cstring<CharT> const& s1 )
+{
+    return s1 == s2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, CharT* s2 )
+{
+    return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( CharT* s2, basic_cstring<CharT> const& s1 )
+{
+    return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, basic_cstring<CharT> const& s2 )
+{
+    return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, typename basic_cstring<CharT>::std_string const& s2 )
+{
+    return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( typename basic_cstring<CharT>::std_string const& s2, basic_cstring<CharT> const& s1 )
+{
+    return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  first_char                  ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+first_char( basic_cstring<CharT> source )
+{
+    typedef typename basic_cstring<CharT>::value_type string_value_type;
+
+    return source.is_empty() ? static_cast<string_value_type>(0) : *source.begin();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  last_char                   ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+last_char( basic_cstring<CharT> source )
+{
+    typedef typename basic_cstring<CharT>::value_type string_value_type;
+
+    return source.is_empty() ? static_cast<string_value_type>(0) : *(source.end()-1);
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  assign_op                   ************** //
+// ************************************************************************** //
+
+template<typename CharT1, typename CharT2>
+inline void
+assign_op( std::basic_string<CharT1>& target, basic_cstring<CharT2> src, int )
+{
+    target.assign( src.begin(), src.size() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp b/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp
new file mode 100644
index 0000000..14cb33b
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp
@@ -0,0 +1,40 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : basic_cstring class wrap C string and provide std_string like 
+//                interface
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+
+#include <ndnboost/detail/workaround.hpp>
+
+namespace ndnboost {
+
+namespace unit_test {
+
+template<typename CharT> class      basic_cstring;
+typedef basic_cstring<char const>   const_string;
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590041))
+typedef const_string                literal_string;
+#else
+typedef const_string const          literal_string;
+#endif
+
+typedef char const* const           c_literal_string;
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#endif // BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+
diff --git a/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp b/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp
new file mode 100644
index 0000000..d6571f7
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp
@@ -0,0 +1,150 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : generic char traits class; wraps std::char_traits
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
+#define BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/type_traits/add_const.hpp>
+
+// STL
+#include <string>                       // std::char_traits
+#include <cstddef>                      // std::size_t
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace ut_detail {
+
+template<typename CharT> struct bcs_base_char           { typedef CharT type; };
+
+template<> struct bcs_base_char<char const>             { typedef char type; };
+template<> struct bcs_base_char<unsigned char>          { typedef char type; };
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<> struct bcs_base_char<unsigned char const>    { typedef char type; };
+#endif
+
+template<> struct bcs_base_char<wchar_t const>          { typedef wchar_t type; };
+
+// ************************************************************************** //
+// **************               bcs_char_traits                ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+struct bcs_char_traits_impl
+{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+    typedef CharT const const_char;
+#else
+    typedef typename ndnboost::add_const<CharT>::type const_char;
+#endif
+    static bool eq( CharT c1, CharT c2 )
+    {
+        return c1 == c2;
+    }
+    static bool lt( CharT c1, CharT c2 )
+    {
+        return c1 < c2;
+    }
+
+    static int compare( const_char* cstr1, const_char* cstr2, std::size_t n )
+    {
+        while( n > 0 ) {
+            if( !eq( *cstr1, *cstr2 ) )
+                return lt( *cstr1, *cstr2 ) ? -1 : 1;
+            ++cstr1;
+            ++cstr2;
+            --n;
+        }
+
+        return 0;
+    }
+
+    static std::size_t length( const_char* cstr )
+    {
+        const_char null_char = CharT();
+
+        const_char* ptr = cstr;
+        while( !eq( *ptr, null_char ) )
+            ++ptr;
+
+        return ptr - cstr;
+    }
+
+    static const_char* find( const_char* s, std::size_t n, CharT c )
+    {
+        while( n > 0 ) {
+            if( eq( *s, c ) )
+                return s;
+
+            ++s;
+            --n;
+        }
+        return 0;
+    }
+};
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+template<typename CharT>
+struct char_traits_with_find : std::string_char_traits<CharT> {
+    static CharT const* find( CharT const* s, std::size_t n, CharT c )
+    {
+        while( n > 0 ) {
+            if( eq( *s, c ) )
+                return s;
+
+            ++s;
+            --n;
+        }
+        return 0;
+    }
+};
+
+template<> struct bcs_char_traits_impl<char> : char_traits_with_find<char> {};
+template<> struct bcs_char_traits_impl<wchar_t> : char_traits_with_find<wchar_t> {};
+#else
+template<> struct bcs_char_traits_impl<char> : std::char_traits<char> {};
+template<> struct bcs_char_traits_impl<wchar_t> : std::char_traits<wchar_t> {};
+#endif
+
+template<typename CharT>
+class bcs_char_traits : public bcs_char_traits_impl<CharT> {
+    typedef typename ut_detail::bcs_base_char<CharT>::type                              the_base_char;
+public:
+#ifdef BOOST_CLASSIC_IOSTREAMS
+    typedef std::basic_string<the_base_char, std::string_char_traits<the_base_char> >   std_string;
+#else
+    typedef std::basic_string<the_base_char, std::char_traits<the_base_char> >          std_string;
+#endif
+};
+
+} // namespace ut_detail
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/compare.hpp b/ndnboost/test/utils/basic_cstring/compare.hpp
new file mode 100644
index 0000000..db9c854
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/compare.hpp
@@ -0,0 +1,115 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : class basic_cstring comparisons implementation
+// ***************************************************************************
+
+#ifndef  BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
+#define  BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// STL
+#include <functional>
+#include <cctype>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+# if defined(BOOST_NO_STDC_NAMESPACE) && !BOOST_WORKAROUND(__BORLANDC__, <= 0x570)
+namespace std { using ::toupper; }
+# endif
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************                case_ins_compare              ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<class CharT>
+struct case_ins
+{
+    static bool         eq( CharT c1, CharT c2 ) { return (std::toupper)( c1 ) == (std::toupper)( c2 ); }
+    static bool         lt( CharT c1, CharT c2 ) { return (std::toupper)( c1 ) <  (std::toupper)( c2 ); }
+
+    static int          compare( CharT const* s1, CharT const* s2, std::size_t n )
+    {
+        for( std::size_t i = 0; i < n; ++i ) {
+            if( !eq( s1[i], s2[i] ) )
+                return lt( s1[i], s2[i] ) ? -1 : 1;
+        }
+        return 0;
+    }
+};
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// **************                  case_ins_eq                 ************** //
+// ************************************************************************** //
+
+template<class CharT>
+inline bool
+case_ins_eq( basic_cstring<CharT> x, basic_cstring<CharT> y )
+{
+    return x.size() == y.size() && ut_detail::case_ins<CharT>::compare( x.begin(), y.begin(), x.size() ) == 0;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                 case_ins_less                ************** //
+// ************************************************************************** //
+
+template<class CharT>
+class case_ins_less : public std::binary_function<basic_cstring<CharT>,basic_cstring<CharT>,bool>
+{
+public:
+    bool operator()( basic_cstring<CharT> x, basic_cstring<CharT> y ) const
+    {
+        return x.size() != y.size() 
+                ? x.size() < y.size() 
+                : ut_detail::case_ins<CharT>::compare( x.begin(), y.begin(), x.size() ) < 0;
+    }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  operator <                  ************** //
+// ************************************************************************** //
+
+template<class CharT>
+inline bool
+operator <( ndnboost::unit_test::basic_cstring<CharT> const& x,
+            ndnboost::unit_test::basic_cstring<CharT> const& y )
+{
+    typedef typename ndnboost::unit_test::basic_cstring<CharT>::traits_type traits_type;
+    return x.size() != y.size() 
+            ? x.size() < y.size() 
+            : traits_type::compare( x.begin(), y.begin(), x.size() ) < 0;
+}
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/io.hpp b/ndnboost/test/utils/basic_cstring/io.hpp
new file mode 100644
index 0000000..adb6d1e
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/io.hpp
@@ -0,0 +1,73 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : basic_cstring i/o implementation
+// ***************************************************************************
+
+#ifndef  BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
+#define  BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// STL
+#include <iosfwd>
+#include <string>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+
+template<typename CharT>
+inline std::ostream&
+operator<<( std::ostream& os, basic_cstring<CharT> const& str )
+{
+    typedef typename ut_detail::bcs_base_char<CharT>::type char_type;
+    char_type const* const beg = reinterpret_cast<char_type const* const>( str.begin() );
+    char_type const* const end = reinterpret_cast<char_type const* const>( str.end() );
+    os << std::basic_string<char_type>( beg, end - beg );
+
+    return os;
+}
+
+#else
+
+template<typename CharT1, typename Tr,typename CharT2>
+inline std::basic_ostream<CharT1,Tr>&
+operator<<( std::basic_ostream<CharT1,Tr>& os, basic_cstring<CharT2> const& str )
+{
+    CharT1 const* const beg = reinterpret_cast<CharT1 const*>( str.begin() ); // !!
+    CharT1 const* const end = reinterpret_cast<CharT1 const*>( str.end() );
+    os << std::basic_string<CharT1,Tr>( beg, end - beg );
+
+    return os;
+}
+
+#endif
+
+//____________________________________________________________________________//
+
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
diff --git a/ndnboost/test/utils/callback.hpp b/ndnboost/test/utils/callback.hpp
new file mode 100644
index 0000000..91e23f3
--- /dev/null
+++ b/ndnboost/test/utils/callback.hpp
@@ -0,0 +1,310 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : 
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CALLBACK_020505GER
+#define BOOST_TEST_CALLBACK_020505GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/shared_ptr.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(BOOST_INTEL, <= 700)
+#  define BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+#endif
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace ut_detail {
+
+struct unused {};
+
+template<typename R>
+struct invoker {
+    template<typename Functor>
+    R       invoke( Functor& f )                        { return f(); }
+    template<typename Functor, typename T1>
+    R       invoke( Functor& f, T1 t1 )                 { return f( t1 ); }
+    template<typename Functor, typename T1, typename T2>
+    R       invoke( Functor& f, T1 t1, T2 t2 )          { return f( t1, t2 ); }
+    template<typename Functor, typename T1, typename T2, typename T3>
+    R       invoke( Functor& f, T1 t1, T2 t2, T3 t3 )   { return f( t1, t2, t3 ); }
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct invoker<unused> {
+    template<typename Functor>
+    unused  invoke( Functor& f )                        { f(); return unused(); }
+    template<typename Functor, typename T1>
+    unused  invoke( Functor& f, T1 t1 )                 { f( t1 ); return unused(); }
+    template<typename Functor, typename T1, typename T2>
+    unused  invoke( Functor& f, T1 t1, T2 t2 )          { f( t1, t2 ); return unused(); }
+    template<typename Functor, typename T1, typename T2, typename T3>
+    unused  invoke( Functor& f, T1 t1, T2 t2, T3 t3 )   { f( t1, t2, t3 ); return unused(); }
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// **************             unit_test::callback0             ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R>
+struct callback0_impl {
+    virtual ~callback0_impl() {}
+
+    virtual R invoke() = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename Functor>
+struct callback0_impl_t : callback0_impl<R> {
+    // Constructor
+    explicit callback0_impl_t( Functor f ) : m_f( f ) {}
+
+    virtual R invoke() { return invoker<R>().invoke( m_f ); }
+
+private:
+    // Data members
+    Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename R = ut_detail::unused>
+class callback0 {
+public:
+    // Constructors
+    callback0() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+    callback0( callback0 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+    template<typename Functor>
+    callback0( Functor f )
+    : m_impl( new ut_detail::callback0_impl_t<R,Functor>( f ) ) {}
+    
+    void        operator=( callback0 const& rhs ) { m_impl = rhs.m_impl; }
+
+    template<typename Functor>
+    void        operator=( Functor f ) { m_impl.reset( new ut_detail::callback0_impl_t<R,Functor>( f ) );  }
+
+    R           operator()() const { return m_impl->invoke(); }
+
+    bool        operator!() const { return !m_impl; }
+
+private:
+    // Data members
+    ndnboost::shared_ptr<ut_detail::callback0_impl<R> > m_impl;
+};
+
+// ************************************************************************** //
+// **************             unit_test::callback1             ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1>
+struct callback1_impl {
+    virtual ~callback1_impl() {}
+
+    virtual R invoke( T1 t1 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1,typename Functor>
+struct callback1_impl_t : callback1_impl<R,T1> {
+    // Constructor
+    explicit callback1_impl_t( Functor f ) : m_f( f ) {}
+
+    virtual R invoke( T1 t1 ) { return invoker<R>().invoke( m_f, t1 ); }
+
+private:
+    // Data members
+    Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename R = ut_detail::unused>
+class callback1 {
+public:
+    // Constructors
+    callback1() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+    callback1( callback1 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+    template<typename Functor>
+    callback1( Functor f )
+    : m_impl( new ut_detail::callback1_impl_t<R,T1,Functor>( f ) ) {}
+
+    void        operator=( callback1 const& rhs ) { m_impl = rhs.m_impl; }
+
+    template<typename Functor>
+    void        operator=( Functor f ) { m_impl.reset( new ut_detail::callback1_impl_t<R,T1,Functor>( f ) );  }
+
+    R           operator()( T1 t1 ) const { return m_impl->invoke( t1 ); }
+
+    bool        operator!() const { return !m_impl; }
+
+private:
+    // Data members
+    ndnboost::shared_ptr<ut_detail::callback1_impl<R,T1> > m_impl;
+};
+
+// ************************************************************************** //
+// **************             unit_test::callback2             ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1,typename T2>
+struct callback2_impl {
+    virtual ~callback2_impl() {}
+
+    virtual R invoke( T1 t1, T2 t2 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1, typename T2, typename Functor>
+struct callback2_impl_t : callback2_impl<R,T1,T2> {
+    // Constructor
+    explicit callback2_impl_t( Functor f ) : m_f( f ) {}
+
+    virtual R invoke( T1 t1, T2 t2 ) { return invoker<R>().template invoke<Functor,T1,T2>( m_f, t1, t2 ); }
+
+private:
+    // Data members
+    Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename T2, typename R = ut_detail::unused>
+class callback2 {
+public:
+    // Constructors
+    callback2() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+    callback2( callback2 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+    template<typename Functor>
+                callback2( Functor f ) : m_impl( new ut_detail::callback2_impl_t<R,T1,T2,Functor>( f ) ) {}
+
+    void        operator=( callback2 const& rhs ) { m_impl = rhs.m_impl; }
+
+    template<typename Functor>
+    void        operator=( Functor f ) { m_impl.reset( new ut_detail::callback2_impl_t<R,T1,T2,Functor>( f ) );  }
+
+    R           operator()( T1 t1, T2 t2 ) const { return m_impl->invoke( t1, t2 ); }
+
+    bool        operator!() const { return !m_impl; }
+
+private:
+    // Data members
+    ndnboost::shared_ptr<ut_detail::callback2_impl<R,T1,T2> > m_impl;
+};
+
+// ************************************************************************** //
+// **************             unit_test::callback3             ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1, typename T2, typename T3>
+struct callback3_impl {
+    virtual ~callback3_impl() {}
+
+    virtual R invoke( T1 t1, T2 t2, T3 t3 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1, typename T2, typename T3, typename Functor>
+struct callback3_impl_t : callback3_impl<R,T1,T2,T3> {
+    // Constructor
+    explicit callback3_impl_t( Functor f ) : m_f( f ) {}
+
+    virtual R invoke( T1 t1, T2 t2, T3 t3 ) { return invoker<R>().invoke( m_f, t1, t2, t3 ); }
+
+private:
+    // Data members
+    Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename T2, typename T3, typename R = ut_detail::unused>
+class callback3 {
+public:
+    // Constructors
+    callback3() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+    callback3( callback3 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+    template<typename Functor>
+    callback3( Functor f )
+    : m_impl( new ut_detail::callback3_impl_t<R,T1,T2,T3,Functor>( f ) ) {}
+
+    void        operator=( callback3 const& rhs ) { m_impl = rhs.m_impl; }
+
+    template<typename Functor>
+    void        operator=( Functor f ) { m_impl.reset( new ut_detail::callback3_impl_t<R,T1,T2,T3,Functor>( f ) );  }
+
+    R           operator()( T1 t1, T2 t2, T3 t3 ) const { return m_impl->invoke( t1, t2, t3 ); }
+
+    bool        operator!() const { return !m_impl; }
+
+private:
+    // Data members
+    ndnboost::shared_ptr<ut_detail::callback3_impl<R,T1,T2,T3> > m_impl;
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#undef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_CALLBACK_020505GER
diff --git a/ndnboost/test/utils/class_properties.hpp b/ndnboost/test/utils/class_properties.hpp
new file mode 100644
index 0000000..8da1f45
--- /dev/null
+++ b/ndnboost/test/utils/class_properties.hpp
@@ -0,0 +1,221 @@
+//  (C) Copyright Gennadiy Rozental 2001-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : simple facility that mimmic notion of read-only read-write 
+//  properties in C++ classes. Original idea by Henrik Ravn.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
+#define BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// Boost
+#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+#include <ndnboost/preprocessor/seq/for_each.hpp>
+#endif
+#include <ndnboost/call_traits.hpp>
+#include <ndnboost/type_traits/add_pointer.hpp>
+#include <ndnboost/type_traits/add_const.hpp>
+#include <ndnboost/utility/addressof.hpp>
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************                 class_property               ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class class_property {
+protected:
+    typedef typename call_traits<PropertyType>::const_reference     read_access_t;
+    typedef typename call_traits<PropertyType>::param_type          write_param_t;
+    typedef typename add_pointer<typename add_const<PropertyType>::type>::type address_res_t;
+public:
+    // Constructor
+                    class_property() : value( PropertyType() ) {}
+    explicit        class_property( write_param_t init_value )
+    : value( init_value ) {}
+
+    // Access methods
+    operator        read_access_t() const   { return value; }
+    read_access_t   get() const             { return value; }
+    bool            operator!() const       { return !value; }
+    address_res_t   operator&() const       { return &value; }
+
+    // Data members
+#ifndef BOOST_TEST_NO_PROTECTED_USING
+protected:
+#endif
+    PropertyType        value;
+};
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+
+template<class PropertyType>
+inline std::ostream&
+operator<<( std::ostream& os, class_property<PropertyType> const& p )
+
+#else
+
+template<typename CharT1, typename Tr,class PropertyType>
+inline std::basic_ostream<CharT1,Tr>&
+operator<<( std::basic_ostream<CharT1,Tr>& os, class_property<PropertyType> const& p )
+
+#endif
+{
+    return os << p.get();
+}
+
+//____________________________________________________________________________//
+
+#define DEFINE_PROPERTY_FREE_BINARY_OPERATOR( op )                              \
+template<class PropertyType>                                                    \
+inline bool                                                                     \
+operator op( PropertyType const& lhs, class_property<PropertyType> const& rhs ) \
+{                                                                               \
+    return lhs op rhs.get();                                                    \
+}                                                                               \
+template<class PropertyType>                                                    \
+inline bool                                                                     \
+operator op( class_property<PropertyType> const& lhs, PropertyType const& rhs ) \
+{                                                                               \
+    return lhs.get() op rhs;                                                    \
+}                                                                               \
+template<class PropertyType>                                                    \
+inline bool                                                                     \
+operator op( class_property<PropertyType> const& lhs,                           \
+             class_property<PropertyType> const& rhs )                          \
+{                                                                               \
+    return lhs.get() op rhs.get();                                              \
+}                                                                               \
+/**/
+
+DEFINE_PROPERTY_FREE_BINARY_OPERATOR( == )
+DEFINE_PROPERTY_FREE_BINARY_OPERATOR( != )
+
+#undef DEFINE_PROPERTY_FREE_BINARY_OPERATOR
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+
+#define DEFINE_PROPERTY_LOGICAL_OPERATOR( op )                                  \
+template<class PropertyType>                                                    \
+inline bool                                                                     \
+operator op( bool b, class_property<PropertyType> const& p )                    \
+{                                                                               \
+    return b op p.get();                                                        \
+}                                                                               \
+template<class PropertyType>                                                    \
+inline bool                                                                     \
+operator op( class_property<PropertyType> const& p, bool b )                    \
+{                                                                               \
+    return b op p.get();                                                        \
+}                                                                               \
+/**/
+
+DEFINE_PROPERTY_LOGICAL_OPERATOR( && )
+DEFINE_PROPERTY_LOGICAL_OPERATOR( || )
+
+#endif
+
+// ************************************************************************** //
+// **************               readonly_property              ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class readonly_property : public class_property<PropertyType> {
+    typedef class_property<PropertyType>         base_prop;
+    typedef typename base_prop::address_res_t    arrow_res_t;
+protected:
+    typedef typename base_prop::write_param_t    write_param_t;
+public:
+    // Constructor
+                    readonly_property() {}
+    explicit        readonly_property( write_param_t init_value ) : base_prop( init_value ) {}
+
+    // access methods
+    arrow_res_t     operator->() const      { return ndnboost::addressof( base_prop::value ); }
+};
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+
+#define BOOST_READONLY_PROPERTY( property_type, friends ) ndnboost::unit_test::readwrite_property<property_type >
+
+#else
+
+#define BOOST_READONLY_PROPERTY_DECLARE_FRIEND(r, data, elem) friend class elem;
+
+#define BOOST_READONLY_PROPERTY( property_type, friends )                           \
+class BOOST_JOIN( readonly_property, __LINE__ )                                     \
+: public ndnboost::unit_test::readonly_property<property_type > {                      \
+    typedef ndnboost::unit_test::readonly_property<property_type > base_prop;          \
+    BOOST_PP_SEQ_FOR_EACH( BOOST_READONLY_PROPERTY_DECLARE_FRIEND, ' ', friends )   \
+    typedef base_prop::write_param_t  write_param_t;                                \
+public:                                                                             \
+                BOOST_JOIN( readonly_property, __LINE__ )() {}                      \
+    explicit    BOOST_JOIN( readonly_property, __LINE__ )( write_param_t init_v  )  \
+    : base_prop( init_v ) {}                                                        \
+}                                                                                   \
+/**/
+
+#endif
+
+// ************************************************************************** //
+// **************              readwrite_property              ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class readwrite_property : public class_property<PropertyType> {
+    typedef class_property<PropertyType>                base_prop;
+    typedef typename add_pointer<PropertyType>::type    arrow_res_t;
+    typedef typename base_prop::address_res_t           const_arrow_res_t;
+    typedef typename base_prop::write_param_t           write_param_t;
+public:
+                    readwrite_property() : base_prop() {}
+    explicit        readwrite_property( write_param_t init_value ) : base_prop( init_value ) {}
+
+    // access methods
+    void            set( write_param_t v )  { base_prop::value = v; }
+    arrow_res_t     operator->()            { return ndnboost::addressof( base_prop::value ); }
+    const_arrow_res_t operator->() const    { return ndnboost::addressof( base_prop::value ); }
+
+#ifndef BOOST_TEST_NO_PROTECTED_USING
+    using           base_prop::value;
+#endif
+};
+
+//____________________________________________________________________________//
+
+} // unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#undef BOOST_TEST_NO_PROTECTED_USING
+
+#endif // BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
diff --git a/ndnboost/test/utils/custom_manip.hpp b/ndnboost/test/utils/custom_manip.hpp
new file mode 100644
index 0000000..cf5d76d
--- /dev/null
+++ b/ndnboost/test/utils/custom_manip.hpp
@@ -0,0 +1,63 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : simple helpers for creating cusom output manipulators
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
+#define BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************          custom manipulators helpers         ************** //
+// ************************************************************************** //
+
+template<typename Manip>
+struct custom_printer {
+    explicit custom_printer( std::ostream& ostr ) : m_ostr( &ostr ) {}
+
+    std::ostream& operator*() const { return *m_ostr; }
+
+private:
+    std::ostream* const m_ostr;
+};
+
+//____________________________________________________________________________//
+
+template<typename Uniq> struct custom_manip {};
+
+//____________________________________________________________________________//
+
+template<typename Uniq>
+inline custom_printer<custom_manip<Uniq> >
+operator<<( std::ostream& ostr, custom_manip<Uniq> const& ) { return custom_printer<custom_manip<Uniq> >( ostr ); }
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
diff --git a/ndnboost/test/utils/fixed_mapping.hpp b/ndnboost/test/utils/fixed_mapping.hpp
new file mode 100644
index 0000000..dc08593
--- /dev/null
+++ b/ndnboost/test/utils/fixed_mapping.hpp
@@ -0,0 +1,124 @@
+//  (C) Copyright Gennadiy Rozental 2001-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : fixed sized mapping with specified invalid value
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+#define BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+
+// Boost
+#include <ndnboost/preprocessor/repetition/repeat.hpp>
+#include <ndnboost/preprocessor/arithmetic/add.hpp>
+#include <ndnboost/call_traits.hpp>
+#include <ndnboost/detail/binary_search.hpp>
+
+// STL
+#include <vector>
+#include <functional>
+#include <algorithm>
+#include <utility>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// configurable maximum fixed sized mapping size supported by this header.
+// You can redefine it before inclusion of this file.
+#ifndef MAX_MAP_SIZE
+#define MAX_MAP_SIZE 20
+#endif
+
+#define CONSTR_DECL_MID( z, i, dummy1 ) key_param_type key##i, value_param_type v##i,
+#define CONSTR_BODY_MID( z, i, dummy1 ) add_pair( key##i, v##i );
+
+#define CONSTR_DECL( z, n, dummy1 )                                 \
+    fixed_mapping( BOOST_PP_REPEAT_ ## z( n, CONSTR_DECL_MID, "" )  \
+                         value_param_type invalid_value )           \
+    : m_invalid_value( invalid_value )                              \
+    {                                                               \
+        BOOST_PP_REPEAT_ ## z( n, CONSTR_BODY_MID, "" )             \
+        init();                                                     \
+    }                                                               \
+/**/
+
+#define CONTRUCTORS( n ) BOOST_PP_REPEAT( n, CONSTR_DECL, "" )
+
+template<typename Key, typename Value, typename Compare = std::less<Key> >
+class fixed_mapping
+{
+    typedef std::pair<Key,Value>                            elem_type;
+    typedef std::vector<elem_type>                          map_type;
+    typedef typename std::vector<elem_type>::const_iterator iterator;
+
+    typedef typename call_traits<Key>::param_type           key_param_type;
+    typedef typename call_traits<Value>::param_type         value_param_type;
+    typedef typename call_traits<Value>::const_reference    value_ref_type;
+
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+    struct p1; friend struct p1;
+    struct p2; friend struct p2;
+#endif
+
+    // bind( Compare(), bind(select1st<elem_type>(), _1),  bind(identity<Key>(), _2) )
+    struct p1 : public std::binary_function<elem_type,Key,bool>
+    {
+        bool operator()( elem_type const& x, Key const& y ) const { return Compare()( x.first, y ); }
+    };
+
+    // bind( Compare(), bind(select1st<elem_type>(), _1), bind(select1st<elem_type>(), _2) )
+    struct p2 : public std::binary_function<elem_type,elem_type,bool>
+    {
+        bool operator()( elem_type const& x, elem_type const& y ) const { return Compare()( x.first, y.first ); }
+    };
+
+public:
+    // Constructors
+    CONTRUCTORS( BOOST_PP_ADD( MAX_MAP_SIZE, 1 ) )
+
+    // key -> value access
+    value_ref_type  operator[]( key_param_type key ) const
+    {
+        iterator it = ndnboost::detail::lower_bound( m_map.begin(), m_map.end(), key, p1() );
+
+        return (it == m_map.end() || Compare()( key, it->first ) ) ? m_invalid_value : it->second;
+    }
+
+private:
+    // Implementation
+    void            init()                                                  { std::sort( m_map.begin(), m_map.end(), p2() ); }
+    void            add_pair( key_param_type key, value_param_type value )  { m_map.push_back( elem_type( key, value ) ); }
+
+    // Data members
+    Value           m_invalid_value;
+    map_type        m_map;
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#undef MAX_MAP_SIZE
+#undef CONSTR_DECL_MID
+#undef CONSTR_BODY_MID
+#undef CONSTR_DECL
+#undef CONTRUCTORS
+
+#endif // BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+
diff --git a/ndnboost/test/utils/foreach.hpp b/ndnboost/test/utils/foreach.hpp
new file mode 100644
index 0000000..8404e72
--- /dev/null
+++ b/ndnboost/test/utils/foreach.hpp
@@ -0,0 +1,281 @@
+//  (C) Copyright Eric Niebler 2004-2005
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : this is an abridged version of an excelent BOOST_FOREACH facility
+//  presented by Eric Niebler. I am so fond of it so I can't wait till it 
+//  going to be accepted into Boost. Also I need version with less number of dependencies 
+//  and more portable. This version doesn't support rvalues and will reeveluate it's 
+//  parameters, but should be good enough for my purposes.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FOREACH_HPP_021005GER
+#define BOOST_TEST_FOREACH_HPP_021005GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// Boost
+#include <ndnboost/type.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+
+#include <ndnboost/type_traits/is_const.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace for_each {
+
+// ************************************************************************** //
+// **************                  static_any                  ************** //
+// ************************************************************************** //
+
+struct static_any_base
+{
+    operator bool() const { return false; }
+};
+
+//____________________________________________________________________________//
+
+template<typename Iter>
+struct static_any : static_any_base
+{
+    static_any( Iter const& t ) : m_it( t ) {}
+
+    mutable Iter m_it;
+};
+
+//____________________________________________________________________________//
+
+typedef static_any_base const& static_any_t;
+
+//____________________________________________________________________________//
+
+template<typename Iter>
+inline Iter&
+static_any_cast( static_any_t a, Iter* = 0 )
+{
+    return static_cast<Iter&>( static_cast<static_any<Iter> const&>( a ).m_it );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                   is_const                   ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline is_const<C>
+is_const_coll( C& )
+{
+    return is_const<C>();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                     begin                    ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
+begin( C& t, mpl::false_ )
+{
+    return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.begin() );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
+begin( C const& t, mpl::true_ )
+{
+    return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.begin() );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                      end                     ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
+end( C& t, mpl::false_ )
+{
+    return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.end() );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
+end( C const& t, mpl::true_ )
+{
+    return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.end() );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                      done                    ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline bool
+done( static_any_t cur, static_any_t end, C&, mpl::false_ )
+{
+    return  static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur ) ==
+            static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( end );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline bool
+done( static_any_t cur, static_any_t end, C const&, mpl::true_ )
+{
+    return  static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur ) ==
+            static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( end );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                      next                    ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline void
+next( static_any_t cur, C&, mpl::false_ )
+{
+    ++static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline void
+next( static_any_t cur, C const&, mpl::true_ )
+{
+    ++static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                      deref                   ************** //
+// ************************************************************************** //
+
+template<class RefType,typename C>
+inline RefType
+deref( static_any_t cur, C&, ::ndnboost::type<RefType>, mpl::false_ )
+{
+    return *static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+template<class RefType,typename C>
+inline RefType
+deref( static_any_t cur, C const&, ::ndnboost::type<RefType>, mpl::true_ )
+{
+    return *static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************              BOOST_TEST_FOREACH              ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_FE_ANY                   ::ndnboost::unit_test::for_each::static_any_t
+#define BOOST_TEST_FE_IS_CONST( COL )       ::ndnboost::unit_test::for_each::is_const_coll( COL )
+
+#define BOOST_TEST_FE_BEG( COL )            \
+    ::ndnboost::unit_test::for_each::begin(    \
+        COL,                                \
+        BOOST_TEST_FE_IS_CONST( COL ) )     \
+/**/
+
+#define BOOST_TEST_FE_END( COL )            \
+    ::ndnboost::unit_test::for_each::end(      \
+        COL,                                \
+        BOOST_TEST_FE_IS_CONST( COL ) )     \
+/**/
+
+#define BOOST_TEST_FE_DONE( COL )           \
+    ::ndnboost::unit_test::for_each::done(     \
+        BOOST_TEST_FE_CUR_VAR,              \
+        BOOST_TEST_FE_END_VAR,              \
+        COL,                                \
+        BOOST_TEST_FE_IS_CONST( COL ) )     \
+/**/
+
+#define BOOST_TEST_FE_NEXT( COL )           \
+    ::ndnboost::unit_test::for_each::next(     \
+        BOOST_TEST_FE_CUR_VAR,              \
+        COL,                                \
+        BOOST_TEST_FE_IS_CONST( COL ) )     \
+/**/
+
+#define BOOST_FOREACH_NOOP(COL)             \
+    ((void)&(COL))
+
+#define BOOST_TEST_FE_DEREF( COL, RefType ) \
+    ::ndnboost::unit_test::for_each::deref(    \
+        BOOST_TEST_FE_CUR_VAR,              \
+        COL,                                \
+        ::ndnboost::type<RefType >(),          \
+        BOOST_TEST_FE_IS_CONST( COL ) )     \
+/**/
+
+#if BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
+#define BOOST_TEST_LINE_NUM
+#else
+#define BOOST_TEST_LINE_NUM     __LINE__
+#endif
+
+#define BOOST_TEST_FE_CUR_VAR   BOOST_JOIN( _fe_cur_, BOOST_TEST_LINE_NUM )
+#define BOOST_TEST_FE_END_VAR   BOOST_JOIN( _fe_end_, BOOST_TEST_LINE_NUM )
+#define BOOST_TEST_FE_CON_VAR   BOOST_JOIN( _fe_con_, BOOST_TEST_LINE_NUM )
+
+#define BOOST_TEST_FOREACH( RefType, var, COL )                                             \
+if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else            \
+if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ) ) {} else            \
+for( bool BOOST_TEST_FE_CON_VAR = true;                                                     \
+          BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL );                              \
+          BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL ))    \
+                                                                                            \
+    if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else                                    \
+    for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType );                                 \
+         !BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true )                             \
+/**/
+
+//____________________________________________________________________________//
+
+} // namespace for_each
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_FOREACH_HPP_021005GER
diff --git a/ndnboost/test/utils/iterator/input_iterator_facade.hpp b/ndnboost/test/utils/iterator/input_iterator_facade.hpp
new file mode 100644
index 0000000..92968ac
--- /dev/null
+++ b/ndnboost/test/utils/iterator/input_iterator_facade.hpp
@@ -0,0 +1,109 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : Input iterator facade 
+// ***************************************************************************
+
+#ifndef BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+#define BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+
+// Boost
+#include <ndnboost/iterator/iterator_facade.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************          input_iterator_core_access          ************** //
+// ************************************************************************** //
+
+class input_iterator_core_access
+{
+#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+public:
+#else
+    template <class I, class V, class R, class TC> friend class input_iterator_facade;
+#endif
+
+    template <class Facade>
+    static bool get( Facade& f )
+    {
+        return f.get();
+    }
+
+private:
+    // objects of this class are useless
+    input_iterator_core_access(); //undefined
+};
+
+// ************************************************************************** //
+// **************            input_iterator_facade             ************** //
+// ************************************************************************** //
+
+template<typename Derived,
+         typename ValueType,
+         typename Reference = ValueType const&,
+         typename Traversal = single_pass_traversal_tag>
+class input_iterator_facade : public iterator_facade<Derived,ValueType,Traversal,Reference>
+{
+public:
+    // Constructor
+    input_iterator_facade() : m_valid( false ), m_value() {}
+
+protected: // provide access to the Derived
+    void                init()
+    {
+        m_valid = true;
+        increment();
+    }
+
+    // Data members
+    mutable bool        m_valid;
+    ValueType           m_value;
+
+private:
+    friend class ndnboost::iterator_core_access;
+
+    // iterator facade interface implementation
+    void                increment()
+    {
+        // we make post-end incrementation indefinetly safe 
+        if( m_valid )
+            m_valid = input_iterator_core_access::get( *static_cast<Derived*>(this) );
+    }
+    Reference           dereference() const
+    {
+        return m_value;
+    }
+
+    // iterator facade interface implementation
+    bool                equal( input_iterator_facade const& rhs ) const
+    {
+        // two invalid iterator equals, inequal otherwise
+        return !m_valid && !rhs.m_valid;
+    }
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+
diff --git a/ndnboost/test/utils/iterator/token_iterator.hpp b/ndnboost/test/utils/iterator/token_iterator.hpp
new file mode 100644
index 0000000..c1b2dbc
--- /dev/null
+++ b/ndnboost/test/utils/iterator/token_iterator.hpp
@@ -0,0 +1,418 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : token iterator for string and range tokenization
+// ***************************************************************************
+
+#ifndef BOOST_TOKEN_ITERATOR_HPP_071894GER
+#define BOOST_TOKEN_ITERATOR_HPP_071894GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#include <ndnboost/iterator/iterator_categories.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+#include <ndnboost/test/utils/iterator/input_iterator_facade.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/named_params.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+
+// STL
+#include <iosfwd>
+#include <cctype>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std{ using ::ispunct; using ::isspace; }
+#endif
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************               ti_delimeter_type              ************** //
+// ************************************************************************** //
+
+enum ti_delimeter_type { 
+    dt_char,        // character is delimeter if it among explicit list of some characters
+    dt_ispunct,     // character is delimeter if it satisfies ispunct functor
+    dt_isspace,     // character is delimeter if it satisfies isspace functor
+    dt_none         // no character is delimeter
+};
+
+namespace ut_detail {
+
+// ************************************************************************** //
+// **************             default_char_compare             ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class default_char_compare {
+public:
+    bool operator()( CharT c1, CharT c2 )
+    {
+#ifdef BOOST_CLASSIC_IOSTREAMS
+        return std::string_char_traits<CharT>::eq( c1, c2 );
+#else
+        return std::char_traits<CharT>::eq( c1, c2 );
+#endif
+    }
+};
+
+// ************************************************************************** //
+// **************                 delim_policy                 ************** //
+// ************************************************************************** //
+
+template<typename CharT,typename CharCompare>
+class delim_policy {
+    typedef basic_cstring<CharT const> cstring;
+public:
+    // Constructor
+    explicit    delim_policy( ti_delimeter_type t = dt_char, cstring d = cstring() )
+    : m_type( t )
+    {
+        set_delimeters( d );
+    }
+
+    void        set_delimeters( ti_delimeter_type t ) { m_type = t; }
+    template<typename Src>
+    void        set_delimeters( Src d )
+    {
+        nfp::optionally_assign( m_delimeters, d );
+        
+        if( !m_delimeters.is_empty() )
+            m_type = dt_char;
+    }
+
+    bool        operator()( CharT c )
+    {
+        switch( m_type ) {
+        case dt_char: {
+            BOOST_TEST_FOREACH( CharT, delim, m_delimeters )
+                if( CharCompare()( delim, c ) )
+                    return true;
+
+            return false;
+        }
+        case dt_ispunct:
+            return (std::ispunct)( c ) != 0;
+        case dt_isspace:
+            return (std::isspace)( c ) != 0;
+        case dt_none:
+            return false;
+        }
+
+        return false;
+    }
+
+private:
+    // Data members
+    cstring             m_delimeters;
+    ti_delimeter_type   m_type;
+};
+
+// ************************************************************************** //
+// **************                 token_assigner               ************** //
+// ************************************************************************** //
+
+template<typename TraversalTag>
+struct token_assigner {
+#if BOOST_WORKAROUND( BOOST_DINKUMWARE_STDLIB, < 306 )
+    template<typename Iterator, typename C, typename T>
+    static void assign( Iterator b, Iterator e, std::basic_string<C,T>& t )
+    { for( ; b != e; ++b ) t += *b; }
+    
+    template<typename Iterator, typename C>
+    static void assign( Iterator b, Iterator e, basic_cstring<C>& t )  { t.assign( b, e ); }
+#else
+    template<typename Iterator, typename Token>
+    static void assign( Iterator b, Iterator e, Token& t )  { t.assign( b, e ); }
+#endif
+    template<typename Iterator, typename Token>
+    static void append_move( Iterator& b, Token& )          { ++b; }
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct token_assigner<single_pass_traversal_tag> {
+    template<typename Iterator, typename Token>
+    static void assign( Iterator b, Iterator e, Token& t )  {}
+
+    template<typename Iterator, typename Token>
+    static void append_move( Iterator& b, Token& t )        { t += *b; ++b; }
+};
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// **************                  modifiers                   ************** //
+// ************************************************************************** //
+
+namespace {
+nfp::keyword<struct dropped_delimeters_t >           dropped_delimeters;
+nfp::keyword<struct kept_delimeters_t >              kept_delimeters;
+nfp::typed_keyword<bool,struct keep_empty_tokens_t > keep_empty_tokens;
+nfp::typed_keyword<std::size_t,struct max_tokens_t > max_tokens;
+}
+
+// ************************************************************************** //
+// **************             token_iterator_base              ************** //
+// ************************************************************************** //
+
+template<typename Derived,
+         typename CharT,
+         typename CharCompare   = ut_detail::default_char_compare<CharT>,
+         typename ValueType     = basic_cstring<CharT const>,
+         typename Reference     = basic_cstring<CharT const>,
+         typename Traversal     = forward_traversal_tag>
+class token_iterator_base
+: public input_iterator_facade<Derived,ValueType,Reference,Traversal> {
+    typedef basic_cstring<CharT const>                                      cstring;
+    typedef ut_detail::delim_policy<CharT,CharCompare>                      delim_policy;
+    typedef input_iterator_facade<Derived,ValueType,Reference,Traversal>    base;
+
+protected:
+    // Constructor
+    explicit    token_iterator_base()
+    : m_is_dropped( dt_isspace )
+    , m_is_kept( dt_ispunct )
+    , m_keep_empty_tokens( false )
+    , m_tokens_left( static_cast<std::size_t>(-1) )
+    , m_token_produced( false )
+    {
+    }
+
+    template<typename Modifier>
+    void
+    apply_modifier( Modifier const& m )
+    {
+        if( m.has( dropped_delimeters ) )
+            m_is_dropped.set_delimeters( m[dropped_delimeters] );
+
+        if( m.has( kept_delimeters ) )
+            m_is_kept.set_delimeters( m[kept_delimeters] );
+
+        if( m.has( keep_empty_tokens ) )
+            m_keep_empty_tokens = true;
+
+        nfp::optionally_assign( m_tokens_left, m, max_tokens );
+    }
+
+    template<typename Iter> 
+    bool                    get( Iter& begin, Iter end )
+    {
+        typedef ut_detail::token_assigner<BOOST_DEDUCED_TYPENAME iterator_traversal<Iter>::type> Assigner;
+        Iter check_point;
+
+        this->m_value.clear();
+
+        if( !m_keep_empty_tokens ) {
+            while( begin != end && m_is_dropped( *begin ) )
+                ++begin;
+
+            if( begin == end )
+                return false;
+
+            check_point = begin;
+
+            if( m_tokens_left == 1 )
+                while( begin != end )
+                    Assigner::append_move( begin, this->m_value );
+            else if( m_is_kept( *begin ) )
+                Assigner::append_move( begin, this->m_value );
+            else
+                while( begin != end && !m_is_dropped( *begin ) && !m_is_kept( *begin ) )
+                    Assigner::append_move( begin, this->m_value );
+
+            --m_tokens_left;
+        } 
+        else { // m_keep_empty_tokens is true
+            check_point = begin;
+
+            if( begin == end ) {
+                if( m_token_produced ) 
+                    return false;
+
+                m_token_produced = true;
+            }
+            if( m_is_kept( *begin ) ) {
+                if( m_token_produced ) 
+                    Assigner::append_move( begin, this->m_value );
+
+                m_token_produced = !m_token_produced;
+            } 
+            else if( !m_token_produced && m_is_dropped( *begin ) )
+                m_token_produced = true;
+            else {
+                if( m_is_dropped( *begin ) )
+                    check_point = ++begin;
+
+                while( begin != end && !m_is_dropped( *begin ) && !m_is_kept( *begin ) )
+                    Assigner::append_move( begin, this->m_value );
+
+                m_token_produced = true;
+            }
+        }
+
+        Assigner::assign( check_point, begin, this->m_value );
+
+        return true;
+    }
+
+private:
+    // Data members
+    delim_policy            m_is_dropped;
+    delim_policy            m_is_kept;
+    bool                    m_keep_empty_tokens;
+    std::size_t             m_tokens_left;
+    bool                    m_token_produced;
+};
+
+// ************************************************************************** //
+// **************          basic_string_token_iterator         ************** //
+// ************************************************************************** //
+
+template<typename CharT,
+         typename CharCompare = ut_detail::default_char_compare<CharT> >
+class basic_string_token_iterator
+: public token_iterator_base<basic_string_token_iterator<CharT,CharCompare>,CharT,CharCompare> {
+    typedef basic_cstring<CharT const> cstring;
+    typedef token_iterator_base<basic_string_token_iterator<CharT,CharCompare>,CharT,CharCompare> base;
+public:
+    explicit    basic_string_token_iterator() {}
+    explicit    basic_string_token_iterator( cstring src )
+    : m_src( src )
+    {
+        this->init();
+    }
+
+    template<typename Src, typename Modifier>
+    basic_string_token_iterator( Src src, Modifier const& m )
+    : m_src( src )
+    {
+        this->apply_modifier( m );
+
+        this->init();
+    }
+
+private:
+    friend class input_iterator_core_access;
+
+    // input iterator implementation
+    bool        get()
+    {
+        typename cstring::iterator begin = m_src.begin();
+        bool res = base::get( begin, m_src.end() );
+
+        m_src.assign( begin, m_src.end() );
+
+        return res;
+    }
+
+    // Data members
+    cstring     m_src;
+};
+
+typedef basic_string_token_iterator<char>       string_token_iterator;
+typedef basic_string_token_iterator<wchar_t>    wstring_token_iterator;
+
+// ************************************************************************** //
+// **************              range_token_iterator            ************** //
+// ************************************************************************** //
+
+template<typename Iter,
+         typename CharCompare = ut_detail::default_char_compare<BOOST_DEDUCED_TYPENAME iterator_value<Iter>::type>,
+         typename ValueType   = std::basic_string<BOOST_DEDUCED_TYPENAME iterator_value<Iter>::type>,
+         typename Reference   = ValueType const&>
+class range_token_iterator
+: public token_iterator_base<range_token_iterator<Iter,CharCompare,ValueType,Reference>,
+                             typename iterator_value<Iter>::type,CharCompare,ValueType,Reference> {
+    typedef basic_cstring<typename ValueType::value_type> cstring;
+    typedef token_iterator_base<range_token_iterator<Iter,CharCompare,ValueType,Reference>,
+                                typename iterator_value<Iter>::type,CharCompare,ValueType,Reference> base;
+public:
+    explicit    range_token_iterator() {}
+    explicit    range_token_iterator( Iter begin, Iter end = Iter() )
+    : m_begin( begin ), m_end( end )
+    {
+        this->init();
+    }
+    range_token_iterator( range_token_iterator const& rhs )
+    : base( rhs )
+    {
+        if( this->m_valid ) {
+            m_begin = rhs.m_begin;
+            m_end   = rhs.m_end;
+        }
+    }
+
+    template<typename Modifier>
+    range_token_iterator( Iter begin, Iter end, Modifier const& m )
+    : m_begin( begin ), m_end( end )
+    {
+        this->apply_modifier( m );
+
+        this->init();
+    }
+
+private:
+    friend class input_iterator_core_access;
+
+    // input iterator implementation
+    bool        get()
+    {
+        return base::get( m_begin, m_end );
+    }
+
+    // Data members
+    Iter m_begin;
+    Iter m_end;
+};
+
+// ************************************************************************** //
+// **************            make_range_token_iterator         ************** //
+// ************************************************************************** //
+
+template<typename Iter>
+inline range_token_iterator<Iter>
+make_range_token_iterator( Iter begin, Iter end = Iter() )
+{
+    return range_token_iterator<Iter>( begin, end );
+}
+
+//____________________________________________________________________________//
+
+template<typename Iter,typename Modifier>
+inline range_token_iterator<Iter>
+make_range_token_iterator( Iter begin, Iter end, Modifier const& m )
+{
+    return range_token_iterator<Iter>( begin, end, m );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TOKEN_ITERATOR_HPP_071894GER
+
diff --git a/ndnboost/test/utils/lazy_ostream.hpp b/ndnboost/test/utils/lazy_ostream.hpp
new file mode 100644
index 0000000..4b9a0a3
--- /dev/null
+++ b/ndnboost/test/utils/lazy_ostream.hpp
@@ -0,0 +1,114 @@
+//  (C) Copyright Gennadiy Rozental 2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : contains definition for all test tools in test toolbox
+// ***************************************************************************
+
+#ifndef BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
+#define BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  lazy_ostream                ************** //
+// ************************************************************************** //
+
+namespace ndnboost {
+
+namespace unit_test {
+
+class lazy_ostream {
+public:
+    static lazy_ostream&    instance()                                              { static lazy_ostream inst; return inst; }
+
+    friend std::ostream&    operator<<( std::ostream& ostr, lazy_ostream const& o ) { return o( ostr ); }
+
+    // access method
+    bool                    empty() const                                           { return m_empty; }
+
+    // actual printing interface; to be accessed only by this class and children
+    virtual std::ostream&   operator()( std::ostream& ostr ) const                  { return ostr; }
+protected:
+    explicit                lazy_ostream( bool empty = true ) : m_empty( empty )    {}
+
+    // protected destructor to make sure right one is called
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+public:
+#endif
+    BOOST_TEST_PROTECTED_VIRTUAL ~lazy_ostream()                                    {}
+
+private:
+    // Data members
+    bool                    m_empty;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+class lazy_ostream_impl : public lazy_ostream {
+public:
+    lazy_ostream_impl( lazy_ostream const& prev, T value )
+    : lazy_ostream( false )
+    , m_prev( prev )
+    , m_value( value )
+    {}
+private:
+    virtual std::ostream&   operator()( std::ostream& ostr ) const
+    {
+        return m_prev(ostr) << m_value;
+    }
+
+    // Data members
+    lazy_ostream const&     m_prev;
+    T                       m_value;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline lazy_ostream_impl<T const&>
+operator<<( lazy_ostream const& prev, T const& v )
+{
+    return lazy_ostream_impl<T const&>( prev, v );
+}
+
+//____________________________________________________________________________//
+
+#if BOOST_TEST_USE_STD_LOCALE
+
+template<typename R,typename S>
+inline lazy_ostream_impl<R& (BOOST_TEST_CALL_DECL *)(S&)>
+operator<<( lazy_ostream const& prev, R& (BOOST_TEST_CALL_DECL *man)(S&) )
+{
+    return lazy_ostream_impl<R& (BOOST_TEST_CALL_DECL *)(S&)>( prev, man );
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
diff --git a/ndnboost/test/utils/named_params.hpp b/ndnboost/test/utils/named_params.hpp
new file mode 100644
index 0000000..371d594
--- /dev/null
+++ b/ndnboost/test/utils/named_params.hpp
@@ -0,0 +1,329 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : facilities for named function parameters support
+// ***************************************************************************
+
+#ifndef BOOST_TEST_NAMED_PARAM_022505GER
+#define BOOST_TEST_NAMED_PARAM_022505GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+#include <ndnboost/test/utils/assign_op.hpp>
+
+#include <ndnboost/type_traits/remove_reference.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace nfp { // named function parameters
+
+// ************************************************************************** //
+// **************              forward declarations            ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id,typename RefType>   struct named_parameter;
+template<typename unique_id,bool required>                  struct keyword;
+
+namespace nfp_detail {
+
+template<typename NP1,typename NP2>        struct named_parameter_combine;
+
+// ************************************************************************** //
+// **************          access_to_invalid_parameter         ************** //
+// ************************************************************************** //
+
+struct access_to_invalid_parameter {};
+
+//____________________________________________________________________________//
+
+inline void 
+report_access_to_invalid_parameter()
+{
+    throw access_to_invalid_parameter();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                       nil                    ************** //
+// ************************************************************************** //
+
+struct nil {
+    template<typename T>
+#if defined(__GNUC__) || defined(__HP_aCC) || defined(__EDG__) || defined(__SUNPRO_CC)
+    operator T() const
+#else
+    operator T const&() const
+#endif
+    { report_access_to_invalid_parameter(); static T* v = 0; return *v; }
+
+    template<typename T>
+    T any_cast() const
+    { report_access_to_invalid_parameter(); static typename remove_reference<T>::type* v = 0; return *v; }
+
+    template<typename Arg1>
+    nil operator()( Arg1 const& )
+    { report_access_to_invalid_parameter(); return nil(); }
+
+    template<typename Arg1,typename Arg2>
+    nil operator()( Arg1 const&, Arg2 const& )
+    { report_access_to_invalid_parameter(); return nil(); }
+
+    template<typename Arg1,typename Arg2,typename Arg3>
+    nil operator()( Arg1 const&, Arg2 const&, Arg3 const& )
+    { report_access_to_invalid_parameter(); return nil(); }
+
+    // Visitation support
+    template<typename Visitor>
+    void            apply_to( Visitor& V ) const {}
+
+    static nil&     inst() { static nil s_inst; return s_inst; }
+private:
+    nil() {}
+};
+    
+// ************************************************************************** //
+// **************              named_parameter_base            ************** //
+// ************************************************************************** //
+
+template<typename Derived>
+struct named_parameter_base {
+    template<typename NP>
+    named_parameter_combine<NP,Derived>
+    operator,( NP const& np ) const { return named_parameter_combine<NP,Derived>( np, *static_cast<Derived const*>(this) ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************             named_parameter_combine          ************** //
+// ************************************************************************** //
+
+template<typename NP, typename Rest = nil>
+struct named_parameter_combine 
+: Rest
+, named_parameter_base<named_parameter_combine<NP,Rest> > {
+    typedef typename NP::ref_type  res_type;
+    typedef named_parameter_combine<NP,Rest> self_type;
+
+    // Constructor
+    named_parameter_combine( NP const& np, Rest const& r )
+    : Rest( r )
+    , m_param( np )
+    {}
+
+    // Access methods
+    res_type    operator[]( keyword<typename NP::id,true> kw ) const    { return m_param[kw]; }
+    res_type    operator[]( keyword<typename NP::id,false> kw ) const   { return m_param[kw]; }
+    using       Rest::operator[];
+
+    bool        has( keyword<typename NP::id,false> kw ) const          { return m_param.has( kw ); }
+    using       Rest::has;
+
+    void        erase( keyword<typename NP::id,false> kw ) const        { m_param.erase( kw ); }
+    using       Rest::erase;
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) || \
+    BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0610))
+    template<typename NP>
+    named_parameter_combine<NP,self_type> operator,( NP const& np ) const
+    { return named_parameter_combine<NP,self_type>( np, *this ); }
+#else
+    using       named_parameter_base<named_parameter_combine<NP,Rest> >::operator,;
+#endif
+
+    // Visitation support
+    template<typename Visitor>
+    void            apply_to( Visitor& V ) const
+    {
+        m_param.apply_to( V );
+
+        Rest::apply_to( V );
+    }
+private:
+    // Data members
+    NP          m_param;
+};
+
+} // namespace nfp_detail
+
+// ************************************************************************** //
+// **************                 named_parameter              ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id,typename ReferenceType=T&>
+struct named_parameter
+: nfp_detail::named_parameter_base<named_parameter<T, unique_id,ReferenceType> >
+{
+    typedef nfp_detail::nil nil_t;
+    typedef T               data_type;
+    typedef ReferenceType   ref_type;
+    typedef unique_id       id;
+
+    // Constructor
+    explicit        named_parameter( ref_type v ) 
+    : m_value( v )
+    , m_erased( false )
+    {}
+    named_parameter( named_parameter const& np )
+    : m_value( np.m_value )
+    , m_erased( np.m_erased )
+    {}
+
+    // Access methods
+    ref_type        operator[]( keyword<unique_id,true> ) const     { return m_erased ? nil_t::inst().template any_cast<ref_type>() :  m_value; }
+    ref_type        operator[]( keyword<unique_id,false> ) const    { return m_erased ? nil_t::inst().template any_cast<ref_type>() :  m_value; }
+    template<typename UnknownId>
+    nil_t           operator[]( keyword<UnknownId,false> ) const    { return nil_t::inst(); }
+
+    bool            has( keyword<unique_id,false> ) const           { return !m_erased; }
+    template<typename UnknownId>
+    bool            has( keyword<UnknownId,false> ) const           { return false; }
+
+    void            erase( keyword<unique_id,false> ) const         { m_erased = true; }
+    template<typename UnknownId>
+    void            erase( keyword<UnknownId,false> ) const         {}
+
+    // Visitation support
+    template<typename Visitor>
+    void            apply_to( Visitor& V ) const
+    {
+        V.set_parameter( rtti::type_id<unique_id>(), m_value );
+    }
+
+private:
+    // Data members
+    ref_type        m_value;
+    mutable bool    m_erased;
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                    no_params                 ************** //
+// ************************************************************************** //
+
+namespace nfp_detail {
+typedef named_parameter<char, struct no_params_type_t,char> no_params_type;
+} // namespace nfp_detail
+
+namespace {
+nfp_detail::no_params_type no_params( '\0' );
+} // local namespace
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                     keyword                  ************** //
+// ************************************************************************** //
+
+template<typename unique_id, bool required = false>
+struct keyword {
+    typedef unique_id id;
+
+    template<typename T>
+    named_parameter<T const,unique_id>
+    operator=( T const& t ) const       { return named_parameter<T const,unique_id>( t ); }
+
+    template<typename T>
+    named_parameter<T,unique_id>
+    operator=( T& t ) const   { return named_parameter<T,unique_id>( t ); }
+
+    named_parameter<char const*,unique_id,char const*>
+    operator=( char const* t ) const   { return named_parameter<char const*,unique_id,char const*>( t ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                  typed_keyword               ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id, bool required = false>
+struct typed_keyword : keyword<unique_id,required> {
+    named_parameter<T const,unique_id>
+    operator=( T const& t ) const       { return named_parameter<T const,unique_id>( t ); }
+
+    named_parameter<T,unique_id>
+    operator=( T& t ) const             { return named_parameter<T,unique_id>( t ); }
+};
+
+//____________________________________________________________________________//
+
+template<typename unique_id>
+struct typed_keyword<bool,unique_id,false>
+: keyword<unique_id,false>
+, named_parameter<bool,unique_id,bool> {
+    typedef unique_id id;
+
+    typed_keyword() : named_parameter<bool,unique_id,bool>( true ) {}
+
+    named_parameter<bool,unique_id,bool>
+    operator!() const           { return named_parameter<bool,unique_id,bool>( false ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// **************                optionally_assign             ************** //
+// ************************************************************************** //
+
+template<typename T>
+inline void
+optionally_assign( T&, nfp_detail::nil )
+{
+    nfp_detail::report_access_to_invalid_parameter();
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename Source>
+inline void
+#if BOOST_WORKAROUND( __MWERKS__, BOOST_TESTED_AT( 0x3003 ) ) \
+    || BOOST_WORKAROUND( __DECCXX_VER, BOOST_TESTED_AT(60590042) )
+optionally_assign( T& target, Source src )
+#else
+optionally_assign( T& target, Source const& src )
+#endif
+{
+    using namespace unit_test;
+
+    assign_op( target, src, static_cast<int>(0) );
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename Params, typename Keyword>
+inline void
+optionally_assign( T& target, Params const& p, Keyword k )
+{
+    if( p.has(k) )
+        optionally_assign( target, p[k] );
+}
+
+//____________________________________________________________________________//
+
+} // namespace nfp
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_NAMED_PARAM_022505GER
+
diff --git a/ndnboost/test/utils/rtti.hpp b/ndnboost/test/utils/rtti.hpp
new file mode 100644
index 0000000..2413106
--- /dev/null
+++ b/ndnboost/test/utils/rtti.hpp
@@ -0,0 +1,64 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : simple facilities for accessing type information at runtime
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RTTI_HPP_062604GER
+#define BOOST_TEST_RTTI_HPP_062604GER
+
+#include <cstddef>
+
+namespace ndnboost {
+
+namespace rtti {
+
+// ************************************************************************** //
+// **************                   rtti::type_id              ************** //
+// ************************************************************************** //
+
+typedef std::ptrdiff_t id_t;
+
+namespace rtti_detail {
+
+template<typename T>
+struct rttid_holder {
+    static id_t id() { return reinterpret_cast<id_t>( &inst() ); }
+
+private:
+    struct rttid {};
+
+    static rttid const& inst() { static rttid s_inst;  return s_inst; }
+};
+
+} // namespace rtti_detail
+
+//____________________________________________________________________________//
+
+template<typename T>   
+inline id_t
+type_id()
+{
+    return rtti_detail::rttid_holder<T>::id();
+}
+
+//____________________________________________________________________________//
+
+#define BOOST_RTTI_SWITCH( type_id_ ) if( ::ndnboost::rtti::id_t switch_by_id = type_id_ )
+#define BOOST_RTTI_CASE( type )       if( switch_by_id == ::ndnboost::rtti::type_id<type>() )
+
+//____________________________________________________________________________//
+
+} // namespace rtti
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_RTTI_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/argument.hpp b/ndnboost/test/utils/runtime/argument.hpp
new file mode 100644
index 0000000..c14956c
--- /dev/null
+++ b/ndnboost/test/utils/runtime/argument.hpp
@@ -0,0 +1,112 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : model of actual argument (both typed and abstract interface)
+// ***************************************************************************
+
+#ifndef BOOST_RT_ARGUMENT_HPP_062604GER
+#define BOOST_RT_ARGUMENT_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+// STL
+#include <cassert>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// **************              runtime::argument               ************** //
+// ************************************************************************** //
+
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable:4244)
+#endif
+
+class argument {
+public:
+    // Constructor
+    argument( parameter const& p, rtti::id_t value_type )
+    : p_formal_parameter( p )
+    , p_value_type( value_type )
+    {}
+
+    // Destructor
+    virtual     ~argument()  {}
+
+    // Public properties
+    unit_test::readonly_property<parameter const&> p_formal_parameter;
+    unit_test::readonly_property<rtti::id_t>       p_value_type;
+};
+
+// ************************************************************************** //
+// **************             runtime::typed_argument          ************** //
+// ************************************************************************** //
+
+template<typename T>
+class typed_argument : public argument {
+public:
+    // Constructor
+    explicit typed_argument( parameter const& p )
+    : argument( p, rtti::type_id<T>() )
+    {}
+    typed_argument( parameter const& p, T const& t )
+    : argument( p, rtti::type_id<T>() )
+    , p_value( t )
+    {}
+
+    unit_test::readwrite_property<T>    p_value;
+};
+
+// ************************************************************************** //
+// **************               runtime::arg_value             ************** //
+// ************************************************************************** //
+
+template<typename T>
+inline T const&
+arg_value( argument const& arg_ )
+{
+    assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
+
+    return static_cast<typed_argument<T> const&>( arg_ ).p_value.value;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline T&
+arg_value( argument& arg_ )
+{
+    assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
+
+    return static_cast<typed_argument<T>&>( arg_ ).p_value.value;
+}
+
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ARGUMENT_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argument_factory.hpp b/ndnboost/test/utils/runtime/cla/argument_factory.hpp
new file mode 100644
index 0000000..4f6709b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argument_factory.hpp
@@ -0,0 +1,218 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : generic typed_argument_factory implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
+#define BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+#include <ndnboost/test/utils/runtime/interpret_argument_value.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/value_generator.hpp>
+#include <ndnboost/test/utils/runtime/cla/value_handler.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/callback.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************           default_value_interpreter          ************** //
+// ************************************************************************** //
+
+namespace rt_cla_detail {
+
+struct default_value_interpreter {
+    template<typename T>
+    void operator()( argv_traverser& tr, ndnboost::optional<T>& value )
+    {
+        if( interpret_argument_value( tr.token(), value, 0 ) )
+            tr.next_token();
+    }
+};
+
+} // namespace rt_cla_detail
+
+// ************************************************************************** //
+// **************             typed_argument_factory           ************** //
+// ************************************************************************** //
+
+template<typename T>
+struct typed_argument_factory : public argument_factory {
+    // Constructor
+    typed_argument_factory()
+    : m_value_interpreter( rt_cla_detail::default_value_interpreter() )
+    {}
+    BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~typed_argument_factory() {}
+
+    // properties modification
+    template<typename Modifier>
+    void                accept_modifier( Modifier const& m )
+    {
+        optionally_assign( m_value_handler, m, handler );
+        optionally_assign( m_value_interpreter, m, interpreter );
+
+        if( m.has( default_value ) ) {
+            BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator, 
+                BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
+
+            T const& dv_ref = m[default_value];
+            m_value_generator = rt_cla_detail::const_generator<T>( dv_ref );
+        }
+
+        if( m.has( default_refer_to ) ) {
+            BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator, 
+                BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
+
+            cstring ref_id = m[default_refer_to];
+            m_value_generator = rt_cla_detail::ref_generator<T>( ref_id );
+        }
+
+        if( m.has( assign_to ) ) {
+            BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_handler, 
+                BOOST_RT_PARAM_LITERAL( "multiple value handlers for parameter" ) );
+
+            m_value_handler = rt_cla_detail::assigner<T>( m[assign_to] );
+        }
+    }
+
+    // Argument factory implementation
+    virtual argument_ptr produce_using( parameter& p, argv_traverser& tr );
+    virtual argument_ptr produce_using( parameter& p, parser const& );
+    virtual void         argument_usage_info( format_stream& fs );
+
+// !! private?
+    // Data members
+    unit_test::callback2<parameter const&,T&>                   m_value_handler;
+    unit_test::callback2<parser const&,ndnboost::optional<T>&>     m_value_generator;
+    unit_test::callback2<argv_traverser&,ndnboost::optional<T>&>   m_value_interpreter;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline argument_ptr
+typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr )
+{
+    ndnboost::optional<T> value;
+
+    try {
+        m_value_interpreter( tr, value );
+    }
+    catch( ... ) { // !! should we do that?
+        BOOST_RT_PARAM_TRACE( "Fail to parse argument value" );
+
+        if( !p.p_optional_value )
+            throw;
+    }
+
+    argument_ptr actual_arg = p.actual_argument();
+
+    BOOST_RT_CLA_VALIDATE_INPUT( !!value || p.p_optional_value, tr, 
+        BOOST_RT_PARAM_LITERAL( "Argument value missing for parameter " ) << p.id_2_report() );
+
+    BOOST_RT_CLA_VALIDATE_INPUT( !actual_arg || p.p_multiplicable, tr, 
+        BOOST_RT_PARAM_LITERAL( "Unexpected repetition of the parameter " ) << p.id_2_report() );
+
+    if( !!value && !!m_value_handler )
+        m_value_handler( p, *value );
+
+    if( !p.p_multiplicable )
+        actual_arg.reset( p.p_optional_value && (rtti::type_id<T>() != rtti::type_id<bool>())
+            ? static_cast<argument*>(new typed_argument<ndnboost::optional<T> >( p, value ))
+            : static_cast<argument*>(new typed_argument<T>( p, *value )) );
+    else {
+        typedef std::list<ndnboost::optional<T> > optional_list;
+
+        if( !actual_arg )
+            actual_arg.reset( p.p_optional_value 
+                ? static_cast<argument*>(new typed_argument<optional_list>( p ))
+                : static_cast<argument*>(new typed_argument<std::list<T> >( p )) );
+
+        if( p.p_optional_value ) {
+            optional_list& values = arg_value<optional_list>( *actual_arg );
+
+            values.push_back( value );
+        }
+        else {
+            std::list<T>& values = arg_value<std::list<T> >( *actual_arg );
+            
+            values.push_back( *value );
+        }
+    }
+
+    return actual_arg;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline argument_ptr 
+typed_argument_factory<T>::produce_using( parameter& p, parser const& pa )
+{
+    argument_ptr actual_arg;
+
+    if( !m_value_generator )
+        return actual_arg;
+
+    ndnboost::optional<T> value;
+    m_value_generator( pa, value );
+
+    if( !value )
+        return actual_arg;
+
+    if( !!m_value_handler )
+        m_value_handler( p, *value );
+
+    actual_arg.reset( new typed_argument<T>( p, *value ) );
+
+    return actual_arg;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline void
+typed_argument_factory<T>::argument_usage_info( format_stream& fs )
+{
+    rt_cla_detail::argument_value_usage( fs, 0, reinterpret_cast<T*>(0) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace ndnboost
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace cla
+
+#endif // BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argv_traverser.hpp b/ndnboost/test/utils/runtime/cla/argv_traverser.hpp
new file mode 100644
index 0000000..8674bd2
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argv_traverser.hpp
@@ -0,0 +1,98 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : defines facility to hide input traversing details
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
+#define BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+
+// Boost
+#include <ndnboost/noncopyable.hpp>
+#include <ndnboost/shared_array.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************          runtime::cla::argv_traverser        ************** //
+// ************************************************************************** //
+
+class argv_traverser : noncopyable {
+    class parser;
+public:
+    // Constructor
+    argv_traverser();
+
+    // public_properties
+    unit_test::readwrite_property<bool>         p_ignore_mismatch;
+    unit_test::readwrite_property<char_type>    p_separator;
+
+    // argc+argv <-> internal buffer exchange
+    void            init( int argc, char_type** argv );
+    void            remainder( int& argc, char_type** argv );
+
+    // token based parsing
+    cstring         token() const;
+    void            next_token();
+
+    // whole input parsing
+    cstring         input() const;
+    void            trim( std::size_t size );
+    bool            match_front( cstring );
+    bool            match_front( char_type c );
+    bool            eoi() const;
+
+    // transaction logic support
+    void            commit();
+    void            rollback();
+
+    // current position access; used to save some reference points in input
+    std::size_t     input_pos() const;
+
+    // returns true if mismatch detected during input parsing handled successfully
+    bool            handle_mismatch();
+
+private:
+    // Data members
+    dstring                 m_buffer;
+    cstring                 m_work_buffer;
+
+    cstring                 m_token;
+    cstring::iterator       m_commited_end;
+
+    shared_array<char_type> m_remainder;
+    std::size_t             m_remainder_size;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/argv_traverser.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argv_traverser.ipp b/ndnboost/test/utils/runtime/cla/argv_traverser.ipp
new file mode 100644
index 0000000..da03cd9
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argv_traverser.ipp
@@ -0,0 +1,209 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : implements facility to hide input traversing details
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
+#define BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/trace.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// STL
+#include <memory>
+#include <cstring>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::memcpy; }
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************          runtime::cla::argv_traverser        ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+argv_traverser::argv_traverser()
+: p_ignore_mismatch( false ), p_separator( BOOST_RT_PARAM_LITERAL( ' ' ) )
+{
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::init( int argc, char_type** argv )
+{
+    for( int index = 1; index < argc; ++index ) {
+        m_buffer += argv[index];
+        if( index != argc-1 )
+            m_buffer += BOOST_RT_PARAM_LITERAL( ' ' );
+    }
+
+    m_remainder.reset( new char_type[m_buffer.size()+1] );
+    m_remainder_size    = 0;
+    m_work_buffer       = m_buffer;
+    m_commited_end      = m_work_buffer.begin();
+
+    BOOST_RT_PARAM_TRACE( "Input buffer: " << m_buffer );
+
+    next_token();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::remainder( int& argc, char_type** argv )
+{
+    argc = 1;
+    std::size_t pos = 0;
+    while(pos < m_remainder_size ) {
+        argv[argc++] = m_remainder.get() + pos;
+
+        pos = std::find( m_remainder.get() + pos, m_remainder.get() + m_remainder_size, 
+                         BOOST_RT_PARAM_LITERAL( ' ' ) ) - m_remainder.get();
+        m_remainder[pos++] = BOOST_RT_PARAM_LITERAL( '\0' );
+    }
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+argv_traverser::token() const
+{
+    return m_token;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::next_token()
+{
+    if( m_work_buffer.is_empty() )
+        return;
+
+    m_work_buffer.trim_left( m_token.size() ); // skip remainder of current token
+
+    if( m_work_buffer.size() != m_buffer.size() ) // !! is there a better way to identify first token
+        m_work_buffer.trim_left( 1 ); // skip separator if not first token;
+
+    m_token.assign( m_work_buffer.begin(),
+                    std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+argv_traverser::input() const
+{
+    return m_work_buffer;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::trim( std::size_t size )
+{
+    m_work_buffer.trim_left( size );
+
+    if( size <= m_token.size() )
+        m_token.trim_left( size );
+    else {
+        m_token.assign( m_work_buffer.begin(),
+                        std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+    }
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::match_front( cstring str )
+{
+    return m_work_buffer.size() < str.size() ? false : m_work_buffer.substr( 0, str.size() ) == str;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::match_front( char_type c )
+{
+    return first_char( m_work_buffer ) == c;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::eoi() const
+{
+    return m_work_buffer.is_empty();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::commit()
+{
+    m_commited_end = m_work_buffer.begin();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::rollback()
+{
+    m_work_buffer.assign( m_commited_end, m_work_buffer.end() );
+    m_token.assign( m_work_buffer.begin(),
+                    std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE std::size_t
+argv_traverser::input_pos() const
+{
+    return m_work_buffer.begin() - m_commited_end;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::handle_mismatch()
+{
+    if( !p_ignore_mismatch )
+        return false;
+
+    std::memcpy( m_remainder.get() + m_remainder_size, token().begin(), token().size() );
+    m_remainder_size += token().size();
+    m_remainder[m_remainder_size++] = p_separator;
+
+    next_token();
+    commit();
+
+    return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
diff --git a/ndnboost/test/utils/runtime/cla/basic_parameter.hpp b/ndnboost/test/utils/runtime/cla/basic_parameter.hpp
new file mode 100644
index 0000000..39ebb72
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/basic_parameter.hpp
@@ -0,0 +1,85 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : generic custom parameter generator
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/typed_parameter.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+// Boost
+#include <ndnboost/utility/base_from_member.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************         runtime::cla::basic_parameter        ************** //
+// ************************************************************************** //
+
+template<typename T, typename IdPolicy>
+class basic_parameter : private base_from_member<IdPolicy>, public typed_parameter<T> {
+public:
+    // Constructors
+    explicit    basic_parameter( cstring n ) 
+    : base_from_member<IdPolicy>()
+    , typed_parameter<T>( base_from_member<IdPolicy>::member )
+    {
+        this->accept_modifier( name = n );
+    }
+
+    // parameter properties modification
+    template<typename Modifier>
+    void        accept_modifier( Modifier const& m )
+    {
+        typed_parameter<T>::accept_modifier( m );
+
+        base_from_member<IdPolicy>::member.accept_modifier( m );
+    }
+};
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_CLA_NAMED_PARAM_GENERATORS( param_type )                                       \
+template<typename T>                                                                            \
+inline shared_ptr<param_type ## _t<T> >                                                         \
+param_type( cstring name = cstring() )                                                          \
+{                                                                                               \
+    return shared_ptr<param_type ## _t<T> >( new param_type ## _t<T>( name ) );                 \
+}                                                                                               \
+                                                                                                \
+inline shared_ptr<param_type ## _t<cstring> >                                                   \
+param_type( cstring name = cstring() )                                                          \
+{                                                                                               \
+    return shared_ptr<param_type ## _t<cstring> >( new param_type ## _t<cstring>( name ) );     \
+}                                                                                               \
+/**/
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/char_parameter.hpp b/ndnboost/test/utils/runtime/cla/char_parameter.hpp
new file mode 100644
index 0000000..d95b95b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/char_parameter.hpp
@@ -0,0 +1,98 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : defines model of parameter with single char name
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/basic_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************               char_name_policy               ************** //
+// ************************************************************************** //
+
+class char_name_policy : public basic_naming_policy {
+public:
+    // Constructor
+    char_name_policy();
+    BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~char_name_policy() {}
+
+    // policy interface
+    virtual bool    conflict_with( identification_policy const& ) const;
+
+    // Accept modifier
+    template<typename Modifier>
+    void            accept_modifier( Modifier const& m )
+    {
+        basic_naming_policy::accept_modifier( m );
+
+        BOOST_RT_PARAM_VALIDATE_LOGIC( p_name->size() <= 1, "Invalid parameter name "  << p_name );
+    }
+};
+
+// ************************************************************************** //
+// **************          runtime::cla::char_parameter        ************** //
+// ************************************************************************** //
+
+template<typename T>
+class char_parameter_t : public basic_parameter<T,char_name_policy> {
+    typedef basic_parameter<T,char_name_policy> base;
+public:
+    // Constructors
+    explicit    char_parameter_t( char_type name ) : base( cstring( &name, 1 ) ) {}
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline shared_ptr<char_parameter_t<T> >
+char_parameter( char_type name )
+{
+    return shared_ptr<char_parameter_t<T> >( new char_parameter_t<T>( name ) );
+}
+
+//____________________________________________________________________________//
+
+inline shared_ptr<char_parameter_t<cstring> >
+char_parameter( char_type name )
+{
+    return shared_ptr<char_parameter_t<cstring> >( new char_parameter_t<cstring>( name ) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/char_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/char_parameter.ipp b/ndnboost/test/utils/runtime/cla/char_parameter.ipp
new file mode 100644
index 0000000..5922902
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/char_parameter.ipp
@@ -0,0 +1,57 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : implements model of parameter with single char name
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************               char_name_policy               ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE 
+char_name_policy::char_name_policy()
+: basic_naming_policy( rtti::type_id<char_name_policy>() )
+{
+    assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+char_name_policy::conflict_with( identification_policy const& id ) const
+{
+    return id.p_type_id == p_type_id && 
+           p_name == static_cast<char_name_policy const&>( id ).p_name;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp b/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp
new file mode 100644
index 0000000..b78097b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp
@@ -0,0 +1,82 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied warranty,
+//  and with no claim as to its suitability for any purpose.
+  
+//  See http://www.boost.org for updates, documentation, and revision history.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : argument usage printing helpers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
+#define BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+// !! can we eliminate these includes?
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// **************             argument_value_usage             ************** //
+// ************************************************************************** //
+
+// generic case
+template<typename T>
+inline void
+argument_value_usage( format_stream& fs, long, T* = 0 )
+{
+    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "<value>" );
+}
+
+//____________________________________________________________________________//
+
+// specialization for list of values
+template<typename T>
+inline void
+argument_value_usage( format_stream& fs, int, std::list<T>* = 0 )
+{
+    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" );
+}
+
+//____________________________________________________________________________//
+
+// specialization for type bool
+inline void
+argument_value_usage( format_stream& fs,  int, bool* = 0 )
+{
+    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "yes|y|no|n" );
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp b/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp
new file mode 100644
index 0000000..3adbb85
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp
@@ -0,0 +1,96 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : defines model of generic parameter with dual naming
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/named_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************               dual_name_policy               ************** //
+// ************************************************************************** //
+
+class dual_name_policy : public dual_id_policy<dual_name_policy,string_name_policy,char_name_policy> {
+public:
+    dual_name_policy();
+
+    // Accept modifier
+    template<typename Modifier>
+    void    accept_modifier( Modifier const& m )
+    {
+        if( m.has( prefix ) ) {
+            set_prefix( m[prefix] );
+            m.erase( prefix );
+        }
+
+        if( m.has( name ) ) {
+            set_name( m[name] );
+            m.erase( name );
+        }
+
+        if( m.has( separator ) ) {
+            set_separator( m[separator] );
+            m.erase( separator );
+        }
+
+        dual_id_policy<dual_name_policy,string_name_policy,char_name_policy>::accept_modifier( m );
+    }
+private:
+    void    set_prefix( cstring );
+    void    set_name( cstring );
+    void    set_separator( cstring );
+};
+
+// ************************************************************************** //
+// **************       runtime::cla::dual_name_parameter      ************** //
+// ************************************************************************** //
+
+template<typename T>
+class dual_name_parameter_t : public basic_parameter<T,dual_name_policy> {
+    typedef basic_parameter<T,dual_name_policy> base;
+public:
+    // Constructors
+    explicit    dual_name_parameter_t( cstring name ) : base( name ) {}
+};
+
+//____________________________________________________________________________//
+
+BOOST_RT_CLA_NAMED_PARAM_GENERATORS( dual_name_parameter )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp b/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp
new file mode 100644
index 0000000..8fcb04f
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp
@@ -0,0 +1,90 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : implements model of generic parameter with dual naming
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************               dual_name_policy               ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE 
+dual_name_policy::dual_name_policy()
+{
+    m_primary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "--" ) );
+    m_secondary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "-" ) );
+}
+
+//____________________________________________________________________________//
+
+namespace {
+
+template<typename K>
+inline void
+split( string_name_policy& snp, char_name_policy& cnp, cstring src, K const& k )
+{
+    cstring::iterator sep = std::find( src.begin(), src.end(), BOOST_RT_PARAM_LITERAL( '|' ) );
+    
+    if( sep != src.begin() )
+        snp.accept_modifier( k = cstring( src.begin(), sep ) );
+
+    if( sep != src.end() )
+        cnp.accept_modifier( k = cstring( sep+1, src.end() ) );
+}
+
+} // local namespace
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_prefix( cstring src )
+{
+    split( m_primary, m_secondary, src, prefix );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_name( cstring src )
+{
+    split( m_primary, m_secondary, src, name );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_separator( cstring src )
+{
+    split( m_primary, m_secondary, src, separator );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/fwd.hpp b/ndnboost/test/utils/runtime/cla/fwd.hpp
new file mode 100644
index 0000000..4065e9b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/fwd.hpp
@@ -0,0 +1,55 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : cla subsystem forward declarations
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_FWD_HPP_062604GER
+#define BOOST_RT_CLA_FWD_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+class parser;
+class parameter;
+typedef shared_ptr<parameter> parameter_ptr;
+class naming_policy;
+typedef shared_ptr<naming_policy> naming_policy_ptr;
+class argv_traverser;
+
+namespace rt_cla_detail {
+
+template<typename T> class const_generator;
+template<typename T> class ref_generator;
+
+template<typename T> class assigner;
+
+class named_parameter_base;
+class positional_parameter_base;
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/id_policy.hpp b/ndnboost/test/utils/runtime/cla/id_policy.hpp
new file mode 100644
index 0000000..fb29cb7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/id_policy.hpp
@@ -0,0 +1,145 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : some generic identification policies definition
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ID_POLICY_HPP_062604GER
+#define BOOST_RT_CLA_ID_POLICY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/iface/id_policy.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************               naming_policy_base             ************** //
+// ************************************************************************** //
+// model: <prefix> <name> <separtor>
+
+class basic_naming_policy : public identification_policy {
+public:
+    // Public properties
+    unit_test::readwrite_property<dstring>    p_prefix;
+    unit_test::readwrite_property<dstring>    p_name;
+    unit_test::readwrite_property<dstring>    p_separator;
+
+    // Policy interface
+    virtual bool    responds_to( cstring name ) const       { return p_name == name; }
+    virtual cstring id_2_report() const                     { return p_name.get(); }
+    virtual void    usage_info( format_stream& fs ) const;
+    virtual bool    matching( parameter const& p, argv_traverser& tr, bool primary ) const;
+
+    // Accept modifier
+    template<typename Modifier>
+    void            accept_modifier( Modifier const& m )
+    {
+        nfp::optionally_assign( p_prefix.value,    m, prefix );
+        nfp::optionally_assign( p_name.value,      m, name );
+        nfp::optionally_assign( p_separator.value, m, separator );
+    }
+
+protected:
+    explicit basic_naming_policy( rtti::id_t dyn_type )
+    : identification_policy( dyn_type )
+    {}
+    BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {}
+
+    // Naming policy interface
+    virtual bool    match_prefix( argv_traverser& tr ) const;
+    virtual bool    match_name( argv_traverser& tr ) const;
+    virtual bool    match_separator( argv_traverser& tr, bool optional_value ) const;
+};
+
+// ************************************************************************** //
+// **************                 dual_id_policy               ************** //
+// ************************************************************************** //
+
+template<typename MostDerived,typename PrimaryId,typename SecondId>
+class dual_id_policy : public identification_policy {
+public:
+    // Constructor
+    dual_id_policy()
+    : identification_policy( rtti::type_id<MostDerived>() )
+    , m_primary()
+    , m_secondary()
+    {}
+
+    // Policy interface
+    virtual bool    responds_to( cstring name ) const
+    {
+        return m_primary.responds_to( name ) || m_secondary.responds_to( name );
+    }
+    virtual bool    conflict_with( identification_policy const& id_p ) const
+    {
+        return id_p.conflict_with( m_primary ) || id_p.conflict_with( m_secondary );
+    }
+    virtual cstring id_2_report() const
+    {
+        return m_primary.id_2_report();
+    }
+    virtual void    usage_info( format_stream& fs ) const
+    {
+        fs << BOOST_RT_PARAM_LITERAL( '{' );
+        m_primary.usage_info( fs );
+        fs << BOOST_RT_PARAM_LITERAL( '|' );
+        m_secondary.usage_info( fs );
+        fs << BOOST_RT_PARAM_LITERAL( '}' );
+    }
+    virtual bool    matching( parameter const& p, argv_traverser& tr, bool primary ) const
+    {
+        return m_primary.matching( p, tr, primary ) || m_secondary.matching( p, tr, primary );
+    }
+
+    // Accept modifier
+    template<typename Modifier>
+    void    accept_modifier( Modifier const& m )
+    {
+        m_primary.accept_modifier( m );
+        m_secondary.accept_modifier( m );
+    }
+
+protected:
+    BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~dual_id_policy() {}
+
+    // Data members
+    PrimaryId       m_primary;
+    SecondId        m_secondary;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/id_policy.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_ID_POLICY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/id_policy.ipp b/ndnboost/test/utils/runtime/cla/id_policy.ipp
new file mode 100644
index 0000000..6d2c2f4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/id_policy.ipp
@@ -0,0 +1,118 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : some generic identification policies implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ID_POLICY_IPP_062904GER
+#define BOOST_RT_CLA_ID_POLICY_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************              basic_naming_policy             ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE void
+basic_naming_policy::usage_info( format_stream& fs ) const
+{
+    fs << p_prefix << p_name << p_separator;
+
+    if( p_separator->empty() )
+        fs << BOOST_RT_PARAM_LITERAL( ' ' );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_prefix( argv_traverser& tr ) const
+{
+    if( !tr.match_front( p_prefix.get() ) )
+        return false;
+
+    tr.trim( p_prefix->size() );
+    return true;
+}
+
+//____________________________________________________________________________//
+    
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_name( argv_traverser& tr ) const
+{
+    if( !tr.match_front( p_name.get() ) )
+        return false;
+
+    tr.trim( p_name->size() );
+    return true;
+}
+
+//____________________________________________________________________________//
+    
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_separator( argv_traverser& tr, bool optional_value ) const
+{
+    if( p_separator->empty() ) {
+        if( !tr.token().is_empty() )
+            return false;
+
+        tr.trim( 1 );
+    }
+    else {
+        if( !tr.match_front( p_separator.get() ) ) {
+            // if parameter has optional value separator is optional as well
+            if( optional_value && ( tr.eoi() || tr.match_front( ' ' ) ) ) {
+                return true;
+            }
+            return false;
+        }
+
+        tr.trim( p_separator->size() );
+    }
+
+    return true;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::matching( parameter const& p, argv_traverser& tr, bool ) const
+{
+    if( !match_prefix( tr ) )
+        return false;
+        
+    if( !match_name( tr ) )
+        return false;
+
+    if( !match_separator( tr, p.p_optional_value ) )
+        return false;
+
+    return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ID_POLICY_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp b/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp
new file mode 100644
index 0000000..84c1e40
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp
@@ -0,0 +1,51 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : defines interface for argument_factory
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
+#define BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************                argument_factory              ************** //
+// ************************************************************************** //
+// another name can be argument production policy
+
+class argument_factory {
+public:
+    // Argument factory interface
+    virtual argument_ptr produce_using( parameter& p, argv_traverser& tr ) = 0;  /// produce argument based on input
+    virtual argument_ptr produce_using( parameter& p, parser const& )      = 0;  /// produce argument based on internal generator and/or values of other parameters
+    virtual void         argument_usage_info( format_stream& fs )          = 0;  /// argument value format information
+protected:
+    BOOST_TEST_PROTECTED_VIRTUAL ~argument_factory() {}
+};
+
+} // namespace ndnboost
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace cla
+
+#endif // BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp b/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp
new file mode 100644
index 0000000..338f8d5
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp
@@ -0,0 +1,73 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : defines interface for identification_policy
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
+#define BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************             identification_policy            ************** //
+// ************************************************************************** //
+
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable:4244)
+#endif
+
+class identification_policy {
+public:
+    // Public properties
+    unit_test::readwrite_property<rtti::id_t>    p_type_id;
+
+    // Policy interface
+    virtual bool    responds_to( cstring name ) const = 0;
+    virtual cstring id_2_report() const = 0;
+    virtual void    usage_info( format_stream& fs ) const = 0;
+    virtual bool    matching( parameter const& p, argv_traverser& tr, bool primary ) const = 0;
+
+    virtual bool    conflict_with( identification_policy const& ) const = 0;
+
+protected:
+    // Constructor
+    explicit        identification_policy( rtti::id_t dyn_type )
+    : p_type_id( dyn_type )
+    {}
+    BOOST_TEST_PROTECTED_VIRTUAL ~identification_policy() {}
+};
+
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/modifier.hpp b/ndnboost/test/utils/runtime/cla/modifier.hpp
new file mode 100644
index 0000000..32719ab
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/modifier.hpp
@@ -0,0 +1,69 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : parameter modifiers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_MODIFIER_HPP_062604GER
+#define BOOST_RT_CLA_MODIFIER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/named_params.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************         environment variable modifiers       ************** //
+// ************************************************************************** //
+
+namespace {
+
+nfp::typed_keyword<bool,struct optional_t>              optional_m;
+nfp::named_parameter<bool,optional_t,bool>              optional( true );
+nfp::typed_keyword<bool,struct required_t>              required_m;
+nfp::named_parameter<bool,required_t,bool>              required( true );
+nfp::typed_keyword<bool,struct multiplicable_t>         multiplicable_m;
+nfp::named_parameter<bool,multiplicable_t,bool>         multiplicable( true );
+nfp::typed_keyword<bool,struct guess_name_t>            guess_name_m;
+nfp::named_parameter<bool,guess_name_t,bool>            guess_name( true );
+nfp::typed_keyword<bool,struct ignore_mismatch_t>       ignore_mismatch_m;
+nfp::named_parameter<bool,ignore_mismatch_t,bool>       ignore_mismatch( true );
+nfp::typed_keyword<bool,struct optional_value_t>        optional_value_m;
+nfp::named_parameter<bool,optional_value_t,bool>        optional_value( true );
+
+nfp::typed_keyword<char_type,struct input_separator_t>  input_separator;
+nfp::typed_keyword<cstring,struct prefix_t>             prefix;
+nfp::typed_keyword<cstring,struct name_t>               name;
+nfp::typed_keyword<cstring,struct separator_t>          separator;
+nfp::typed_keyword<cstring,struct description_t>        description;
+nfp::typed_keyword<cstring,struct refer_to_t>           default_refer_to;
+
+nfp::keyword<struct default_value_t>                    default_value;
+nfp::keyword<struct handler_t>                          handler;
+nfp::keyword<struct interpreter_t>                      interpreter;
+nfp::keyword<struct assign_to_t>                        assign_to;
+
+} // local namespace
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_MODIFIER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/named_parameter.hpp b/ndnboost/test/utils/runtime/cla/named_parameter.hpp
new file mode 100644
index 0000000..28f03b4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/named_parameter.hpp
@@ -0,0 +1,93 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : defines model of named parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/basic_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************              string_name_policy              ************** //
+// ************************************************************************** //
+
+class string_name_policy : public basic_naming_policy {
+public:
+    // Constructor
+    string_name_policy();
+    BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~string_name_policy() {}
+
+    // policy interface
+    virtual bool    responds_to( cstring name ) const;
+    virtual bool    conflict_with( identification_policy const& ) const;
+
+    // Accept modifier
+    template<typename Modifier>
+    void            accept_modifier( Modifier const& m )
+    {
+        basic_naming_policy::accept_modifier( m );
+
+        if( m.has( guess_name_m ) )
+            m_guess_name = true;
+    }
+
+private:
+    // Naming policy interface
+    virtual bool    match_name( argv_traverser& tr ) const;
+
+    // Data members
+    bool            m_guess_name;
+};
+
+// ************************************************************************** //
+// **************         runtime::cla::named_parameter        ************** //
+// ************************************************************************** //
+
+template<typename T>
+class named_parameter_t : public basic_parameter<T,string_name_policy> {
+    typedef basic_parameter<T,string_name_policy> base;
+public:
+    // Constructors
+    explicit    named_parameter_t( cstring name ) : base( name ) {}
+};
+
+//____________________________________________________________________________//
+
+BOOST_RT_CLA_NAMED_PARAM_GENERATORS( named_parameter )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/named_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/named_parameter.ipp b/ndnboost/test/utils/runtime/cla/named_parameter.ipp
new file mode 100644
index 0000000..1d77018
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/named_parameter.ipp
@@ -0,0 +1,129 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : implements model of named parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/named_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/algorithm.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************              string_name_policy              ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE 
+string_name_policy::string_name_policy()
+: basic_naming_policy( rtti::type_id<string_name_policy>() )
+, m_guess_name( false )
+{
+    assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::responds_to( cstring name ) const
+{
+    std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
+
+    mm_pos = unit_test::mismatch( name.begin(), name.end(), p_name->begin(), p_name->end() );
+
+    return mm_pos.first == name.end() && (m_guess_name || (mm_pos.second == p_name->end()) );
+}
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable:4244)
+#endif
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::conflict_with( identification_policy const& id ) const
+{
+    if( id.p_type_id == p_type_id ) {
+        string_name_policy const& snp = static_cast<string_name_policy const&>( id );
+
+        if( p_name->empty() || snp.p_name->empty() )
+            return false;
+
+        if( p_prefix != snp.p_prefix )
+            return false;
+
+        std::pair<dstring::const_iterator,dstring::const_iterator> mm_pos =
+            unit_test::mismatch( p_name->begin(), p_name->end(), snp.p_name->begin(), snp.p_name->end() );
+
+        return mm_pos.first != p_name->begin()                              &&  // there is common substring
+                ((m_guess_name    && (mm_pos.second == snp.p_name->end()) ) ||  // that match other guy and I am guessing
+                (snp.m_guess_name && (mm_pos.first  == p_name->end()) ));       // or me and the other guy is
+    }
+    
+    if( id.p_type_id == rtti::type_id<char_name_policy>() ) {
+        char_name_policy const& cnp = static_cast<char_name_policy const&>( id );
+
+        return m_guess_name                 && 
+               (p_prefix == cnp.p_prefix)   && 
+               unit_test::first_char( cstring( p_name ) ) == unit_test::first_char( cstring( cnp.p_name ) );
+    }
+    
+    return false;    
+}
+
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::match_name( argv_traverser& tr ) const
+{
+    if( !m_guess_name )
+        return basic_naming_policy::match_name( tr );
+
+    cstring in = tr.input();
+
+    std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
+    
+    mm_pos = unit_test::mismatch( in.begin(), in.end(), p_name->begin(), p_name->end() );
+
+    if( mm_pos.first == in.begin() )
+        return false;
+
+    tr.trim( mm_pos.first - in.begin() );
+
+    return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/parameter.hpp b/ndnboost/test/utils/runtime/cla/parameter.hpp
new file mode 100644
index 0000000..36edbb6
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parameter.hpp
@@ -0,0 +1,150 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 81913 $
+//
+//  Description : defines model of formal parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/parameter.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp>
+#include <ndnboost/test/utils/runtime/cla/iface/id_policy.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************            runtime::cla::parameter           ************** //
+// ************************************************************************** //
+
+class parameter : public BOOST_RT_PARAM_NAMESPACE::parameter {
+public:
+    parameter( identification_policy& ID, argument_factory& F, bool optional_value = false )
+    : p_optional( false )
+    , p_multiplicable( false )
+    , p_optional_value( optional_value )
+    , m_id_policy( ID )
+    , m_arg_factory( F )
+    {}
+
+    // Destructor
+    virtual         ~parameter()                                {}
+
+    unit_test::readwrite_property<bool>      p_optional;
+    unit_test::readwrite_property<bool>      p_multiplicable;
+    unit_test::readwrite_property<bool>      p_optional_value;
+    unit_test::readwrite_property<dstring>   p_description;
+
+    // parameter properties modification
+    template<typename Modifier>
+    void            accept_modifier( Modifier const& m )
+    {
+        if( m.has( optional_m ) )
+            p_optional.value = true;
+
+        if( m.has( required_m ) )
+            p_optional.value = false;
+
+        if( m.has( multiplicable_m ) )
+            p_multiplicable.value = true;
+
+        if( m.has( optional_value_m ) )
+            p_optional_value.value = true;
+
+        nfp::optionally_assign( p_description.value, m, description );
+    }
+
+    // access methods
+    bool            has_argument() const                        { return m_actual_argument!=0; }
+    argument const& actual_argument() const                     { return *m_actual_argument; }
+    argument_ptr    actual_argument()                           { return m_actual_argument; }
+
+
+    // identification interface
+    bool            responds_to( cstring name ) const           { return m_id_policy.responds_to( name ); }
+    bool            conflict_with( parameter const& p ) const
+    {
+        return (id_2_report() == p.id_2_report() && !id_2_report().is_empty())  ||
+               m_id_policy.conflict_with( p.m_id_policy )                       || 
+               ((m_id_policy.p_type_id != p.m_id_policy.p_type_id) && p.m_id_policy.conflict_with( m_id_policy ));
+    }
+    cstring         id_2_report() const                         { return m_id_policy.id_2_report(); }
+    void            usage_info( format_stream& fs ) const
+    { 
+        m_id_policy.usage_info( fs );
+        if( p_optional_value )
+            fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+        m_arg_factory.argument_usage_info( fs );
+
+        if( p_optional_value )
+            fs << BOOST_RT_PARAM_LITERAL( ']' );
+    }
+
+    // argument match/produce based on input
+    bool            matching( argv_traverser& tr, bool primary ) const
+    {
+        return m_id_policy.matching( *this, tr, primary );
+    }
+
+    // argument production based on different source
+    void            produce_argument( argv_traverser& tr )
+    {
+        m_id_policy.matching( *this, tr, true ); // !! can we save this position somehow
+        m_actual_argument = m_arg_factory.produce_using( *this, tr );
+    }
+    void            produce_argument( parser const& p )
+    {
+        m_actual_argument = m_arg_factory.produce_using( *this, p );
+    }
+
+private:
+    //Data members
+    identification_policy&  m_id_policy;
+    argument_factory&       m_arg_factory;
+    argument_ptr            m_actual_argument;
+};
+
+//____________________________________________________________________________//
+
+template<typename Parameter,typename Modifier>
+inline shared_ptr<Parameter>
+operator-( shared_ptr<Parameter> p, Modifier const& m )
+{
+    p->accept_modifier( m );
+
+    return p;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/parser.hpp b/ndnboost/test/utils/runtime/cla/parser.hpp
new file mode 100644
index 0000000..d98625c
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parser.hpp
@@ -0,0 +1,153 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : defines parser - public interface for CLA parsing and accessing
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARSER_HPP_062604GER
+#define BOOST_RT_CLA_PARSER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+// STL
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************             runtime::cla::parser             ************** //
+// ************************************************************************** //
+
+namespace cla_detail {
+
+template<typename Modifier>
+class global_mod_parser {
+public:
+    global_mod_parser( parser& p, Modifier const& m )
+    : m_parser( p )
+    , m_modifiers( m )
+    {}
+
+    template<typename Param>
+    global_mod_parser const&
+    operator<<( shared_ptr<Param> param ) const
+    {
+        param->accept_modifier( m_modifiers );
+
+        m_parser << param;
+
+        return *this;
+    }
+
+private:
+    // Data members;
+    parser&             m_parser;
+    Modifier const&     m_modifiers;
+};
+
+}
+
+// ************************************************************************** //
+// **************             runtime::cla::parser             ************** //
+// ************************************************************************** //
+
+class parser {
+public:
+    typedef std::list<parameter_ptr>::const_iterator param_iterator;
+
+    // Constructor
+    explicit            parser( cstring program_name = cstring() );
+
+    // parameter list construction interface
+    parser&             operator<<( parameter_ptr param );
+
+    // parser and global parameters modifiers
+    template<typename Modifier>
+    cla_detail::global_mod_parser<Modifier>
+    operator-( Modifier const& m )
+    {
+        nfp::optionally_assign( m_traverser.p_separator.value, m, input_separator );
+        nfp::optionally_assign( m_traverser.p_ignore_mismatch.value, m, ignore_mismatch_m );
+
+        return cla_detail::global_mod_parser<Modifier>( *this, m );
+    }
+
+    // input processing method
+    void                parse( int& argc, char_type** argv );
+
+    // parameters access
+    param_iterator      first_param() const;
+    param_iterator      last_param() const;
+
+    // arguments access
+    const_argument_ptr  operator[]( cstring string_id ) const;
+    cstring             get( cstring string_id ) const;    
+
+    template<typename T>
+    T const&            get( cstring string_id ) const
+    {
+        return arg_value<T>( valid_argument( string_id ) );
+    }
+
+    template<typename T>
+    void                get( cstring string_id, ndnboost::optional<T>& res ) const
+    {
+        const_argument_ptr actual_arg = (*this)[string_id];
+
+        if( actual_arg )
+            res = arg_value<T>( *actual_arg );
+        else
+            res.reset();
+    }
+
+    // help/usage
+    void                usage( out_stream& ostr );
+    void                help(  out_stream& ostr );
+
+private:
+    argument const&     valid_argument( cstring string_id ) const;
+
+    // Data members
+    argv_traverser              m_traverser;
+    std::list<parameter_ptr>    m_parameters;
+    dstring                     m_program_name;
+};
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/parser.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_PARSER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/parser.ipp b/ndnboost/test/utils/runtime/cla/parser.ipp
new file mode 100644
index 0000000..5be8503
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parser.ipp
@@ -0,0 +1,258 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : implements parser - public interface for CLA parsing and accessing
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARSER_IPP_062904GER
+#define BOOST_RT_CLA_PARSER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/cla/parser.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+
+// Boost
+#include <ndnboost/lexical_cast.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************             runtime::cla::parser             ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+parser::parser( cstring program_name )
+{
+    assign_op( m_program_name, program_name, 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser::param_iterator
+parser::first_param() const
+{
+    return m_parameters.begin();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser::param_iterator
+parser::last_param() const
+{
+    return m_parameters.end();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE argument const&
+parser::valid_argument( cstring string_id ) const
+{
+    const_argument_ptr arg = (*this)[string_id];
+
+    BOOST_RT_PARAM_VALIDATE_LOGIC( !!arg, "Actual argument for parameter " << string_id << " is not present" );
+
+    return *arg;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser&
+parser::operator<<( parameter_ptr new_param )
+{
+    BOOST_TEST_FOREACH( parameter_ptr, old_param, m_parameters ) {
+        BOOST_RT_PARAM_VALIDATE_LOGIC( !old_param->conflict_with( *new_param ),
+            BOOST_RT_PARAM_LITERAL( "Definition of parameter " )                << new_param->id_2_report() << 
+            BOOST_RT_PARAM_LITERAL( " conflicts with defintion of parameter " ) << old_param->id_2_report() );
+    }
+
+    m_parameters.push_back( new_param );
+
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::parse( int& argc, char_type** argv )
+{
+    if( m_program_name.empty() ) {
+        m_program_name.assign( argv[0] );
+        dstring::size_type pos = m_program_name.find_last_of( BOOST_RT_PARAM_LITERAL( "/\\" ) );
+
+        if( pos != static_cast<dstring::size_type>(cstring::npos) )
+            m_program_name.erase( 0, pos+1 );
+    }
+
+    m_traverser.init( argc, argv );
+
+    try {
+        while( !m_traverser.eoi() ) {
+            parameter_ptr found_param;
+
+            BOOST_RT_PARAM_TRACE( "Total " << m_parameters.size() << " parameters registered" );
+
+            BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+                BOOST_RT_PARAM_TRACE( "Try parameter " << curr_param->id_2_report() );
+
+                if( curr_param->matching( m_traverser, !found_param ) ) {
+                    BOOST_RT_PARAM_TRACE( "Match found" );
+                    BOOST_RT_CLA_VALIDATE_INPUT( !found_param, (m_traverser.rollback(),m_traverser), "Ambiguous input" );
+
+                    found_param = curr_param;
+                }
+
+                m_traverser.rollback();
+            }
+
+            if( !found_param ) {
+                BOOST_RT_PARAM_TRACE( "No match found" );
+                BOOST_RT_CLA_VALIDATE_INPUT( m_traverser.handle_mismatch(), m_traverser,
+                                             BOOST_RT_PARAM_LITERAL( "Unexpected input" ) );
+
+                continue;
+            }
+
+            BOOST_RT_PARAM_TRACE( "Parse argument value" );
+            found_param->produce_argument( m_traverser );
+
+            m_traverser.commit();
+        }
+
+        BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+            if( !curr_param->p_optional && !curr_param->actual_argument() ) {
+                curr_param->produce_argument( *this );
+
+                BOOST_RT_PARAM_VALIDATE_LOGIC( curr_param->actual_argument(),
+                    BOOST_RT_PARAM_LITERAL( "Required argument for parameter " ) << curr_param->id_2_report()
+                        << BOOST_RT_PARAM_LITERAL( " is missing" ) );
+            }
+        }
+    }
+    catch( bad_lexical_cast const& ) {
+        BOOST_RT_PARAM_REPORT_LOGIC_ERROR( 
+            BOOST_RT_PARAM_LITERAL( "String to value convertion error during input parsing" ) );
+    }
+
+    m_traverser.remainder( argc, argv );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE const_argument_ptr
+parser::operator[]( cstring string_id ) const
+{
+    parameter_ptr found_param;
+
+    BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+        if( curr_param->responds_to( string_id ) ) {
+            BOOST_RT_PARAM_VALIDATE_LOGIC( !found_param,
+                                           BOOST_RT_PARAM_LITERAL( "Ambiguous parameter string id: " ) << string_id );
+
+            found_param = curr_param;
+        }
+    }
+
+    return found_param ? found_param->actual_argument() : argument_ptr();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+parser::get( cstring string_id ) const
+{
+    return get<cstring>( string_id );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::usage( out_stream& ostr )
+{
+    if( m_program_name.empty() )
+        assign_op( m_program_name, BOOST_RT_PARAM_CSTRING_LITERAL( "<program>" ), 0 );
+
+    format_stream fs;
+
+    fs << m_program_name;
+
+    BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+        fs << BOOST_RT_PARAM_LITERAL( ' ' );
+
+        if( curr_param->p_optional )
+            fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+        curr_param->usage_info( fs );
+
+        if( curr_param->p_optional )
+            fs << BOOST_RT_PARAM_LITERAL( ']' );
+
+        if( curr_param->p_multiplicable ) {
+            fs << BOOST_RT_PARAM_CSTRING_LITERAL( " ... " );
+            
+            if( curr_param->p_optional )
+                fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+            curr_param->usage_info( fs );
+
+            if( curr_param->p_optional )
+                fs << BOOST_RT_PARAM_LITERAL( ']' );
+        }
+    }
+
+    ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "Usage:\n" ) << fs.str() << std::endl;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::help( out_stream& ostr )
+{
+    usage( ostr );
+
+    bool need_where = true;
+
+    BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+        if( curr_param->p_description->empty() )
+            continue;
+
+        if( need_where ) {
+            ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "where:\n" );
+            need_where = false;
+        }
+
+        ostr << curr_param->id_2_report() << BOOST_RT_PARAM_CSTRING_LITERAL( " - " ) << curr_param->p_description << std::endl;
+    }
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_PARSER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/typed_parameter.hpp b/ndnboost/test/utils/runtime/cla/typed_parameter.hpp
new file mode 100644
index 0000000..b8ad9e4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/typed_parameter.hpp
@@ -0,0 +1,70 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : generic typed parameter model
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/argument_factory.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************         runtime::cla::typed_parameter        ************** //
+// ************************************************************************** //
+
+template<typename T>
+class typed_parameter : public cla::parameter {
+public:
+    explicit typed_parameter( identification_policy& ID ) 
+    : cla::parameter( ID, m_arg_factory, rtti::type_id<T>() == rtti::type_id<bool>() ) 
+    {}
+
+    // parameter properties modification
+    template<typename Modifier>
+    void    accept_modifier( Modifier const& m )
+    {
+        cla::parameter::accept_modifier( m );
+
+        m_arg_factory.accept_modifier( m );
+
+        BOOST_RT_PARAM_VALIDATE_LOGIC( !p_optional || !m_arg_factory.m_value_generator,
+            BOOST_RT_PARAM_LITERAL( "can't define a value generator for optional parameter " ) << id_2_report() );
+    }
+
+private:
+    // Data members
+    typed_argument_factory<T>   m_arg_factory;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/validation.hpp b/ndnboost/test/utils/runtime/cla/validation.hpp
new file mode 100644
index 0000000..18c9b77
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/validation.hpp
@@ -0,0 +1,55 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : input validation helpers definition
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALIDATION_HPP_062604GER
+#define BOOST_RT_CLA_VALIDATION_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************       runtime::cla::report_input_error       ************** //
+// ************************************************************************** //
+
+void report_input_error( argv_traverser const& tr, format_stream& msg );
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_CLA_VALIDATE_INPUT( b, tr, msg ) \
+    if( b ) ; else ::ndnboost::BOOST_RT_PARAM_NAMESPACE::cla::report_input_error( tr, format_stream().ref() << msg )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#  define BOOST_RT_PARAM_INLINE inline
+#  include <ndnboost/test/utils/runtime/cla/validation.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_VALIDATION_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/validation.ipp b/ndnboost/test/utils/runtime/cla/validation.ipp
new file mode 100644
index 0000000..5d295d7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/validation.ipp
@@ -0,0 +1,65 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : input validation helpers implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALIDATION_IPP_070604GER
+#define BOOST_RT_CLA_VALIDATION_IPP_070604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp> // BOOST_RT_PARAM_NAMESPACE::logic_error
+
+// Boost
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// STL
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// **************           runtime::cla::validation           ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE void
+report_input_error( argv_traverser const& tr, format_stream& msg )
+{
+    if( tr.eoi() )
+        msg << BOOST_RT_PARAM_LITERAL( " at the end of input" );
+    else {
+        msg << BOOST_RT_PARAM_LITERAL( " in the following position: " );
+
+        if( tr.input().size() > 5 )
+            msg << tr.input().substr( 0, 5 ) << BOOST_RT_PARAM_LITERAL( "..." );
+        else
+            msg << tr.input();
+    }
+
+    throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALIDATION_IPP_070604GER
diff --git a/ndnboost/test/utils/runtime/cla/value_generator.hpp b/ndnboost/test/utils/runtime/cla/value_generator.hpp
new file mode 100644
index 0000000..d402977
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/value_generator.hpp
@@ -0,0 +1,81 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : specific value generators
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
+#define BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/parser.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// **************        runtime::cla::const_generator         ************** //
+// ************************************************************************** //
+
+template<typename T>
+class const_generator {
+public:
+    // Constructor
+    explicit    const_generator( T const& t ) : m_const_value( t ) {}
+
+    // generator interface
+    void        operator()( parser const&, ndnboost::optional<T>& t ) const   { t = m_const_value; }
+
+private:
+    // Data members
+    T           m_const_value;
+};
+
+// ************************************************************************** //
+// **************         runtime::cla::ref_generator          ************** //
+// ************************************************************************** //
+
+template<typename T>
+class ref_generator {
+public:
+    // Constructor
+    explicit    ref_generator( cstring ref_id ) : m_ref_id( ref_id ) {}
+
+    // generator interface
+    void        operator()( parser const& p, ndnboost::optional<T>& t ) const
+    {
+        p.get( m_ref_id, t );
+    }
+
+private:
+    // Data members
+    cstring     m_ref_id;
+};
+
+//____________________________________________________________________________//
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/value_handler.hpp b/ndnboost/test/utils/runtime/cla/value_handler.hpp
new file mode 100644
index 0000000..1d792ba
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/value_handler.hpp
@@ -0,0 +1,57 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : specific value handlers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
+#define BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// **************            runtime::cla::assigner            ************** //
+// ************************************************************************** //
+
+template<typename T>
+class assigner {
+public:
+    // Constructor
+    explicit    assigner( T& loc ) : m_target( loc )    {}
+
+    // value handler implementation
+    void        operator()( parameter const&, T& t )  { m_target = t; }
+
+private:
+    // Data members
+    T&          m_target;
+};
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/config.hpp b/ndnboost/test/utils/runtime/config.hpp
new file mode 100644
index 0000000..8067a96
--- /dev/null
+++ b/ndnboost/test/utils/runtime/config.hpp
@@ -0,0 +1,156 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : Runtime.Param library configuration
+// ***************************************************************************
+
+#ifndef BOOST_RT_CONFIG_HPP_062604GER
+#define BOOST_RT_CONFIG_HPP_062604GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4511) // copy constructor could not be generated
+# pragma warning(disable: 4512) // assignment operator could not be generated
+# pragma warning(disable: 4181) // qualifier applied to reference type; ignored
+# pragma warning(disable: 4675) // resolved overload was found by argument-dependent lookup
+#endif
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp> // operator<<(ndnboost::runtime::cstring)
+
+// STL
+#include <string>
+#include <cstdlib>
+
+//____________________________________________________________________________//
+
+#ifndef BOOST_RT_PARAM_CUSTOM_STRING
+#  ifndef BOOST_RT_PARAM_WIDE_STRING
+#    define BOOST_RT_PARAM_NAMESPACE                            runtime
+#  else
+#    define BOOST_RT_PARAM_NAMESPACE                            wide_runtime
+#  endif
+#endif
+
+#ifdef __SUNPRO_CC
+extern int putenv(char*);
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+#ifndef BOOST_RT_PARAM_CUSTOM_STRING
+#  ifndef BOOST_RT_PARAM_WIDE_STRING
+
+typedef char                                                    char_type;
+typedef std::string                                             dstring;
+typedef unit_test::const_string                                 cstring;
+typedef unit_test::literal_string                               literal_cstring;
+typedef wrap_stringstream                                       format_stream;
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+typedef std::ostream                                            out_stream;
+#else
+typedef std::basic_ostream<char_type>                           out_stream;
+#endif
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // putenv
+#endif
+
+#ifndef UNDER_CE
+#if defined(__COMO__) && 0
+inline void
+putenv_impl( cstring name, cstring value )
+{
+    using namespace std;
+    // !! this may actually fail. What should we do?
+    setenv( name.begin(), value.begin(), 1 );
+}
+#else
+inline void
+putenv_impl( cstring name, cstring value )
+{
+    format_stream fs;
+
+    fs << name << '=' << value;
+
+    // !! this may actually fail. What should we do?
+    // const_cast is used to satisfy putenv interface
+    using namespace std;
+    putenv( const_cast<char*>( fs.str().c_str() ) );
+}
+#endif
+#endif
+
+#ifdef BOOST_MSVC 
+#pragma warning(pop) 
+#endif 
+
+#define BOOST_RT_PARAM_LITERAL( l ) l
+#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
+#define BOOST_RT_PARAM_GETENV getenv
+#define BOOST_RT_PARAM_PUTENV ::ndnboost::BOOST_RT_PARAM_NAMESPACE::putenv_impl
+#define BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+
+//____________________________________________________________________________//
+
+#  else
+
+typedef wchar_t                                                 char_type;
+typedef std::basic_string<char_type>                            dstring;
+typedef unit_test::basic_cstring<wchar_t const>                 cstring;
+typedef const unit_test::basic_cstring<wchar_t const>           literal_cstring;
+typedef wrap_wstringstream                                      format_stream;
+typedef std::wostream                                           out_stream;
+
+#ifndef UNDER_CE
+inline void
+putenv_impl( cstring name, cstring value )
+{
+    format_stream fs;
+
+    fs << name << '=' << value;
+
+    // !! this may actually fail. What should we do?
+    // const_cast is used to satisfy putenv interface
+    using namespace std;
+    wputenv( const_cast<wchar_t*>( fs.str().c_str() ) );
+}
+#endif
+
+#define BOOST_RT_PARAM_LITERAL( l ) L ## l
+#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( L ## l, sizeof( L ## l )/sizeof(wchar_t) - 1 )
+#define BOOST_RT_PARAM_GETENV wgetenv
+#define BOOST_RT_PARAM_PUTENV putenv_impl
+
+#  endif
+#endif
+
+#ifdef __GNUC__
+#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL virtual
+#else
+#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL
+#endif
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CONFIG_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/environment.hpp b/ndnboost/test/utils/runtime/env/environment.hpp
new file mode 100644
index 0000000..b45f10f
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/environment.hpp
@@ -0,0 +1,172 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : defines and implements inline model of program environment 
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
+#define BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+#include <ndnboost/test/utils/runtime/interpret_argument_value.hpp>
+
+#include <ndnboost/test/utils/runtime/env/fwd.hpp>
+#include <ndnboost/test/utils/runtime/env/modifier.hpp>
+#include <ndnboost/test/utils/runtime/env/variable.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/callback.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// **************      runtime::environment implementation     ************** //
+// ************************************************************************** //
+
+namespace environment {
+
+namespace rt_env_detail {
+
+template<typename T, typename Modifiers>
+variable_data&
+init_new_var( cstring var_name, Modifiers m = nfp::no_params )
+{
+    rt_env_detail::variable_data& new_vd = new_var_record( var_name );
+
+    cstring str_value = sys_read_var( new_vd.m_var_name );
+
+    if( !str_value.is_empty() ) {
+        try {
+            ndnboost::optional<T> value;
+
+            if( m.has( interpreter ) )
+                m[interpreter]( str_value, value );
+            else
+                interpret_argument_value( str_value, value, 0 );
+
+            if( !!value ) {
+                new_vd.m_value.reset( new typed_argument<T>( new_vd ) );
+
+                arg_value<T>( *new_vd.m_value ) = *value;
+            }
+        }
+        catch( ... ) { // !! could we do that
+            // !! should we report an error?
+        }
+    }
+
+    if( !new_vd.m_value && m.has( default_value ) ) {
+        new_vd.m_value.reset( new typed_argument<T>( new_vd ) );
+
+        nfp::optionally_assign( arg_value<T>( *new_vd.m_value ), m[default_value] );
+    }
+
+    nfp::optionally_assign( new_vd.m_global_id, m, global_id );
+
+    return new_vd;
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_env_detail
+
+} // namespace environment
+
+// ************************************************************************** //
+// **************             runtime::environment             ************** //
+// ************************************************************************** //
+
+namespace environment {
+
+    // variable access
+    variable_base
+    var( cstring var_name );
+
+    //________________________________________________________________________//
+
+    template<typename T>
+    inline variable<T>
+    var( cstring var_name )
+    {
+        rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+        return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, nfp::no_params ) : *vd );
+    }
+
+    //________________________________________________________________________//
+
+    template<typename T, typename Modifiers>
+    inline variable<T>
+    var( cstring var_name, Modifiers const& m )
+    {
+        rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+        return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, m ) : *vd );
+    }
+
+    //________________________________________________________________________//
+
+    // direct variable value access
+    inline cstring
+    get( cstring var_name )
+    {
+        return environment::var<cstring>( var_name ).value();
+    }
+
+    //________________________________________________________________________//
+
+    template<typename T>
+    inline T const&
+    get( cstring var_name )
+    {
+        return environment::var<T>( var_name ).value();
+    }
+
+    //________________________________________________________________________//
+
+    template<typename T>
+    inline void
+    get( cstring var_name, ndnboost::optional<T>& res )
+    {
+        variable<T> const& v = environment::var<T>( var_name );
+        v.value( res );
+    }
+
+    //________________________________________________________________________//
+
+} // namespace environment
+
+namespace env = environment;
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#define BOOST_RT_PARAM_INLINE inline
+#include <ndnboost/test/utils/runtime/env/environment.ipp>
+
+#endif
+
+#endif // BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/environment.ipp b/ndnboost/test/utils/runtime/env/environment.ipp
new file mode 100644
index 0000000..f2929de
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/environment.ipp
@@ -0,0 +1,125 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : implements model of program environment 
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
+#define BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/env/variable.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// STL
+#include <map>
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// **************             runtime::environment             ************** //
+// ************************************************************************** //
+
+namespace rt_env_detail {
+
+typedef std::map<cstring,rt_env_detail::variable_data> registry;
+typedef std::list<dstring> keys;
+
+BOOST_RT_PARAM_INLINE registry& s_registry()    { static registry instance; return instance; }
+BOOST_RT_PARAM_INLINE keys&     s_keys()        { static keys instance; return instance; }
+
+BOOST_RT_PARAM_INLINE variable_data&
+new_var_record( cstring var_name )
+{
+    // save the name in list of keys
+    s_keys().push_back( dstring() );
+    dstring& key = s_keys().back();
+    assign_op( key, var_name, 0 );
+
+    // create and return new record
+    variable_data& new_var_data = s_registry()[key];
+    
+    new_var_data.m_var_name = key;
+    
+    return new_var_data;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE variable_data*
+find_var_record( cstring var_name )
+{
+    registry::iterator it = s_registry().find( var_name );
+
+    return it == s_registry().end() ? 0 : &(it->second);
+}
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_MSVC 
+#pragma warning(push) 
+#pragma warning(disable:4996) // getenv
+#endif
+
+BOOST_RT_PARAM_INLINE cstring
+sys_read_var( cstring var_name )
+{
+    using namespace std;
+    return BOOST_RT_PARAM_GETENV( var_name.begin() );
+}
+
+#ifdef BOOST_MSVC 
+#pragma warning(pop) 
+#endif
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+sys_write_var( cstring var_name, format_stream& var_value )
+{
+    BOOST_RT_PARAM_PUTENV( var_name, cstring( var_value.str() ) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_env_detail
+
+BOOST_RT_PARAM_INLINE variable_base
+var( cstring var_name )
+{
+    rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+    BOOST_RT_PARAM_VALIDATE_LOGIC( !!vd,
+                                   BOOST_RT_PARAM_LITERAL( "First access to the environment variable " ) 
+                                        << var_name << BOOST_RT_PARAM_LITERAL( " should be typed" ) );
+
+    return variable_base( *vd );
+}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/env/fwd.hpp b/ndnboost/test/utils/runtime/env/fwd.hpp
new file mode 100644
index 0000000..b869605
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/fwd.hpp
@@ -0,0 +1,54 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 54633 $
+//
+//  Description : environment subsystem forward declarations
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_FWD_HPP_062604GER
+#define BOOST_RT_ENV_FWD_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+class variable_base;
+variable_base var( cstring var_name );
+
+namespace rt_env_detail {
+
+struct variable_data;
+
+variable_data&  new_var_record( cstring var_name );
+variable_data*  find_var_record( cstring var_name );
+
+cstring         sys_read_var( cstring var_name );
+void            sys_write_var( cstring var_name, format_stream& var_value );
+
+}
+
+template <typename T> class variable;
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/modifier.hpp b/ndnboost/test/utils/runtime/env/modifier.hpp
new file mode 100644
index 0000000..a760368
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/modifier.hpp
@@ -0,0 +1,47 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  Use, modification, and distribution are subject to 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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : defines variable modifiers
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_MODIFIER_HPP_062604GER
+#define BOOST_RT_ENV_MODIFIER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/named_params.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// **************         environment variable modifiers       ************** //
+// ************************************************************************** //
+
+namespace {
+
+nfp::typed_keyword<cstring,struct global_id_t>   global_id;
+nfp::keyword<struct default_value_t>             default_value;
+nfp::keyword<struct interpreter_t>               interpreter;
+
+} // local namespace
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_MODIFIER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/variable.hpp b/ndnboost/test/utils/runtime/env/variable.hpp
new file mode 100644
index 0000000..17a4f39
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/variable.hpp
@@ -0,0 +1,223 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 81913 $
+//
+//  Description : defines model of program environment variable
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_VARIABLE_HPP_062604GER
+#define BOOST_RT_ENV_VARIABLE_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/parameter.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/env/fwd.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// **************      runtime::environment::variable_data     ************** //
+// ************************************************************************** //
+
+namespace rt_env_detail {
+
+struct variable_data : public runtime::parameter {
+    cstring         m_var_name;
+    dstring         m_global_id;
+    argument_ptr    m_value;
+};
+
+} // namespace rt_env_detail
+
+// ************************************************************************** //
+// **************     runtime::environment::variable_base      ************** //
+// ************************************************************************** //
+
+class variable_base {
+public:
+    explicit    variable_base( rt_env_detail::variable_data& data ) : m_data( &data ) {}
+
+    // arguments access
+    template<typename T>
+    T const&    value() const
+    {
+        return arg_value<T>( *m_data->m_value );
+    }
+
+    template<typename T>
+    void        value( ndnboost::optional<T>& res ) const
+    {
+        if( has_value() )
+            res = arg_value<T>( *m_data->m_value );
+        else
+            res.reset();
+    }
+
+    bool        has_value() const   { return m_data->m_value!=0; }
+    cstring     name() const        { return m_data->m_var_name; }
+
+protected:
+    // Data members
+    rt_env_detail::variable_data*  m_data;
+} ;
+
+// ************************************************************************** //
+// **************        runtime::environment::variable        ************** //
+// ************************************************************************** //
+
+template<typename T = cstring>
+class variable : public variable_base {
+public:
+    // Constructors
+    explicit    variable( cstring var_name );
+
+    template<typename Modifiers>
+    explicit    variable( cstring var_name, Modifiers const& m );
+
+    explicit    variable( rt_env_detail::variable_data& data ) 
+    : variable_base( data )                                 {}
+
+    // other variable assignment
+    void        operator=( variable const& v )              { m_data = v.m_data; }
+
+    // access methods
+    T const&    value() const                               { return variable_base::value<T>(); }
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) || \
+    BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0593))
+    template<typename T>
+    void        value( ndnboost::optional<T>& res ) const      { variable_base::value( res ); }
+#else
+    using       variable_base::value;
+#endif
+
+    // Value assignment
+    template<typename V>
+    void        operator=( V const& v )
+    {
+        if( !has_value() )
+            m_data->m_value.reset( new typed_argument<T>( *m_data ) );
+
+        arg_value<T>( *m_data->m_value ) = v;
+
+        rt_env_detail::sys_write_var( m_data->m_var_name, format_stream().ref() << value() );
+    }
+}; // class variable
+
+//____________________________________________________________________________//
+
+template<typename CharT, typename Tr,typename T>
+inline std::basic_ostream<CharT,Tr>&
+operator<<( std::basic_ostream<CharT,Tr>& os, variable<T> const& v )
+{
+    os << v.name() << '=';
+
+    if( v.has_value() )
+        os << v.value();
+
+    return os;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator==( variable<T> ev, V const& v )
+{
+    return ev.has_value() && ev.value() == v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator==( V const& v, variable<T> ev )
+{
+    return ev.has_value() && ev.value() == v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator!=( variable<T> ev, V const& v )
+{
+    return !ev.has_value() || ev.value() != v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator!=( V const& v, variable<T> ev )
+{
+    return !ev.has_value() || ev.value() != v;
+}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+// ************************************************************************** //
+// ************************************************************************** //
+// Implementation
+
+#include <ndnboost/test/utils/runtime/env/environment.hpp>
+
+// ************************************************************************** //
+// **************        runtime::environment::variable        ************** //
+// ************************************************************************** //
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+template<typename T>
+variable<T>::variable( cstring var_name )
+: variable_base( environment::var<T>( var_name ) )
+{}
+
+//____________________________________________________________________________//
+
+template<typename T>
+template<typename Modifiers>
+variable<T>::variable( cstring var_name, Modifiers const& m )
+: variable_base( environment::var<T>( var_name, m ) )
+{}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_VARIABLE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/fwd.hpp b/ndnboost/test/utils/runtime/fwd.hpp
new file mode 100644
index 0000000..3714bfc
--- /dev/null
+++ b/ndnboost/test/utils/runtime/fwd.hpp
@@ -0,0 +1,41 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : global framework level forward declaration
+// ***************************************************************************
+
+#ifndef BOOST_RT_FWD_HPP_062604GER
+#define BOOST_RT_FWD_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+class parameter;
+
+class argument;
+typedef shared_ptr<argument> argument_ptr;
+typedef shared_ptr<argument const> const_argument_ptr;
+
+template<typename T> class value_interpreter;
+template<typename T> class typed_argument;
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/interpret_argument_value.hpp b/ndnboost/test/utils/runtime/interpret_argument_value.hpp
new file mode 100644
index 0000000..4f5a214
--- /dev/null
+++ b/ndnboost/test/utils/runtime/interpret_argument_value.hpp
@@ -0,0 +1,163 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : default algorithms for string to specific type convertions
+// ***************************************************************************
+
+#ifndef BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
+#define BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+// !! could we eliminate these includes?
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// **************       runtime::interpret_argument_value      ************** //
+// ************************************************************************** //
+// returns true if source is used false otherwise
+
+// generic case
+template<typename T>
+struct interpret_argument_value_impl {
+    static bool _( cstring source, ndnboost::optional<T>& res )
+    {
+        BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<" << typeid(T).name() << ">" );
+
+        res = lexical_cast<T>( source );
+
+        BOOST_RT_PARAM_TRACE( "String " << source << " is interpreted as " << *res );
+        return true;
+    }
+};
+
+
+//____________________________________________________________________________//
+
+// dstring case
+template<>
+struct interpret_argument_value_impl<dstring> {
+    static bool _( cstring source, ndnboost::optional<dstring>& res )
+    {
+        BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<dstring>" );
+
+        res = dstring();
+        assign_op( *res, source, 0 );
+
+        return true;
+    }
+};
+
+//____________________________________________________________________________//
+
+// cstring case
+template<>
+struct interpret_argument_value_impl<cstring> {
+    static bool _( cstring source, ndnboost::optional<cstring>& res )
+    {
+        BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<cstring>" );
+
+        res = source;
+
+        return true;
+    }
+};
+
+//____________________________________________________________________________//
+
+// specialization for type bool
+template<>
+struct interpret_argument_value_impl<bool> {
+    static bool _( cstring source, ndnboost::optional<bool>& res )
+    {
+        BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<bool>" );
+
+        static literal_cstring YES( BOOST_RT_PARAM_CSTRING_LITERAL( "YES" ) );
+        static literal_cstring Y( BOOST_RT_PARAM_CSTRING_LITERAL( "Y" ) );
+        static literal_cstring NO( BOOST_RT_PARAM_CSTRING_LITERAL( "NO" ) );
+        static literal_cstring N( BOOST_RT_PARAM_CSTRING_LITERAL( "N" ) );
+        static literal_cstring one( BOOST_RT_PARAM_CSTRING_LITERAL( "1" ) );
+        static literal_cstring zero( BOOST_RT_PARAM_CSTRING_LITERAL( "0" ) );
+
+        source.trim();
+
+        if( case_ins_eq( source, YES ) || case_ins_eq( source, Y ) || case_ins_eq( source, one ) ) {
+            res = true;
+            return true;
+        }
+        else if( case_ins_eq( source, NO ) || case_ins_eq( source, N ) || case_ins_eq( source, zero ) ) {
+            res = false;
+            return true;
+        }
+        else {
+            res = true;
+            return false;
+        }
+    }
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline bool
+interpret_argument_value( cstring source, ndnboost::optional<T>& res, long )
+{
+    return interpret_argument_value_impl<T>::_( source, res );
+}
+
+//____________________________________________________________________________//
+
+// specialization for list of values
+template<typename T>
+inline bool
+interpret_argument_value( cstring source, ndnboost::optional<std::list<T> >& res, int )
+{
+    BOOST_RT_PARAM_TRACE( "In interpret_argument_value<std::list<T>>" );
+
+    res = std::list<T>();
+
+    while( !source.is_empty() ) {
+        // !! should we use token_iterator
+        cstring::iterator single_value_end = std::find( source.begin(), source.end(), BOOST_RT_PARAM_LITERAL( ',' ) );
+
+        ndnboost::optional<T> value;
+        interpret_argument_value( cstring( source.begin(), single_value_end ), value, 0 );
+
+        res->push_back( *value );
+
+        source.trim_left( single_value_end + 1 );
+    }
+
+    return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/parameter.hpp b/ndnboost/test/utils/runtime/parameter.hpp
new file mode 100644
index 0000000..2f6d1b7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/parameter.hpp
@@ -0,0 +1,38 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : abstract interface for the formal parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_PARAMETER_HPP_062604GER
+#define BOOST_RT_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// **************              runtime::parameter              ************** //
+// ************************************************************************** //
+
+class parameter {
+public:
+    virtual ~parameter() {}
+};
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/trace.hpp b/ndnboost/test/utils/runtime/trace.hpp
new file mode 100644
index 0000000..c71eb8e
--- /dev/null
+++ b/ndnboost/test/utils/runtime/trace.hpp
@@ -0,0 +1,30 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : optional internal tracing
+// ***************************************************************************
+
+#ifndef BOOST_RT_TRACE_HPP_062604GER
+#define BOOST_RT_TRACE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#ifdef BOOST_RT_PARAM_DEBUG
+
+#include <iostream>
+
+#  define BOOST_RT_PARAM_TRACE( str ) std::cerr << str << std::endl
+#else
+#  define BOOST_RT_PARAM_TRACE( str )
+#endif
+
+#endif // BOOST_RT_TRACE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/validation.hpp b/ndnboost/test/utils/runtime/validation.hpp
new file mode 100644
index 0000000..e794df9
--- /dev/null
+++ b/ndnboost/test/utils/runtime/validation.hpp
@@ -0,0 +1,82 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : defines exceptions and validation tools
+// ***************************************************************************
+
+#ifndef BOOST_RT_VALIDATION_HPP_062604GER
+#define BOOST_RT_VALIDATION_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+// STL
+#ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+#include <stdexcept>
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// **************             runtime::logic_error             ************** //
+// ************************************************************************** //
+
+class logic_error 
+#ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+: public std::exception
+#endif
+{
+    typedef shared_ptr<dstring> dstring_ptr;
+public:
+    // Constructor // !! could we eliminate shared_ptr
+    explicit    logic_error( cstring msg ) : m_msg( new dstring( msg.begin(), msg.size() ) ) {}
+    ~logic_error() throw()                          {}
+
+    dstring const&   msg() const                    { return *m_msg; }
+    virtual char_type const* what() const throw()   { return m_msg->c_str(); }
+
+private:
+    dstring_ptr m_msg;
+};
+
+// ************************************************************************** //
+// **************          runtime::report_logic_error         ************** //
+// ************************************************************************** //
+
+inline void
+report_logic_error( format_stream& msg )
+{
+    throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() );
+}
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_PARAM_REPORT_LOGIC_ERROR( msg ) \
+    ndnboost::BOOST_RT_PARAM_NAMESPACE::report_logic_error( format_stream().ref() << msg )
+
+#define BOOST_RT_PARAM_VALIDATE_LOGIC( b, msg ) \
+    if( b ) {} else BOOST_RT_PARAM_REPORT_LOGIC_ERROR( msg )
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_VALIDATION_HPP_062604GER
diff --git a/ndnboost/test/utils/trivial_singleton.hpp b/ndnboost/test/utils/trivial_singleton.hpp
new file mode 100644
index 0000000..6fba5c9
--- /dev/null
+++ b/ndnboost/test/utils/trivial_singleton.hpp
@@ -0,0 +1,74 @@
+//  (C) Copyright Gennadiy Rozental 2005-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : simple helpers for creating cusom output manipulators
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
+#define BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#include <ndnboost/noncopyable.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************                   singleton                  ************** //
+// ************************************************************************** //
+
+template<typename Derived>
+class singleton : private ndnboost::noncopyable {
+public:
+    static Derived& instance() { static Derived the_inst; return the_inst; }    
+protected:
+    singleton()  {}
+    ~singleton() {}
+};
+
+} // namespace unit_test
+
+#define BOOST_TEST_SINGLETON_CONS( type )       \
+friend class ndnboost::unit_test::singleton<type>; \
+type() {}                                       \
+/**/
+
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+template class unit_test::singleton< BOOST_JOIN( inst, _t ) > ; \
+namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
+
+#elif defined(__APPLE_CC__) && defined(__GNUC__) && __GNUC__ < 4
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+static BOOST_JOIN( inst, _t)& inst = BOOST_JOIN (inst, _t)::instance();
+
+#else
+
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
+
+#endif
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
diff --git a/ndnboost/test/utils/wrap_stringstream.hpp b/ndnboost/test/utils/wrap_stringstream.hpp
new file mode 100644
index 0000000..bd112e9
--- /dev/null
+++ b/ndnboost/test/utils/wrap_stringstream.hpp
@@ -0,0 +1,164 @@
+//  (C) Copyright Gennadiy Rozental 2002-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 49312 $
+//
+//  Description : wraps strstream and stringstream (depends with one is present)
+//                to provide the unified interface
+// ***************************************************************************
+
+#ifndef BOOST_WRAP_STRINGSTREAM_HPP_071894GER
+#define BOOST_WRAP_STRINGSTREAM_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// STL
+#ifdef BOOST_NO_STRINGSTREAM
+#include <strstream>        // for std::ostrstream
+#else
+#include <sstream>          // for std::ostringstream
+#endif // BOOST_NO_STRINGSTREAM
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+// ************************************************************************** //
+// **************            basic_wrap_stringstream           ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class basic_wrap_stringstream {
+public:
+#if defined(BOOST_CLASSIC_IOSTREAMS)
+    typedef std::ostringstream               wrapped_stream;
+#elif defined(BOOST_NO_STRINGSTREAM)
+    typedef std::basic_ostrstream<CharT>     wrapped_stream;
+#else
+    typedef std::basic_ostringstream<CharT>  wrapped_stream;
+#endif // BOOST_NO_STRINGSTREAM
+    // Access methods
+    basic_wrap_stringstream&        ref();
+    wrapped_stream&                 stream();
+    std::basic_string<CharT> const& str();
+
+private:
+    // Data members
+    wrapped_stream                  m_stream;
+    std::basic_string<CharT>        m_str;
+};
+
+//____________________________________________________________________________//
+
+template <typename CharT, typename T>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, T const& t )
+{
+    targ.stream() << t;
+    return targ;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline typename basic_wrap_stringstream<CharT>::wrapped_stream&
+basic_wrap_stringstream<CharT>::stream()
+{
+    return m_stream;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+basic_wrap_stringstream<CharT>::ref()
+{ 
+    return *this;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline std::basic_string<CharT> const&
+basic_wrap_stringstream<CharT>::str()
+{
+
+#ifdef BOOST_NO_STRINGSTREAM
+    m_str.assign( m_stream.str(), m_stream.pcount() );
+    m_stream.freeze( false );
+#else
+    m_str = m_stream.str();
+#endif
+
+    return m_str;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, basic_wrap_stringstream<CharT>& src )
+{
+    targ << src.str();
+    return targ;
+}
+
+//____________________________________________________________________________//
+
+#if BOOST_TEST_USE_STD_LOCALE 
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::ios_base& (BOOST_TEST_CALL_DECL *man)(std::ios_base&) )
+{
+    targ.stream() << man;
+    return targ;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT,typename Elem,typename Tr>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::basic_ostream<Elem,Tr>& (BOOST_TEST_CALL_DECL *man)(std::basic_ostream<Elem, Tr>&) )
+{
+    targ.stream() << man;
+    return targ;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT,typename Elem,typename Tr>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::basic_ios<Elem, Tr>& (BOOST_TEST_CALL_DECL *man)(std::basic_ios<Elem, Tr>&) )
+{
+    targ.stream() << man;
+    return targ;
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+// ************************************************************************** //
+// **************               wrap_stringstream              ************** //
+// ************************************************************************** //
+
+typedef basic_wrap_stringstream<char>       wrap_stringstream;
+typedef basic_wrap_stringstream<wchar_t>    wrap_wstringstream;
+
+}  // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif  // BOOST_WRAP_STRINGSTREAM_HPP_071894GER
diff --git a/ndnboost/test/utils/xml_printer.hpp b/ndnboost/test/utils/xml_printer.hpp
new file mode 100644
index 0000000..58ecc6b
--- /dev/null
+++ b/ndnboost/test/utils/xml_printer.hpp
@@ -0,0 +1,118 @@
+//  (C) Copyright Gennadiy Rozental 2004-2008.
+//  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)
+
+//  See http://www.boost.org/libs/test for the library home page.
+//
+//  File        : $RCSfile$
+//
+//  Version     : $Revision: 57992 $
+//
+//  Description : common code used by any agent serving as XML printer
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_PRINTER_HPP_071894GER
+#define BOOST_TEST_XML_PRINTER_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/fixed_mapping.hpp>
+#include <ndnboost/test/utils/custom_manip.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// Boost
+#include <ndnboost/config.hpp>
+
+// STL
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// **************               xml print helpers              ************** //
+// ************************************************************************** //
+
+inline void
+print_escaped( std::ostream& where_to, const_string value )
+{
+    static fixed_mapping<char,char const*> char_type(
+        '<' , "lt",
+        '>' , "gt",
+        '&' , "amp",
+        '\'', "apos" ,
+        '"' , "quot",
+
+        0
+    );
+
+    BOOST_TEST_FOREACH( char, c, value ) {
+        char const* ref = char_type[c];
+
+        if( ref )
+            where_to << '&' << ref << ';';
+        else
+            where_to << c;
+    }
+}
+
+//____________________________________________________________________________//
+
+inline void
+print_escaped( std::ostream& where_to, std::string const& value )
+{
+    print_escaped( where_to, const_string( value ) );
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline void
+print_escaped( std::ostream& where_to, T const& value )
+{
+    where_to << value;
+}
+
+//____________________________________________________________________________//
+
+typedef custom_manip<struct attr_value_t> attr_value;
+
+template<typename T>
+inline std::ostream&
+operator<<( custom_printer<attr_value> const& p, T const& value )
+{
+    *p << "=\"";
+    print_escaped( *p, value );
+    *p << '"';
+
+    return *p;
+}
+
+//____________________________________________________________________________//
+
+typedef custom_manip<struct cdata_t> cdata;
+
+inline std::ostream&
+operator<<( custom_printer<cdata> const& p, const_string value )
+{
+    return *p << BOOST_TEST_L( "<![CDATA[" ) << value << BOOST_TEST_L( "]]>" );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_PRINTER_HPP_071894GER
