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 subscription expression evaluation #1687

Merged
merged 2 commits into from
Jan 19, 2016

Conversation

fgalan
Copy link
Member

@fgalan fgalan commented Jan 19, 2016

Implements part of #1316

@kzangeli
@crbrox

* I don't like too much to have a function with two quite parallel behaviours in the same logic. Probably a
* smarter design will be to divide this function in two part: the one focused in string parsing and the one
* focused in appliying filters to each different sytem (either in memory or as BSON).
*
Copy link
Member Author

Choose a reason for hiding this comment

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

Opinions on the above comment and ideas to improve the current implementation are welcome :)

Copy link
Member

Choose a reason for hiding this comment

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

Well, you have already split the function in two. Very little common code, just go all the way (which means we'll have some code duplicated). I don't see any problem with that.
I also don't see any problem in keeping it the way it is now. A 'fork function'.
What is not very nice is the 'two out of three parameters', that's all.

# 06. Dump accumulator (2 notifications)
#

echo "01. Create subscription with q: colour!=black,white"
Copy link
Member

Choose a reason for hiding this comment

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

!= => ==

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 39c2584

@@ -112,6 +112,25 @@ std::string ContextElement::render(ConnectionInfo* ciP, RequestType requestType,

/* ****************************************************************************
*
* ContextElement::getAttribute
*/
ContextAttribute* ContextElement::getAttribute(std::string attrName)
Copy link
Member

Choose a reason for hiding this comment

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

Would probably have been better to implement a 'lookup' method for ContextAttributeVector, but, never mind.

NTC

@crbrox
Copy link
Member

crbrox commented Jan 19, 2016

LGTM

1 similar comment
@kzangeli
Copy link
Member

LGTM

kzangeli pushed a commit that referenced this pull request Jan 19, 2016
…_filters_ngsiv2

ADD subscription expression evaluation
@kzangeli kzangeli merged commit 5807929 into develop Jan 19, 2016
@kzangeli kzangeli deleted the feature/1316_subscriptions_filters_ngsiv2 branch January 19, 2016 13:09
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.

3 participants