Esempio n. 1
0
void Feature::Visit(IVisitable& visitable)
{
    if (m_pLanguage != nullptr) visitable.Accept(*m_pLanguage);
    visitable.Accept(Tags());
    visitable.Accept(*this);
    if (m_pBackground != nullptr) {
        m_pBackground->Visit(visitable);
    }

    for (ScenarioDefinition* scenario : m_ScenarioDefinitions)
    {
        scenario->Visit(visitable);
    }
}
Esempio n. 2
0
/*
 * main
 */
int main()
{
    GoVisitor v;

    IVisitable * h = new Human;
    IVisitable * f = new Fish;
    IVisitable * b = new Bird;

    h->accept( v );  // Human::walk
    f->accept( v );  // Fish::swim
    b->accept( v );  // Bird::fly

    delete b;
    delete f;
    delete h;
}
Esempio n. 3
0
 bool IsMatch(const IVisitable& o)
 {
   matched_ = nullptr;
   o.Accept(*this);
   return matched_ != nullptr;
 }
Esempio n. 4
0
 PrivateVisitor(IVisitable& v) { v.Accept(*this); }
Esempio n. 5
0
void Example::Visit(IVisitable& visitable)
{
    visitable.Accept(*this);
}