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

Support conversion between vector<Any> and vector<typename T::value_type> #873

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dyackzan
Copy link

@dyackzan dyackzan commented Sep 24, 2024

These changes make way for us to do general vector operations like iterate over, index, append, and remove using BT.CPP. Using vector<Any> objects on the blackboard allows us to create these operations as singletons, rather than requiring each operation to be templated for each vector<T>

The 2 primary components to this PR:

  • In setOutput, convert vector<T> objects to vector<Any> before placing them on the blackboard
  • In getInput, attempt to unwrap and convert vector<Any> to vector<T> if a vector<T> is expected

Don't check port type alignment for vector<Any>
@dyackzan dyackzan marked this pull request as ready for review September 24, 2024 17:44
@dyackzan dyackzan force-pushed the support-vec-any-to-vec-type-conversion branch from 3e23456 to d55f69e Compare October 3, 2024 17:33
@dyackzan dyackzan changed the title Support vector<Any> -> vector<typename T::value_type> conversion Support conversion between vector<Any> and vector<typename T::value_type> Oct 3, 2024
@dyackzan dyackzan force-pushed the support-vec-any-to-vec-type-conversion branch from d55f69e to fbb6583 Compare October 7, 2024 15:40
Also update checks to allow mismatch when a port was declared as a
vector<T> and we have an input port that takes it in as a vector<Any>
@dyackzan dyackzan force-pushed the support-vec-any-to-vec-type-conversion branch from fbb6583 to 823f2a2 Compare October 22, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant