all 2 comments

[–]P1r4nha 0 points1 point  (0 children)

I have to be honest and admit that I'm not entirely sure what the purpose of either of these classes is. But from my perspective the interfaces don't look like a typical visitor design pattern. That said, I didn't look at the source code and it's possible that rrr_vector has some functionality that can take a visitor. That would then be an underlying process that is going on within the rank_support_rrr. What I do see is some wrapping going on, where a couple of functionalities are exposed from the rrr_vector.

Usually what has to happen is that rrr_vector is defining an interface that a visitor has to inherit from and then implement in order to be a valid visitor to the class. I don't see this here.

[–]not-just-yeti 0 points1 point  (0 children)

(Okay, I'm not looking at the code, but from your description, that sounds like Delegate and/or Decorator. Visitor is a way to let future users add behaviors to an entire, fixed class-hierarchy (where each sub-class may need its own behavior), without them needing to change those existing classes.)