dlvhex
2.5.0
|
00001 /* dlvhex -- Answer-Set Programming with external interfaces. 00002 * Copyright (C) 2005, 2006, 2007 Roman Schindlauer 00003 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Thomas Krennwallner 00004 * Copyright (C) 2009, 2010 Peter Schüller 00005 * 00006 * This file is part of dlvhex. 00007 * 00008 * dlvhex is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU Lesser General Public License as 00010 * published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * dlvhex is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with dlvhex; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00021 * 02110-1301 USA. 00022 */ 00023 00031 #ifndef FIXTURES_DEPGRAPH_COMPGRAPH_GENERIC_HPP_INCLUDED__08112010 00032 #define FIXTURES_DEPGRAPH_COMPGRAPH_GENERIC_HPP_INCLUDED__08112010 00033 00034 // extends ProgramCtxFixtureT 00035 // creates dependency graph 00036 template<typename ProgramCtxFixtureT> 00037 struct GenericDepGraphFixture: 00038 public ProgramCtxFixtureT 00039 { 00040 typedef ProgramCtxFixtureT Base; 00041 00042 std::vector<dlvhex::ID> auxRules; 00043 dlvhex::DependencyGraph depgraph; 00044 00045 GenericDepGraphFixture(): 00046 Base(), 00047 auxRules(), 00048 depgraph(Base::ctx, Base::ctx.registry()) 00049 { depgraph.createDependencies(Base::ctx.idb, auxRules); } 00050 ~GenericDepGraphFixture() {} 00051 }; 00052 00053 // extends ProgramCtxFixtureT 00054 // (via extending GenericDepGraphFixture<ProgramCtxFixtureT>) 00055 // creates dependency graph 00056 // creates component graph 00057 template<typename ProgramCtxFixtureT> 00058 struct GenericDepGraphCompGraphFixture: 00059 public GenericDepGraphFixture<ProgramCtxFixtureT> 00060 { 00061 typedef GenericDepGraphFixture<ProgramCtxFixtureT> Base; 00062 00063 dlvhex::ComponentGraph compgraph; 00064 00065 GenericDepGraphCompGraphFixture(): 00066 Base(), 00067 compgraph(Base::depgraph, Base::ctx, Base::ctx.registry()) { } 00068 ~GenericDepGraphCompGraphFixture() {} 00069 }; 00070 00071 #endif // FIXTURES_DEPGRAPH_COMPGRAPH_GENERIC_HPP_INCLUDED__08112010 00072