Comments (18)
It points to line 577, and says no matching candidates for
void* operator new(long unsigned int)
from hfsm2.
The IDE tells me that all states from K to W are unused. (Grayed out)
from hfsm2.
I think I will just create 2 separate HFSM to handle each region inside my class for now.
from hfsm2.
Hi Kjeld,
Let me check
from hfsm2.
Do you have a complete example I can test?
from hfsm2.
Found a small bug
from hfsm2.
from hfsm2.
Ah, I see.
For control.changeTo<StateE>();
to work, transition target state StateE
needs to be either forward declared, or fully defined before the call.
In this case, moving the body of StateD::react<>()
below the definition of StateE
This works for me:
// ..
class StateMachine
{
// ..
struct StateD: HFSM::State
{
using HFSM::State::react;
void react(const SomeEvent&, FullControl& control);
};
struct StateE: HFSM::State { using HFSM::State::react; };
// ..
};
void StateMachine::StateD::react(const SomeEvent&, FullControl& control)
{
control.changeTo<StateE>();
}
// ..
from hfsm2.
ahhh, It is because I have everything in the *.h file
from hfsm2.
Thank you for your quick reply
from hfsm2.
However it seems like that after a Composite inside a Orthogonal it stops taking more states? If I swap the 2 Composites, then all the states in that region becomes gray-out by my editor
from hfsm2.
Does it compile after you swap them?
from hfsm2.
No I still have problems with getting the control.changeTo to work
from hfsm2.
And half of the structs are grayed-out (not used).
I'll talk to you again to morrow, have to go now
from hfsm2.
Actually, your original example with un-commented line seems to work for me, in VS 16.4.5 and Clang 9.0 and in GCC 9.1
Can you test that machine in a separate .cpp?
from hfsm2.
Hi Andrew
I think I found the error. It had nothing to do with hfsm2.
Somehow I had to include a common project file, that included other system libs.
Now it works
from hfsm2.
Great.
I noticed you were using empty context in you example.
In that case you can also use another constructor that doesn't require context argument:
hfsm2::Machine;
vs hfsm2::MachineT<Context>;
There's an example in the first section of API Cheat Sheet
from hfsm2.
It's only empty for now
from hfsm2.
Related Issues (20)
- "Fully static, no dynamic allocations" but "new" used several times HOT 2
- Compile error in B_<TFirst>::stateId() HOT 3
- The logger can freeze due to unknown methods HOT 5
- Only one headless region is allowed in an FSM instance HOT 1
- Trouble with HFSM2 master version in MSVC2019 16.6.5 HOT 9
- Can't get Context from Control in Utility function HOT 2
- Tracking use in Godot Engine HOT 14
- Usage within ecs systems like entt HOT 2
- Using in embedded systems HOT 3
- Port travis to Github Actions HOT 3
- Looped plan HOT 2
- State machine stuck in update method HOT 3
- Macro conflict between sys/ioctl.h and hfsm2/machine.hpp HOT 4
- thread-safe?
- How get machine state id? HOT 4
- Fetching payload contents HOT 2
- Broken links in doc HOT 1
- Does it support writing the states in different files? HOT 1
- State members? HOT 2
- Any example about "Hierarchical" ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hfsm2.