Adding more than 20 rows in transition table for Boost::MSM
Hi,
I tried defining:
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need
#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
/// Boost-MSM Includes
// back-end
#include "boost/mpl/vector/vector30.hpp"
#include
I’ve been able to successfully create larger MSM state machines. Are you *absolutely* sure that the defines are before *any* inclusion of Boost? I use Visual Studio. For me, this meant I had to include these defines at the top of my precompiled header include file.
---
Steve H.
From: Yechiel Levi [mailto:yechiel@fabrixsystems.com]
Sent: Monday, September 22, 2014 12:14 AM
To: boost-users@lists.boost.org
Subject: [Boost-users] Adding more than 20 rows in transition table for Boost::MSM
Hi,
I tried defining:
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need
#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
/// Boost-MSM Includes
// back-end
#include "boost/mpl/vector/vector30.hpp"
#include
As far as I remember MSM uses fusion under the hood for states, so FUSION_MAX_VECTOR_SIZE would have to be set as well. Kris On Mon, Sep 22, 2014 at 5:25 PM, Hickman, Steve (AdvTech) < Steve.Hickman@honeywell.com> wrote:
I’ve been able to successfully create larger MSM state machines. Are you **absolutely** sure that the defines are before **any** inclusion of Boost? I use Visual Studio. For me, this meant I had to include these defines at the top of my precompiled header include file.
---
Steve H.
*From:* Yechiel Levi [mailto:yechiel@fabrixsystems.com] *Sent:* Monday, September 22, 2014 12:14 AM *To:* boost-users@lists.boost.org *Subject:* [Boost-users] Adding more than 20 rows in transition table for Boost::MSM
Hi,
I tried defining:
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need
#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
/// Boost-MSM Includes
// back-end
#include "boost/mpl/vector/vector30.hpp"
#include
//front-end
#include
#include
#include
// for And_ operator
#include
And i still get the following errors:
builder1: In file included from /usr/local/include/boost/mpl/erase.hpp:19,
builder1: from /usr/local/include/boost/fusion/mpl/erase.hpp:10,
builder1: from /usr/local/include/boost/fusion/mpl.hpp:20,
builder1: from /usr/local/include/boost/fusion/include/mpl.hpp:11,
builder1: from /usr/local/include/boost/msm/back/state_machine.hpp:30,
builder1: from File_Meta_FSM.h:18,
builder1: from Open_Files_Mng.h:5,
builder1: from Open_Files_Mng.cpp:1:
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:56: error: ‘_’ was not declared in this scope
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:56: error: ‘_’ was not declared in this scope
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:56: error: template argument 1 is invalid
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:56: error: template argument 2 is invalid
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:57: error: template argument 3 is invalid
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:62: error: ‘_’ was not declared in this scope
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:62: error: ‘_’ was not declared in this scope
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:62: error: template argument 1 is invalid
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:62: error: template argument 2 is invalid
builder1: /usr/local/include/boost/mpl/aux_/erase_impl.hpp:63: error: template argument 3 is invalid
and more of the same errors..
--
Kind regards, Yechiel Levi
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi,
I tried defining:
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need #define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
It’s hard to help without code but you might need to increase fusion too if you happen to have more than 10 states, as written by Krzysztof: #define FUSION_MAX_VECTOR_SIZE 20 Can you provide a minimal code reproducing the problem? It is of course possible to have more than 20 transitions so you either have more than 10 states or your limit macro has been defined somewhere else. HTH, Christophe
You think the problem is with states? But before I defined the mpl no preprocessed header macro all compiles well except that I have 21 states which is beyond the limit When I define the no preprocessed header macro I get this weird warnings. Do I need to define those macros in my dependencies project as well? Since they use some boost.. On Sep 22, 2014 9:53 PM, "Christophe Henry" < christophe.j.henry@googlemail.com> wrote:
Hi,
I tried defining:
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need #define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
It’s hard to help without code but you might need to increase fusion too if you happen to have more than 10 states, as written by Krzysztof: #define FUSION_MAX_VECTOR_SIZE 20
Can you provide a minimal code reproducing the problem? It is of course possible to have more than 20 transitions so you either have more than 10 states or your limit macro has been defined somewhere else.
HTH, Christophe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
You think the problem is with states? I try to guess without seeing code... But before I defined the mpl no preprocessed header macro all compiles well except that I have 21 states which is beyond the limit Then it’s definitely wrong. Frankly, don’t rely too much on the compiler to not compile if you exceed the limit. I once saw a fsm with 40 transitions and 30 states and gcc never complained, never understood why.
When I define the no preprocessed header macro I get this weird warnings. Do I need to define those macros in my dependencies project as well? Since they use some boost.. You need to define it in the TU including the msm headers. If you include msm from a header (which you should avoid) you might get a conflict so you’d have to define it for all, which would everywhere increase compile-times so don’t do it.
I have went through the code over and over.
#include "File_Meta_FSM.h" -- ( this does not have any boost includes at
all)
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need
#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
#define FUSION_MAX_VECTOR_SIZE 30 // or whatever you need
#include "boost/mpl/vector/vector30.hpp"
#include
You think the problem is with states?
I try to guess without seeing code...
But before I defined the mpl no preprocessed header macro all compiles well except that I have 21 states which is beyond the limit
Then it’s definitely wrong. Frankly, don’t rely too much on the compiler to not compile if you exceed the limit. I once saw a fsm with 40 transitions and 30 states and gcc never complained, never understood why.
When I define the no preprocessed header macro I get this weird warnings. Do I need to define those macros in my dependencies project as well? Since they use some boost..
You need to define it in the TU including the msm headers. If you include msm from a header (which you should avoid) you might get a conflict so you’d have to define it for all, which would everywhere increase compile-times so don’t do it.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I have went through the code over and over.
#include "File_Meta_FSM.h" -- ( this does not have any boost includes at all)
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 30 // or whatever you need
#define BOOST_MPL_LIMIT_MAP_SIZE 30 // or whatever you need
#define FUSION_MAX_VECTOR_SIZE 30 // or whatever you need
#include "boost/mpl/vector/vector30.hpp"
<snip> Can you provide a minimum example so that I can have a look? I also need to know which compiler and boost version you use. Thanks, Christophe
participants (5)
-
Christophe Henry
-
christophe.j.henry@gmail.com
-
Hickman, Steve (AdvTech)
-
Krzysztof Jusiak
-
Yechiel Levi