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

Add more apis to query vector types from a reference #4823

Merged
merged 4 commits into from
Sep 27, 2018

Conversation

shivendra14
Copy link
Contributor

@@ -367,7 +367,11 @@ class Reference {
bool IsNumeric() const { return IsIntOrUint() || IsFloat(); }
bool IsString() const { return type_ == FBT_STRING; }
bool IsKey() const { return type_ == FBT_KEY; }
bool IsTypedVectorElementType() const { return flexbuffers::IsTypedVectorElementType(type_); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put these in the opposite order? First IsVector etc. It is nice if the reader can go from most general to most specific for vectors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will do that.. but IsAnyVector will still be at the end as it is using other apis.
So new order.
IsVector
IsTypedVector
IsFixedTypedVector
IsAnyVector
Seems fine?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsTypedVectorElementType is still in the wrong order?

@shivendra14
Copy link
Contributor Author

@aardappel: changed the order again.

@@ -368,6 +368,10 @@ class Reference {
bool IsString() const { return type_ == FBT_STRING; }
bool IsKey() const { return type_ == FBT_KEY; }
bool IsVector() const { return type_ == FBT_VECTOR || type_ == FBT_MAP; }
bool IsTypedVector() const { return flexbuffers::IsTypedVector(type_); }
bool IsTypedVectorElementType() const { return flexbuffers::IsTypedVectorElementType(type_); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsTypedVectorElementType doesn't seem of concern to the user most of the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know.. not useful for me at this time. removing it completely. can add that separately if clients need it.

@aardappel
Copy link
Collaborator

Would be good to add the use of these functions in the string output?

@aardappel
Copy link
Collaborator

Ok, merging for now. Using these functions in the string output would still be a good idea.

@aardappel aardappel merged commit 0bffce5 into google:master Sep 27, 2018
shivendra14 added a commit to shivendra14/flatbuffers that referenced this pull request Nov 13, 2018
* Add more apis to query vector types from a reference

google#4818

* changing order of apis

* another reordering

* removed vector element type api as not needed as for now
zchee pushed a commit to zchee/flatbuffers that referenced this pull request Feb 14, 2019
* Add more apis to query vector types from a reference

google#4818

* changing order of apis

* another reordering

* removed vector element type api as not needed as for now
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.

2 participants