Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49794 - in sandbox/itl: boost/itl libs/itl/build/win32 libs/itl/example/boost_party libs/itl_xt/test/auto_itv_test libs/itl_xt/test/meta_functors
From: afojgo_at_[hidden]
Date: 2008-11-16 11:23:21


Author: jofaber
Date: 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
New Revision: 49794
URL: http://svn.boost.org/trac/boost/changeset/49794

Log:
Added functor passing variants. Added temporary test-project vc9_meta_functors. Stable {msvc-9.0}

Added:
   sandbox/itl/libs/itl_xt/test/meta_functors/
   sandbox/itl/libs/itl_xt/test/meta_functors/meta_functors.cpp (contents, props changed)
   sandbox/itl/libs/itl_xt/test/meta_functors/vc9_meta_functors.vcproj (contents, props changed)
Text files modified:
   sandbox/itl/boost/itl/interval_base_map.hpp | 8 ++++++++
   sandbox/itl/libs/itl/build/win32/vc9_all.sln | 6 ++++++
   sandbox/itl/libs/itl/example/boost_party/boost_party.cpp | 17 ++++++++---------
   sandbox/itl/libs/itl_xt/test/auto_itv_test/auto_itv_test.cpp | 1 +
   4 files changed, 23 insertions(+), 9 deletions(-)

Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -355,6 +355,14 @@
     SubType& add(const value_type& x, const Combiner& combine)
     { that()->add_(x, combine); return *that(); };
 
+ template<class Combiner>
+ SubType& add(const value_type& x)
+ { that()->add_(x, mpl::apply<Combiner,CodomainT>::type()); return *that(); };
+
+ template<template<class>class Combiner>
+ SubType& add(const value_type& x)
+ { that()->add_(x, Combiner<CodomainT>()); return *that(); };
+
     /// Addition of a base value pair.
     /** Addition of a base value pair <tt>x := pair(k,y)</tt> where <tt>base_value_type:=pair<DomainT,CodomainT></tt>
     

Modified: sandbox/itl/libs/itl/build/win32/vc9_all.sln
==============================================================================
--- sandbox/itl/libs/itl/build/win32/vc9_all.sln (original)
+++ sandbox/itl/libs/itl/build/win32/vc9_all.sln 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -45,6 +45,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_month_and_week_grid", "..\..\example\month_and_week_grid\vc9_month_and_week_grid.vcproj", "{360BCFA9-9EB6-4D22-8469-CDC290478F78}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_meta_functors", "..\..\..\itl_xt\test\meta_functors\vc9_meta_functors.vcproj", "{EF64A2C7-DE78-46C2-953F-C4685A5D2A98}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -139,6 +141,10 @@
                 {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Debug|Win32.Build.0 = Debug|Win32
                 {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Release|Win32.ActiveCfg = Release|Win32
                 {360BCFA9-9EB6-4D22-8469-CDC290478F78}.Release|Win32.Build.0 = Release|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D2A98}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D2A98}.Debug|Win32.Build.0 = Debug|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D2A98}.Release|Win32.ActiveCfg = Release|Win32
+ {EF64A2C7-DE78-46C2-953F-C4685A5D2A98}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/itl/libs/itl/example/boost_party/boost_party.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/boost_party/boost_party.cpp (original)
+++ sandbox/itl/libs/itl/example/boost_party/boost_party.cpp 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -17,10 +17,12 @@
 
 #include <boost/itl/type_traits/to_string.hpp>
 #include <boost/itl/interval_map.hpp>
+#include <boost/mpl/placeholders.hpp>
 
 using namespace std;
 using namespace boost::posix_time;
 using namespace boost::itl;
+using namespace boost::mpl::placeholders;
 
 /** Example boost_party.cpp \file boost_party.cpp
 
@@ -111,31 +113,28 @@
 
     // adding an element can be done wrt. simple aggregate functions
     // like e.g. min, max etc. in their 'inplace' or op= incarnation
- tallest_guest.add(
+ tallest_guest.add<inplace_max<_> >(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 19:30"),
           time_from_string("2008-05-20 23:00")),
- 180),
- inplace_max<int>()
+ 180)
         );
 
- tallest_guest.add(
+ tallest_guest.add<inplace_max<_> >(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 20:10"),
           time_from_string("2008-05-21 00:00")),
- 170),
- inplace_max<int>()
+ 170)
         );
 
- tallest_guest.add(
+ tallest_guest.add<inplace_max<_> >(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 22:15"),
           time_from_string("2008-05-21 00:30")),
- 200),
- inplace_max<int>()
+ 200)
         );
 
 

Modified: sandbox/itl/libs/itl_xt/test/auto_itv_test/auto_itv_test.cpp
==============================================================================
--- sandbox/itl/libs/itl_xt/test/auto_itv_test/auto_itv_test.cpp (original)
+++ sandbox/itl/libs/itl_xt/test/auto_itv_test/auto_itv_test.cpp 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -1,4 +1,5 @@
 /*----------------------------------------------------------------------------+
+Copyright (c) 2007-2008: Joachim Faulhaber
 Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
 +-----------------------------------------------------------------------------+
 Boost Software License - Version 1.0 - August 17th, 2003

Added: sandbox/itl/libs/itl_xt/test/meta_functors/meta_functors.cpp
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl_xt/test/meta_functors/meta_functors.cpp 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------+
+Copyright (c) 2008-2008: Joachim Faulhaber
++-----------------------------------------------------------------------------+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
++----------------------------------------------------------------------------*/
+
+#include <iostream>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/placeholders.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::mpl::placeholders;
+
+template<class T>struct unary{
+ void speak(){ cout<<"unary"<<endl; }
+};
+
+template<class T, template<class>class U>
+struct unator1{
+ void speak(){U<T> obj; obj.speak();}
+};
+
+template<class T, class U>
+struct unator2{
+ void speak(){
+ mpl::apply<U,T>::type obj;
+ obj.speak();
+ }
+};
+
+//----------------------------------------
+template<class T1, class T2>struct binary{
+ void speak(){ cout<<"binary"<<endl; }
+};
+
+template<class T1, class T2,
+ template<class,class>class U>
+struct binator1{
+ void speak(){U<T1,T2> obj; obj.speak();}
+};
+
+template<class T1, class T2, class U>
+struct binator2{
+ void speak(){
+ mpl::apply2<U,T1,T2>::type obj;
+ obj.speak();
+ }
+};
+
+
+int main()
+{
+ cout << ">> Interval Template Library: Test meta_functors <<\n";
+ cout << "-------------------------------------------------------\n";
+
+ unator1<int, unary> untor1; untor1.speak();
+ unator2<int, unary<_> > untor2; untor2.speak();
+ binator1<int, int, binary> bintor1; bintor1.speak();
+ binator2<int, int, binary<_1,_2> > bintor2; bintor2.speak();
+
+ return 0;
+}
+

Added: sandbox/itl/libs/itl_xt/test/meta_functors/vc9_meta_functors.vcproj
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl_xt/test/meta_functors/vc9_meta_functors.vcproj 2008-11-16 11:23:20 EST (Sun, 16 Nov 2008)
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vc9_meta_functors"
+ ProjectGUID="{EF64A2C7-DE78-46C2-953F-C4685A5D2A98}"
+ RootNamespace="meta_functors"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../../../bin/debug"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/debug"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0; ../../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/debug/$(ProjectName).exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../../../bin/release"
+ IntermediateDirectory="../../../../bin/obj/$(ProjectName)/release"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../; ../../../../boost_1_35_0"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="../../../../bin/release/$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Quelldateien"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\meta_functors.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headerdateien"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\src\itl\interval_base_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\itl\interval_base_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\itl\interval_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\itl\interval.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\itvmaptester.h"
+ >
+ </File>
+ <File
+ RelativePath="..\itvsettester.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\itl\split_interval_map.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\itl\split_interval_set.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk