PageRenderTime 309ms CodeModel.GetById 17ms app.highlight 256ms RepoModel.GetById 4ms app.codeStats 3ms

/Src/Dependencies/Boost/boost/msm/front/euml/container.hpp

http://hadesmem.googlecode.com/
C++ Header | 4068 lines | 3829 code | 209 blank | 30 comment | 0 complexity | 928ae93525be5a40a884f3c64c405476 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1// Copyright 2008 Christophe Henry
   2// henry UNDERSCORE christophe AT hotmail DOT com
   3// This is an extended version of the state machine available in the boost::mpl library
   4// Distributed under the same license as the original.
   5// Copyright for the original version:
   6// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
   7// under the Boost Software License, Version 1.0. (See accompanying
   8// file LICENSE_1_0.txt or copy at
   9// http://www.boost.org/LICENSE_1_0.txt)
  10
  11#ifndef BOOST_MSM_FRONT_EUML_CONTAINER_H
  12#define BOOST_MSM_FRONT_EUML_CONTAINER_H
  13
  14#include <utility>
  15#include <boost/msm/front/euml/common.hpp>
  16#include <boost/utility/enable_if.hpp>
  17#include <boost/mpl/has_key.hpp>
  18#include <boost/mpl/set.hpp>
  19#include <boost/mpl/not.hpp>
  20#include <boost/msm/front/euml/operator.hpp>
  21#include <boost/type_traits.hpp>
  22
  23BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
  24
  25namespace boost { namespace msm { namespace front { namespace euml
  26{
  27
  28template <class T>
  29struct Front_ : euml_action<Front_<T> >
  30{
  31    template <class Event,class FSM,class STATE >
  32    struct state_action_result 
  33    {
  34        typedef typename get_reference< 
  35            typename ::boost::remove_reference<
  36                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  37    };
  38    template <class EVT,class FSM,class SourceState,class TargetState>
  39    struct transition_action_result 
  40    {
  41        typedef typename get_reference< 
  42            typename ::boost::remove_reference<
  43                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  44    };
  45    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  46
  47    template <class EVT,class FSM,class SourceState,class TargetState>
  48    typename ::boost::enable_if<
  49        typename ::boost::mpl::has_key<
  50            typename T::tag_type,action_tag>::type,
  51            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
  52        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  53    {
  54        return (T()(evt,fsm,src,tgt)).front();
  55    }
  56    template <class Event,class FSM,class STATE>
  57    typename ::boost::enable_if<
  58        typename ::boost::mpl::has_key<
  59            typename T::tag_type,state_action_tag>::type,
  60            typename state_action_result<Event,FSM,STATE>::type >::type 
  61        operator()(Event const& evt,FSM& fsm,STATE& state )const
  62    {
  63        return (T()(evt,fsm,state)).front();
  64    }
  65};
  66
  67struct front_tag {};
  68struct Front_Helper: proto::extends< proto::terminal<front_tag>::type, Front_Helper, sm_domain>
  69{
  70    Front_Helper(){}
  71    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
  72#ifdef BOOST_MSVC 
  73 ,class Arg6 
  74#endif
  75>
  76    struct In
  77    {
  78        typedef Front_<Arg1> type;
  79    };
  80};
  81Front_Helper const front_;
  82
  83template <class T>
  84struct Back_ : euml_action<Back_<T> >
  85{
  86    template <class Event,class FSM,class STATE >
  87    struct state_action_result 
  88    {
  89        typedef typename get_reference< 
  90            typename ::boost::remove_reference<
  91                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  92    };
  93    template <class EVT,class FSM,class SourceState,class TargetState>
  94    struct transition_action_result 
  95    {
  96        typedef typename get_reference< 
  97            typename ::boost::remove_reference<
  98                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  99    };
 100    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 101
 102    template <class EVT,class FSM,class SourceState,class TargetState>
 103    typename ::boost::enable_if<
 104        typename ::boost::mpl::has_key<
 105            typename T::tag_type,action_tag>::type,
 106            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 107        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 108    {
 109        return (T()(evt,fsm,src,tgt)).back();
 110    }
 111    template <class Event,class FSM,class STATE>
 112    typename ::boost::enable_if<
 113        typename ::boost::mpl::has_key<
 114            typename T::tag_type,state_action_tag>::type,
 115            typename state_action_result<Event,FSM,STATE>::type >::type 
 116        operator()(Event const& evt,FSM& fsm,STATE& state )const
 117    {
 118        return (T()(evt,fsm,state)).back();
 119    }
 120};
 121
 122struct back_tag {};
 123struct Back_Helper: proto::extends< proto::terminal<back_tag>::type, Back_Helper, sm_domain>
 124{
 125    Back_Helper(){}
 126    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 127#ifdef BOOST_MSVC 
 128 ,class Arg6 
 129#endif
 130>
 131    struct In
 132    {
 133        typedef Back_<Arg1> type;
 134    };
 135};
 136Back_Helper const back_;
 137
 138template <class T>
 139struct Begin_ : euml_action<Begin_<T> >
 140{
 141    template <class Event,class FSM,class STATE >
 142    struct state_action_result 
 143    {
 144        typedef typename get_iterator< 
 145            typename ::boost::remove_reference<
 146                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
 147    };
 148    template <class EVT,class FSM,class SourceState,class TargetState>
 149    struct transition_action_result 
 150    {
 151        typedef typename get_iterator< 
 152            typename ::boost::remove_reference<
 153                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 154    };
 155    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 156
 157    template <class EVT,class FSM,class SourceState,class TargetState>
 158    typename ::boost::enable_if<
 159        typename ::boost::mpl::has_key<
 160            typename T::tag_type,action_tag>::type,
 161            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 162        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 163    {
 164        return (T()(evt,fsm,src,tgt)).begin();
 165    }
 166    template <class Event,class FSM,class STATE>
 167    typename ::boost::enable_if<
 168        typename ::boost::mpl::has_key<
 169            typename T::tag_type,state_action_tag>::type,
 170            typename state_action_result<Event,FSM,STATE>::type >::type 
 171        operator()(Event const& evt,FSM& fsm,STATE& state )const
 172    {
 173        return (T()(evt,fsm,state)).begin();
 174    }
 175};
 176
 177struct begin_tag {};
 178struct Begin_Helper: proto::extends< proto::terminal<begin_tag>::type, Begin_Helper, sm_domain>
 179{
 180    Begin_Helper(){}
 181    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 182#ifdef BOOST_MSVC 
 183 ,class Arg6 
 184#endif
 185>
 186    struct In
 187    {
 188        typedef Begin_<Arg1> type;
 189    };
 190};
 191Begin_Helper const begin_;
 192
 193template <class T>
 194struct End_ : euml_action<End_<T> >
 195{
 196    template <class Event,class FSM,class STATE >
 197    struct state_action_result 
 198    {
 199        typedef typename get_iterator< 
 200            typename ::boost::remove_reference<
 201                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
 202    };
 203    template <class EVT,class FSM,class SourceState,class TargetState>
 204    struct transition_action_result 
 205    {
 206        typedef typename get_iterator< 
 207            typename ::boost::remove_reference<
 208                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 209    };
 210    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 211
 212    template <class EVT,class FSM,class SourceState,class TargetState>
 213    typename ::boost::enable_if<
 214        typename ::boost::mpl::has_key<
 215            typename T::tag_type,action_tag>::type,
 216            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 217        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 218    {
 219        return (T()(evt,fsm,src,tgt)).end();
 220    }
 221    template <class Event,class FSM,class STATE>
 222    typename ::boost::enable_if<
 223        typename ::boost::mpl::has_key<
 224            typename T::tag_type,state_action_tag>::type,
 225            typename state_action_result<Event,FSM,STATE>::type >::type 
 226        operator()(Event const& evt,FSM& fsm,STATE& state )const
 227    {
 228        return (T()(evt,fsm,state)).end();
 229    }
 230};
 231struct end_tag {};
 232struct End_Helper: proto::extends< proto::terminal<end_tag>::type, End_Helper, sm_domain>
 233{
 234    End_Helper(){}
 235    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 236#ifdef BOOST_MSVC 
 237 ,class Arg6 
 238#endif
 239>
 240    struct In
 241    {
 242        typedef End_<Arg1> type;
 243    };
 244};
 245End_Helper const end_;
 246
 247template <class T>
 248struct RBegin_ : euml_action<RBegin_<T> >
 249{
 250    template <class Event,class FSM,class STATE >
 251    struct state_action_result 
 252    {
 253        typedef typename get_reverse_iterator< 
 254            typename ::boost::remove_reference<
 255                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
 256    };
 257    template <class EVT,class FSM,class SourceState,class TargetState>
 258    struct transition_action_result 
 259    {
 260        typedef typename get_reverse_iterator< 
 261            typename ::boost::remove_reference<
 262                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 263    };
 264    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 265
 266    template <class EVT,class FSM,class SourceState,class TargetState>
 267    typename ::boost::enable_if<
 268        typename ::boost::mpl::has_key<
 269            typename T::tag_type,action_tag>::type,
 270            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 271        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 272    {
 273        return (T()(evt,fsm,src,tgt)).rbegin();
 274    }
 275    template <class Event,class FSM,class STATE>
 276    typename ::boost::enable_if<
 277        typename ::boost::mpl::has_key<
 278            typename T::tag_type,state_action_tag>::type,
 279            typename state_action_result<Event,FSM,STATE>::type >::type 
 280        operator()(Event const& evt,FSM& fsm,STATE& state )const
 281    {
 282        return (T()(evt,fsm,state)).rbegin();
 283    }
 284};
 285
 286struct rbegin_tag {};
 287struct RBegin_Helper: proto::extends< proto::terminal<rbegin_tag>::type, RBegin_Helper, sm_domain>
 288{
 289    RBegin_Helper(){}
 290    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 291#ifdef BOOST_MSVC 
 292 ,class Arg6 
 293#endif
 294>
 295    struct In
 296    {
 297        typedef RBegin_<Arg1> type;
 298    };
 299};
 300RBegin_Helper const rbegin_;
 301
 302template <class T>
 303struct REnd_ : euml_action<REnd_<T> >
 304{
 305    template <class Event,class FSM,class STATE >
 306    struct state_action_result 
 307    {
 308        typedef typename get_reverse_iterator< 
 309            typename ::boost::remove_reference<
 310                typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
 311    };
 312    template <class EVT,class FSM,class SourceState,class TargetState>
 313    struct transition_action_result 
 314    {
 315        typedef typename get_reverse_iterator< 
 316            typename ::boost::remove_reference<
 317                typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 318    };
 319    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 320
 321    template <class EVT,class FSM,class SourceState,class TargetState>
 322    typename ::boost::enable_if<
 323        typename ::boost::mpl::has_key<
 324            typename T::tag_type,action_tag>::type,
 325            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 326        operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 327    {
 328        return (T()(evt,fsm,src,tgt)).rend();
 329    }
 330    template <class Event,class FSM,class STATE>
 331    typename ::boost::enable_if<
 332        typename ::boost::mpl::has_key<
 333            typename T::tag_type,state_action_tag>::type,
 334            typename state_action_result<Event,FSM,STATE>::type >::type 
 335        operator()(Event const& evt,FSM& fsm,STATE& state )const
 336    {
 337        return (T()(evt,fsm,state)).rend();
 338    }
 339};
 340struct rend_tag {};
 341struct REnd_Helper: proto::extends< proto::terminal<rend_tag>::type, REnd_Helper, sm_domain>
 342{
 343    REnd_Helper(){}
 344    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 345#ifdef BOOST_MSVC 
 346 ,class Arg6 
 347#endif
 348>
 349    struct In
 350    {
 351        typedef REnd_<Arg1> type;
 352    };
 353};
 354REnd_Helper const rend_;
 355
 356template <class Container,class Element>
 357struct Push_Back_ : euml_action<Push_Back_<Container,Element> >
 358{
 359    template <class Event,class FSM,class STATE >
 360    struct state_action_result 
 361    {
 362        typedef void type;
 363    };
 364    template <class EVT,class FSM,class SourceState,class TargetState>
 365    struct transition_action_result 
 366    {
 367        typedef void type;
 368    };
 369    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 370
 371    template <class EVT,class FSM,class SourceState,class TargetState> 
 372    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 373    {
 374        (Container()(evt,fsm,src,tgt)).push_back(Element()(evt,fsm,src,tgt));
 375    }
 376    template <class Event,class FSM,class STATE>
 377    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 378    {
 379        (Container()(evt,fsm,state)).push_back(Element()(evt,fsm,state));        
 380    }
 381};
 382struct push_back_tag {};
 383struct Push_Back_Helper: proto::extends< proto::terminal<push_back_tag>::type, Push_Back_Helper, sm_domain>
 384{
 385    Push_Back_Helper(){}
 386    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 387#ifdef BOOST_MSVC 
 388 ,class Arg6 
 389#endif
 390>
 391    struct In
 392    {
 393        typedef Push_Back_<Arg1,Arg2> type;
 394    };
 395};
 396Push_Back_Helper const push_back_;
 397
 398template <class Container>
 399struct Pop_Back_ : euml_action<Pop_Back_<Container> >
 400{
 401    template <class Event,class FSM,class STATE >
 402    struct state_action_result 
 403    {
 404        typedef void type;
 405    };
 406    template <class EVT,class FSM,class SourceState,class TargetState>
 407    struct transition_action_result 
 408    {
 409        typedef void type;
 410    };
 411    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 412
 413    template <class EVT,class FSM,class SourceState,class TargetState> 
 414    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 415    {
 416        (Container()(evt,fsm,src,tgt)).pop_back();
 417    }
 418    template <class Event,class FSM,class STATE>
 419    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 420    {
 421        (Container()(evt,fsm,state)).pop_back();        
 422    }
 423};
 424struct pop_back_tag {};
 425struct Pop_Back_Helper: proto::extends< proto::terminal<pop_back_tag>::type, Pop_Back_Helper, sm_domain>
 426{
 427    Pop_Back_Helper(){}
 428    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 429#ifdef BOOST_MSVC 
 430 ,class Arg6 
 431#endif
 432>
 433    struct In
 434    {
 435        typedef Pop_Back_<Arg1> type;
 436    };
 437};
 438Pop_Back_Helper const pop_back_;
 439
 440template <class Container,class Element>
 441struct Push_Front_ : euml_action<Push_Front_<Container,Element> >
 442{
 443    template <class Event,class FSM,class STATE >
 444    struct state_action_result 
 445    {
 446        typedef void type;
 447    };
 448    template <class EVT,class FSM,class SourceState,class TargetState>
 449    struct transition_action_result 
 450    {
 451        typedef void type;
 452    };
 453    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 454
 455    template <class EVT,class FSM,class SourceState,class TargetState> 
 456    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 457    {
 458        (Container()(evt,fsm,src,tgt)).push_front(Element()(evt,fsm,src,tgt));
 459    }
 460    template <class Event,class FSM,class STATE>
 461    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 462    {
 463        (Container()(evt,fsm,state)).push_front(Element()(evt,fsm,state));        
 464    }
 465};
 466struct push_front_tag {};
 467struct Push_Front_Helper: proto::extends< proto::terminal<push_front_tag>::type, Push_Front_Helper, sm_domain>
 468{
 469    Push_Front_Helper(){}
 470    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 471#ifdef BOOST_MSVC 
 472 ,class Arg6 
 473#endif
 474>
 475    struct In
 476    {
 477        typedef Push_Front_<Arg1,Arg2> type;
 478    };
 479};
 480Push_Front_Helper const push_front_;
 481
 482template <class Container>
 483struct Pop_Front_ : euml_action<Pop_Front_<Container> >
 484{
 485    template <class Event,class FSM,class STATE >
 486    struct state_action_result 
 487    {
 488        typedef void type;
 489    };
 490    template <class EVT,class FSM,class SourceState,class TargetState>
 491    struct transition_action_result 
 492    {
 493        typedef void type;
 494    };
 495    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 496
 497    template <class EVT,class FSM,class SourceState,class TargetState> 
 498    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 499    {
 500        (Container()(evt,fsm,src,tgt)).pop_front();
 501    }
 502    template <class Event,class FSM,class STATE>
 503    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 504    {
 505        (Container()(evt,fsm,state)).pop_front();        
 506    }
 507};
 508struct pop_front_tag {};
 509struct Pop_Front_Helper: proto::extends< proto::terminal<pop_front_tag>::type, Pop_Front_Helper, sm_domain>
 510{
 511    Pop_Front_Helper(){}
 512    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 513#ifdef BOOST_MSVC 
 514 ,class Arg6 
 515#endif
 516>
 517    struct In
 518    {
 519        typedef Pop_Front_<Arg1> type;
 520    };
 521};
 522Pop_Front_Helper const pop_front_;
 523
 524template <class Container>
 525struct Clear_ : euml_action<Clear_<Container> >
 526{
 527    template <class Event,class FSM,class STATE >
 528    struct state_action_result 
 529    {
 530        typedef void type;
 531    };
 532    template <class EVT,class FSM,class SourceState,class TargetState>
 533    struct transition_action_result 
 534    {
 535        typedef void type;
 536    };
 537    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 538
 539    template <class EVT,class FSM,class SourceState,class TargetState> 
 540    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 541    {
 542        (Container()(evt,fsm,src,tgt)).clear();
 543    }
 544    template <class Event,class FSM,class STATE>
 545    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 546    {
 547        (Container()(evt,fsm,state)).clear();        
 548    }
 549};
 550struct clear_tag {};
 551struct Clear_Helper: proto::extends< proto::terminal<clear_tag>::type, Clear_Helper, sm_domain>
 552{
 553    Clear_Helper(){}
 554    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 555#ifdef BOOST_MSVC 
 556 ,class Arg6 
 557#endif
 558>
 559    struct In
 560    {
 561        typedef Clear_<Arg1> type;
 562    };
 563};
 564Clear_Helper const clear_;
 565
 566template <class Container>
 567struct ListReverse_ : euml_action<ListReverse_<Container> >
 568{
 569    template <class Event,class FSM,class STATE >
 570    struct state_action_result 
 571    {
 572        typedef void type;
 573    };
 574    template <class EVT,class FSM,class SourceState,class TargetState>
 575    struct transition_action_result 
 576    {
 577        typedef void type;
 578    };
 579    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 580
 581    template <class EVT,class FSM,class SourceState,class TargetState> 
 582    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 583    {
 584        (Container()(evt,fsm,src,tgt)).reverse();
 585    }
 586    template <class Event,class FSM,class STATE>
 587    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 588    {
 589        (Container()(evt,fsm,state)).reverse();        
 590    }
 591};
 592struct list_reverse_tag {};
 593struct ListReverse_Helper: proto::extends< proto::terminal<list_reverse_tag>::type, ListReverse_Helper, sm_domain>
 594{
 595    ListReverse_Helper(){}
 596    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 597#ifdef BOOST_MSVC 
 598 ,class Arg6 
 599#endif
 600>
 601    struct In
 602    {
 603        typedef ListReverse_<Arg1> type;
 604    };
 605};
 606ListReverse_Helper const list_reverse_;
 607
 608template <class Container, class Predicate, class Enable=void>
 609struct ListUnique_ : euml_action<ListUnique_<Container,Predicate,Enable> >
 610{
 611    template <class Event,class FSM,class STATE >
 612    struct state_action_result 
 613    {
 614        typedef void type;
 615    };
 616    template <class EVT,class FSM,class SourceState,class TargetState>
 617    struct transition_action_result 
 618    {
 619        typedef void type;
 620    };
 621    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 622
 623    template <class EVT,class FSM,class SourceState,class TargetState> 
 624    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 625    {
 626        (Container()(evt,fsm,src,tgt)).unique();
 627    }
 628    template <class Event,class FSM,class STATE>
 629    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 630    {
 631        (Container()(evt,fsm,state)).unique();        
 632    }
 633};
 634template <class Container, class Predicate >
 635struct ListUnique_<Container,Predicate,
 636               typename ::boost::disable_if<typename ::boost::is_same<Predicate,void>::type >::type> 
 637                    : euml_action<ListUnique_<Container,Predicate> >
 638{
 639    template <class Event,class FSM,class STATE >
 640    struct state_action_result 
 641    {
 642        typedef void type;
 643    };
 644    template <class EVT,class FSM,class SourceState,class TargetState>
 645    struct transition_action_result 
 646    {
 647        typedef void type;
 648    };
 649    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 650
 651    template <class EVT,class FSM,class SourceState,class TargetState> 
 652    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 653    {
 654        (Container()(evt,fsm,src,tgt)).unique(Predicate()(evt,fsm,src,tgt));
 655    }
 656    template <class Event,class FSM,class STATE>
 657    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 658    {
 659        (Container()(evt,fsm,state)).unique(Predicate()(evt,fsm,state));        
 660    }
 661};
 662struct list_unique_tag {};
 663struct ListUnique_Helper: proto::extends< proto::terminal<list_unique_tag>::type, ListUnique_Helper, sm_domain>
 664{
 665    ListUnique_Helper(){}
 666    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 667#ifdef BOOST_MSVC 
 668 ,class Arg6 
 669#endif
 670>
 671    struct In
 672    {
 673        typedef ListUnique_<Arg1,Arg2> type;
 674    };
 675};
 676ListUnique_Helper const list_unique_;
 677
 678template <class Container, class Predicate, class Enable=void>
 679struct ListSort_ : euml_action<ListSort_<Container,Predicate,Enable> >
 680{
 681    template <class Event,class FSM,class STATE >
 682    struct state_action_result 
 683    {
 684        typedef void type;
 685    };
 686    template <class EVT,class FSM,class SourceState,class TargetState>
 687    struct transition_action_result 
 688    {
 689        typedef void type;
 690    };
 691    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 692
 693    template <class EVT,class FSM,class SourceState,class TargetState> 
 694    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 695    {
 696        (Container()(evt,fsm,src,tgt)).sort();
 697    }
 698    template <class Event,class FSM,class STATE>
 699    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 700    {
 701        (Container()(evt,fsm,state)).sort();        
 702    }
 703};
 704template <class Container, class Predicate >
 705struct ListSort_<Container,Predicate,
 706               typename ::boost::disable_if<typename ::boost::is_same<Predicate,void>::type >::type> 
 707                    : euml_action<ListSort_<Container,Predicate> >
 708{
 709    template <class Event,class FSM,class STATE >
 710    struct state_action_result 
 711    {
 712        typedef void type;
 713    };
 714    template <class EVT,class FSM,class SourceState,class TargetState>
 715    struct transition_action_result 
 716    {
 717        typedef void type;
 718    };
 719    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 720
 721    template <class EVT,class FSM,class SourceState,class TargetState> 
 722    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 723    {
 724        (Container()(evt,fsm,src,tgt)).sort(Predicate()(evt,fsm,src,tgt));
 725    }
 726    template <class Event,class FSM,class STATE>
 727    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 728    {
 729        (Container()(evt,fsm,state)).sort(Predicate()(evt,fsm,state));        
 730    }
 731};
 732struct list_sort_tag {};
 733struct ListSort_Helper: proto::extends< proto::terminal<list_sort_tag>::type, ListSort_Helper, sm_domain>
 734{
 735    ListSort_Helper(){}
 736    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 737#ifdef BOOST_MSVC 
 738 ,class Arg6 
 739#endif
 740>
 741    struct In
 742    {
 743        typedef ListSort_<Arg1,Arg2> type;
 744    };
 745};
 746ListSort_Helper const list_sort_;
 747
 748template <class Container>
 749struct Capacity_ : euml_action<Capacity_<Container> >
 750{
 751    template <class Event,class FSM,class STATE >
 752    struct state_action_result 
 753    {
 754        typedef typename get_size_type< 
 755            typename ::boost::remove_reference<
 756                typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
 757    };
 758    template <class EVT,class FSM,class SourceState,class TargetState>
 759    struct transition_action_result 
 760    {
 761        typedef typename get_size_type< 
 762            typename ::boost::remove_reference<
 763                typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 764    };
 765    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 766
 767    template <class EVT,class FSM,class SourceState,class TargetState>
 768    typename ::boost::enable_if<
 769        typename ::boost::mpl::has_key<
 770            typename Container::tag_type,action_tag>::type,
 771            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 772     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 773    {
 774        return (Container()(evt,fsm,src,tgt)).capacity();
 775    }
 776    template <class Event,class FSM,class STATE>
 777    typename ::boost::enable_if<
 778        typename ::boost::mpl::has_key<
 779            typename Container::tag_type,state_action_tag>::type,
 780            typename state_action_result<Event,FSM,STATE>::type >::type 
 781     operator()(Event const& evt,FSM& fsm,STATE& state )const
 782    {
 783        return (Container()(evt,fsm,state)).capacity();        
 784    }
 785};
 786struct capacity_tag {};
 787struct Capacity_Helper: proto::extends< proto::terminal<capacity_tag>::type, Capacity_Helper, sm_domain>
 788{
 789    Capacity_Helper(){}
 790    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 791#ifdef BOOST_MSVC 
 792 ,class Arg6 
 793#endif
 794>
 795    struct In
 796    {
 797        typedef Capacity_<Arg1> type;
 798    };
 799};
 800Capacity_Helper const capacity_;
 801
 802template <class Container>
 803struct Size_ : euml_action<Size_<Container> >
 804{
 805    template <class Event,class FSM,class STATE >
 806    struct state_action_result 
 807    {
 808        typedef typename get_size_type< 
 809            typename ::boost::remove_reference<
 810                typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
 811    };
 812    template <class EVT,class FSM,class SourceState,class TargetState>
 813    struct transition_action_result 
 814    {
 815        typedef typename get_size_type< 
 816            typename ::boost::remove_reference<
 817                typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 818    };
 819    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 820
 821    template <class EVT,class FSM,class SourceState,class TargetState>
 822    typename ::boost::enable_if<
 823        typename ::boost::mpl::has_key<
 824            typename Container::tag_type,action_tag>::type,
 825            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 826     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 827    {
 828        return (Container()(evt,fsm,src,tgt)).size();
 829    }
 830    template <class Event,class FSM,class STATE>
 831    typename ::boost::enable_if<
 832        typename ::boost::mpl::has_key<
 833            typename Container::tag_type,state_action_tag>::type,
 834            typename state_action_result<Event,FSM,STATE>::type >::type 
 835     operator()(Event const& evt,FSM& fsm,STATE& state )const
 836    {
 837        return (Container()(evt,fsm,state)).size();        
 838    }
 839};
 840struct size_tag {};
 841struct Size_Helper: proto::extends< proto::terminal<size_tag>::type, Size_Helper, sm_domain>
 842{
 843    Size_Helper(){}
 844    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 845#ifdef BOOST_MSVC 
 846 ,class Arg6 
 847#endif
 848>
 849    struct In
 850    {
 851        typedef Size_<Arg1> type;
 852    };
 853};
 854Size_Helper const size_;
 855
 856template <class Container>
 857struct Max_Size_ : euml_action<Max_Size_<Container> >
 858{
 859    template <class Event,class FSM,class STATE >
 860    struct state_action_result 
 861    {
 862        typedef typename get_size_type< 
 863            typename ::boost::remove_reference<
 864                typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
 865    };
 866    template <class EVT,class FSM,class SourceState,class TargetState>
 867    struct transition_action_result 
 868    {
 869        typedef typename get_size_type< 
 870            typename ::boost::remove_reference<
 871                typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
 872    };
 873    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 874
 875    template <class EVT,class FSM,class SourceState,class TargetState>
 876    typename ::boost::enable_if<
 877        typename ::boost::mpl::has_key<
 878            typename Container::tag_type,action_tag>::type,
 879            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
 880     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 881    {
 882        return (Container()(evt,fsm,src,tgt)).max_size();
 883    }
 884    template <class Event,class FSM,class STATE>
 885    typename ::boost::enable_if<
 886        typename ::boost::mpl::has_key<
 887            typename Container::tag_type,state_action_tag>::type,
 888            typename state_action_result<Event,FSM,STATE>::type >::type 
 889     operator()(Event const& evt,FSM& fsm,STATE& state )const
 890    {
 891        return (Container()(evt,fsm,state)).max_size();        
 892    }
 893};
 894struct max_size_tag {};
 895struct Max_Size_Helper: proto::extends< proto::terminal<max_size_tag>::type, Max_Size_Helper, sm_domain>
 896{
 897    Max_Size_Helper(){}
 898    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 899#ifdef BOOST_MSVC 
 900 ,class Arg6 
 901#endif
 902>
 903    struct In
 904    {
 905        typedef Max_Size_<Arg1> type;
 906    };
 907};
 908Max_Size_Helper const max_size_;
 909
 910template <class Container, class Value>
 911struct Reserve_ : euml_action<Reserve_<Container,Value> >
 912{
 913    template <class Event,class FSM,class STATE >
 914    struct state_action_result 
 915    {
 916        typedef void type;
 917    };
 918    template <class EVT,class FSM,class SourceState,class TargetState>
 919    struct transition_action_result 
 920    {
 921        typedef void type;
 922    };
 923    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 924
 925    template <class EVT,class FSM,class SourceState,class TargetState> 
 926    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 927    {
 928        (Container()(evt,fsm,src,tgt)).reserve(Value()(evt,fsm,src,tgt));
 929    }
 930    template <class Event,class FSM,class STATE>
 931    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 932    {
 933        (Container()(evt,fsm,state)).reserve(Value()(evt,fsm,state));        
 934    }
 935};
 936struct reserve_tag {};
 937struct Reserve_Helper: proto::extends< proto::terminal<reserve_tag>::type, Reserve_Helper, sm_domain>
 938{
 939    Reserve_Helper(){}
 940    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
 941#ifdef BOOST_MSVC 
 942 ,class Arg6 
 943#endif
 944>
 945    struct In
 946    {
 947        typedef Reserve_<Arg1,Arg2> type;
 948    };
 949};
 950Reserve_Helper const reserve_;
 951
 952template <class Container, class Num, class Value ,class Enable=void >
 953struct Resize_ : euml_action<Resize_<Container,Num,Value> >
 954{
 955    template <class Event,class FSM,class STATE >
 956    struct state_action_result 
 957    {
 958        typedef void type;
 959    };
 960    template <class EVT,class FSM,class SourceState,class TargetState>
 961    struct transition_action_result 
 962    {
 963        typedef void type;
 964    };
 965    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 966
 967    template <class EVT,class FSM,class SourceState,class TargetState> 
 968    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 969    {
 970        (Container()(evt,fsm,src,tgt)).resize(Num()(evt,fsm,src,tgt));
 971    }
 972    template <class Event,class FSM,class STATE>
 973    void operator()(Event const& evt,FSM& fsm,STATE& state )const
 974    {
 975        (Container()(evt,fsm,state)).resize(Num()(evt,fsm,state));        
 976    }
 977};
 978template <class Container, class Num , class Value >
 979struct Resize_<Container,Num,Value,typename ::boost::disable_if<typename ::boost::is_same<Value,void>::type >::type> 
 980                    : euml_action<Resize_<Container,Num,Value> >
 981{
 982    template <class Event,class FSM,class STATE >
 983    struct state_action_result 
 984    {
 985        typedef void type;
 986    };
 987    template <class EVT,class FSM,class SourceState,class TargetState>
 988    struct transition_action_result 
 989    {
 990        typedef void type;
 991    };
 992    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
 993
 994    template <class EVT,class FSM,class SourceState,class TargetState> 
 995    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
 996    {
 997        (Container()(evt,fsm,src,tgt)).resize(Num()(evt,fsm,src,tgt),Value()(evt,fsm,src,tgt));
 998    }
 999    template <class Event,class FSM,class STATE>
1000    void operator()(Event const& evt,FSM& fsm,STATE& state )const
1001    {
1002        (Container()(evt,fsm,state)).resize(Num()(evt,fsm,state),Value()(evt,fsm,state));
1003    }
1004};
1005struct resize_tag {};
1006struct Resize_Helper: proto::extends< proto::terminal<resize_tag>::type, Resize_Helper, sm_domain>
1007{
1008    Resize_Helper(){}
1009    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1010#ifdef BOOST_MSVC 
1011 ,class Arg6 
1012#endif
1013>
1014    struct In
1015    {
1016        typedef Resize_<Arg1,Arg2,Arg3> type;
1017    };
1018};
1019Resize_Helper const resize_;
1020
1021// version for 3 parameters (sequence containers)
1022template <class Container, class Param1, class Param2, class Param3 >
1023struct Insert_ : euml_action<Insert_<Container,Param1,Param2,Param3> >
1024{
1025    template <class Event,class FSM,class STATE >
1026    struct state_action_result 
1027    {
1028        typedef void type;
1029    };
1030    template <class EVT,class FSM,class SourceState,class TargetState>
1031    struct transition_action_result 
1032    {
1033        typedef void type;
1034    };
1035    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1036
1037    template <class EVT,class FSM,class SourceState,class TargetState> 
1038    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1039    {
1040        (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
1041                                              Param3()(evt,fsm,src,tgt));
1042    }
1043    template <class Event,class FSM,class STATE>
1044    void operator()(Event const& evt,FSM& fsm,STATE& state )const
1045    {
1046        (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
1047                                            Param3()(evt,fsm,state));
1048    }
1049};
1050// version for 2 parameters
1051template <class Container, class Param1, class Param2>
1052struct Insert_ < Container,Param1,Param2,void>
1053    : euml_action<Insert_<Container,Param1,Param2,void> >
1054{
1055    // return value will actually not be correct for set::insert(it1,it2), should be void
1056    // but it's ok as nobody should call an inexistent return type
1057    template <class Event,class FSM,class STATE >
1058    struct state_action_result 
1059    {
1060        typedef typename get_iterator< 
1061            typename ::boost::remove_reference<
1062                typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
1063    };
1064    template <class EVT,class FSM,class SourceState,class TargetState>
1065    struct transition_action_result 
1066    {
1067        typedef typename get_iterator< 
1068            typename ::boost::remove_reference<
1069                typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
1070    };
1071    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1072
1073    // version for transition + second param not an iterator (meaning that, Container is not an associative container)
1074    template <class EVT,class FSM,class SourceState,class TargetState>
1075    typename ::boost::enable_if<
1076        typename ::boost::mpl::and_<
1077            typename ::boost::mpl::has_key<
1078                typename Container::tag_type,action_tag>::type,
1079                typename ::boost::mpl::not_<
1080                    typename has_iterator_category<
1081                        typename Param2::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
1082                    >::type
1083                   >::type
1084                >::type,
1085            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type 
1086        >::type 
1087     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1088    {
1089        return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
1090    }
1091
1092    // version for transition + second param is an iterator (meaning that, Container is an associative container)
1093    template <class EVT,class FSM,class SourceState,class TargetState>
1094    typename ::boost::enable_if<
1095        typename ::boost::mpl::and_<
1096            typename ::boost::mpl::has_key<
1097                typename Container::tag_type,action_tag>::type,
1098                    typename has_iterator_category<
1099                        typename Param2::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
1100                    >::type
1101                >::type,
1102            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type 
1103        >::type 
1104     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1105    {
1106        (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
1107    }
1108
1109    // version for state action + second param not an iterator (meaning that, Container is not an associative container)
1110    template <class Event,class FSM,class STATE>
1111    typename ::boost::enable_if<
1112        typename ::boost::mpl::and_<
1113            typename ::boost::mpl::has_key<
1114                typename Container::tag_type,state_action_tag>::type,
1115                typename ::boost::mpl::not_<
1116                    typename has_iterator_category<
1117                        typename Param2::template state_action_result<Event,FSM,STATE>::type
1118                    >::type
1119                   >::type
1120                >::type,
1121            typename state_action_result<Event,FSM,STATE>::type 
1122        >::type  
1123     operator()(Event const& evt,FSM& fsm,STATE& state )const
1124    {
1125        return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state));        
1126    }
1127
1128    // version for state action + second param is an iterator (meaning that, Container is an associative container)
1129    template <class Event,class FSM,class STATE>
1130    typename ::boost::enable_if<
1131        typename ::boost::mpl::and_<
1132            typename ::boost::mpl::has_key<
1133                typename Container::tag_type,state_action_tag>::type,
1134                    typename has_iterator_category<
1135                        typename Param2::template state_action_result<Event,FSM,STATE>::type
1136                    >::type
1137                >::type,
1138            typename state_action_result<Event,FSM,STATE>::type 
1139        >::type 
1140     operator()(Event const& evt,FSM& fsm,STATE& state )const
1141    {
1142        (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state));        
1143    }
1144};
1145
1146// version for 1 parameter (associative containers)
1147template <class Container, class Param1>
1148struct Insert_ < Container,Param1,void,void>
1149    : euml_action<Insert_<Container,Param1,void,void> >
1150{
1151    template <class Event,class FSM,class STATE >
1152    struct state_action_result 
1153    {
1154        typedef typename std::pair<
1155            typename get_iterator< 
1156                typename ::boost::remove_reference<
1157                    typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type,bool> type;
1158    };
1159    template <class EVT,class FSM,class SourceState,class TargetState>
1160    struct transition_action_result 
1161    {
1162        typedef typename std::pair<
1163            typename get_iterator< 
1164                typename ::boost::remove_reference<
1165                    typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type,bool> type;
1166    };
1167    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1168
1169    template <class EVT,class FSM,class SourceState,class TargetState>
1170    typename ::boost::enable_if<
1171        typename ::boost::mpl::has_key<
1172            typename Container::tag_type,action_tag>::type,
1173            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
1174     operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1175    {
1176        return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt));
1177    }
1178    template <class Event,class FSM,class STATE>
1179    typename ::boost::enable_if<
1180        typename ::boost::mpl::has_key<
1181            typename Container::tag_type,state_action_tag>::type,
1182            typename state_action_result<Event,FSM,STATE>::type >::type 
1183     operator()(Event const& evt,FSM& fsm,STATE& state )const
1184    {
1185        return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state));        
1186    }
1187};
1188struct insert_tag {};
1189struct Insert_Helper: proto::extends< proto::terminal<insert_tag>::type, Insert_Helper, sm_domain>
1190{
1191    Insert_Helper(){}
1192    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1193#ifdef BOOST_MSVC 
1194 ,class Arg6 
1195#endif
1196>
1197    struct In
1198    {
1199        typedef Insert_<Arg1,Arg2,Arg3,Arg4> type;
1200    };
1201};
1202Insert_Helper const insert_;
1203
1204template <class Container1,class Container2>
1205struct Swap_ : euml_action<Swap_<Container1,Container2> >
1206{
1207    template <class Event,class FSM,class STATE >
1208    struct state_action_result 
1209    {
1210        typedef void type;
1211    };
1212    template <class EVT,class FSM,class SourceState,class TargetState>
1213    struct transition_action_result 
1214    {
1215        typedef void type;
1216    };
1217    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1218
1219    template <class EVT,class FSM,class SourceState,class TargetState> 
1220    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1221    {
1222        (Container1()(evt,fsm,src,tgt)).swap(Container2()(evt,fsm,src,tgt));
1223    }
1224    template <class Event,class FSM,class STATE>
1225    void operator()(Event const& evt,FSM& fsm,STATE& state )const
1226    {
1227        (Container1()(evt,fsm,state)).swap(Container2()(evt,fsm,state));        
1228    }
1229};
1230struct swap_tag {};
1231struct Swap_Helper: proto::extends< proto::terminal<swap_tag>::type, Swap_Helper, sm_domain>
1232{
1233    Swap_Helper(){}
1234    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1235#ifdef BOOST_MSVC 
1236 ,class Arg6 
1237#endif
1238>
1239    struct In
1240    {
1241        typedef Swap_<Arg1,Arg2> type;
1242    };
1243};
1244Swap_Helper const swap_;
1245
1246template <class Container, class Iterator1, class Iterator2 ,class Enable=void >
1247struct Erase_ : euml_action<Erase_<Container,Iterator1,Iterator2> >
1248{
1249    template <class Event,class FSM,class STATE >
1250    struct state_action_result 
1251    {
1252        typedef typename get_result_type2<Iterator1,Event,FSM,STATE>::type type;
1253    };
1254    template <class EVT,class FSM,class SourceState,class TargetState>
1255    struct transition_action_result 
1256    {
1257        typedef typename get_result_type<Iterator1,EVT,FSM,SourceState,TargetState>::type type;
1258    };
1259    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1260
1261    template <class EVT,class FSM,class SourceState,class TargetState> 
1262    typename ::boost::enable_if<
1263        typename ::boost::mpl::has_key<
1264            typename Iterator1::tag_type,action_tag>::type,
1265            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
1266    operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1267    {
1268        return (Container()(evt,fsm,src,tgt)).erase(Iterator1()(evt,fsm,src,tgt));
1269    }
1270    template <class Event,class FSM,class STATE>
1271    typename ::boost::enable_if<
1272        typename ::boost::mpl::has_key<
1273            typename Iterator1::tag_type,state_action_tag>::type,
1274            typename state_action_result<Event,FSM,STATE>::type >::type 
1275    operator()(Event const& evt,FSM& fsm,STATE& state )const
1276    {
1277        return (Container()(evt,fsm,state)).erase(Iterator1()(evt,fsm,state));        
1278    }
1279};
1280template <class Container, class Iterator1 , class Iterator2 >
1281struct Erase_<Container,Iterator1,Iterator2,
1282              typename ::boost::disable_if<typename ::boost::is_same<Iterator2,void>::type >::type> 
1283                    : euml_action<Erase_<Container,Iterator1,Iterator2> >
1284{
1285    template <class Event,class FSM,class STATE >
1286    struct state_action_result 
1287    {
1288        typedef typename get_result_type2<Iterator1,Event,FSM,STATE>::type type;
1289    };
1290    template <class EVT,class FSM,class SourceState,class TargetState>
1291    struct transition_action_result 
1292    {
1293        typedef typename get_result_type<Iterator1,EVT,FSM,SourceState,TargetState>::type type;
1294    };
1295    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1296
1297    template <class EVT,class FSM,class SourceState,class TargetState> 
1298    typename ::boost::enable_if<
1299        typename ::boost::mpl::has_key<
1300            typename Iterator1::tag_type,action_tag>::type,
1301            typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type 
1302    operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1303    {
1304        return (Container()(evt,fsm,src,tgt)).erase(Iterator1()(evt,fsm,src,tgt),Iterator2()(evt,fsm,src,tgt));
1305    }
1306    template <class Event,class FSM,class STATE>
1307    typename ::boost::enable_if<
1308        typename ::boost::mpl::has_key<
1309            typename Iterator1::tag_type,state_action_tag>::type,
1310            typename state_action_result<Event,FSM,STATE>::type >::type 
1311    operator()(Event const& evt,FSM& fsm,STATE& state )const
1312    {
1313        return (Container()(evt,fsm,state)).erase(Iterator1()(evt,fsm,state),Iterator2()(evt,fsm,state));        
1314    }
1315};
1316struct erase_tag {};
1317struct Erase_Helper: proto::extends< proto::terminal<erase_tag>::type, Erase_Helper, sm_domain>
1318{
1319    Erase_Helper(){}
1320    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1321#ifdef BOOST_MSVC 
1322 ,class Arg6 
1323#endif
1324>
1325    struct In
1326    {
1327        typedef Erase_<Arg1,Arg2,Arg3> type;
1328    };
1329};
1330Erase_Helper const erase_;
1331
1332template <class Container>
1333struct Empty_ : euml_action<Empty_<Container> >
1334{
1335    template <class Event,class FSM,class STATE >
1336    struct state_action_result 
1337    {
1338        typedef bool type;
1339    };
1340    template <class EVT,class FSM,class SourceState,class TargetState>
1341    struct transition_action_result 
1342    {
1343        typedef bool type;
1344    };
1345    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1346
1347    template <class EVT,class FSM,class SourceState,class TargetState> 
1348    bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1349    {
1350        return (Container()(evt,fsm,src,tgt)).empty();
1351    }
1352    template <class Event,class FSM,class STATE>
1353    bool operator()(Event const& evt,FSM& fsm,STATE& state )const
1354    {
1355        return (Container()(evt,fsm,state)).empty();        
1356    }
1357};
1358struct empty_tag {};
1359struct Empty_Helper: proto::extends< proto::terminal<empty_tag>::type, Empty_Helper, sm_domain>
1360{
1361    Empty_Helper(){}
1362    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1363#ifdef BOOST_MSVC 
1364 ,class Arg6 
1365#endif
1366>
1367    struct In
1368    {
1369        typedef Empty_<Arg1> type;
1370    };
1371};
1372Empty_Helper const empty_;
1373
1374template <class Container,class Element>
1375struct ListRemove_ : euml_action<ListRemove_<Container,Element> >
1376{
1377    template <class Event,class FSM,class STATE >
1378    struct state_action_result 
1379    {
1380        typedef void type;
1381    };
1382    template <class EVT,class FSM,class SourceState,class TargetState>
1383    struct transition_action_result 
1384    {
1385        typedef void type;
1386    };
1387    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1388
1389    template <class EVT,class FSM,class SourceState,class TargetState> 
1390    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1391    {
1392        (Container()(evt,fsm,src,tgt)).remove(Element()(evt,fsm,src,tgt));
1393    }
1394    template <class Event,class FSM,class STATE>
1395    void operator()(Event const& evt,FSM& fsm,STATE& state )const
1396    {
1397        (Container()(evt,fsm,state)).remove(Element()(evt,fsm,state));        
1398    }
1399};
1400struct list_remove_tag {};
1401struct ListRemove_Helper: proto::extends< proto::terminal<list_remove_tag>::type, ListRemove_Helper, sm_domain>
1402{
1403    ListRemove_Helper(){}
1404    template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5 
1405#ifdef BOOST_MSVC 
1406 ,class Arg6 
1407#endif
1408>
1409    struct In
1410    {
1411        typedef ListRemove_<Arg1,Arg2> type;
1412    };
1413};
1414ListRemove_Helper const list_remove_;
1415
1416template <class Container,class Element>
1417struct ListRemove_If_ : euml_action<ListRemove_If_<Container,Element> >
1418{
1419    template <class Event,class FSM,class STATE >
1420    struct state_action_result 
1421    {
1422        typedef void type;
1423    };
1424    template <class EVT,class FSM,class SourceState,class TargetState>
1425    struct transition_action_result 
1426    {
1427        typedef void type;
1428    };
1429    typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1430
1431    template <class EVT,class FSM,class SourceState,class TargetState> 
1432    void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1433    {
1434        (Container()(evt,fsm,src,tgt)).remove_if(Element()(evt,fsm,src,tgt));
1435    }
1436    template <class Event,class FSM,class STATE>
1437    void operator()(Event const& evt,FSM& fsm,STATE& state )const
1438    {
1439        (Container()(evt,fsm,state)).remove_if(Element()(evt,fsm,state));        
1440    }
1441};
1442struct list_remove_if_tag {};
1443struct ListRemove_If_Helper: proto::extends< proto::terminal<list_remove_if_tag>::type, ListRemove_If_Helper, sm_domain>
1444{
1445    ListRemove_If_Helper(){}
1446    template <class Arg1

Large files files are truncated, but you can click here to view the full file