Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have to explicit cast shared_state to repr #3

Open
WarlockD opened this issue Feb 5, 2022 · 0 comments
Open

Have to explicit cast shared_state to repr #3

WarlockD opened this issue Feb 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@WarlockD
Copy link

WarlockD commented Feb 5, 2022

To show the code, SharedScsiRequest : neo::shared_state<SharedScsiRequest, ScsiRequest>
PS - All create new does is make a ScsiRequest and run clone on the state fyi.

SharedScsiRequest req = SharedScsiRequest::create_new(0, cmd, reply);
card.RunCommand(req);
auto rstring = neo::repr(static_cast<const ScsiRequest &>(req));
spdlog::info("Command responce: {}", rstring.string());

[18:39:51 -06:00][I] Command responce: ScsiRequest{status=GOOD, message=COMMAND_COMPLETE, rstatus=GOOD, transfered=0, hasError=false}

I was going to just make a do_repr that catches anything drived from neo::shared_state to just hard cast itself but thought I should suggest it.

@vector-of-bool vector-of-bool added the enhancement New feature or request label Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants