コード例 #1
0
ファイル: Feature.cpp プロジェクト: bzquan/CucumberCpp
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);
    }
}
コード例 #2
0
ファイル: visitor.cpp プロジェクト: wo3kie/cxxDojo
/*
 * 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;
}
コード例 #3
0
 bool IsMatch(const IVisitable& o)
 {
   matched_ = nullptr;
   o.Accept(*this);
   return matched_ != nullptr;
 }
コード例 #4
0
 PrivateVisitor(IVisitable& v) { v.Accept(*this); }
コード例 #5
0
ファイル: Example.cpp プロジェクト: bzquan/CucumberCpp
void Example::Visit(IVisitable& visitable)
{
    visitable.Accept(*this);
}