Giter Club home page Giter Club logo

Comments (18)

DonMathi avatar DonMathi commented on August 25, 2024

It points to line 577, and says no matching candidates for
void* operator new(long unsigned int)

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

The IDE tells me that all states from K to W are unused. (Grayed out)

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

I think I will just create 2 separate HFSM to handle each region inside my class for now.

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Hi Kjeld,
Let me check

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Do you have a complete example I can test?

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

Found a small bug

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

StateMachine.zip

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

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.

DonMathi avatar DonMathi commented on August 25, 2024

ahhh, It is because I have everything in the *.h file

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

Thank you for your quick reply

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

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.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

Does it compile after you swap them?

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

No I still have problems with getting the control.changeTo to work

from hfsm2.

DonMathi avatar DonMathi commented on August 25, 2024

And half of the structs are grayed-out (not used).
I'll talk to you again to morrow, have to go now

from hfsm2.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

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.

DonMathi avatar DonMathi commented on August 25, 2024

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.

andrew-gresyk avatar andrew-gresyk commented on August 25, 2024

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.

DonMathi avatar DonMathi commented on August 25, 2024

It's only empty for now

from hfsm2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.