dlvhex
2.5.0
|
00001 /* dlvhex -- Answer-Set Programming with external interfaces. 00002 * Copyright (C) 2005-2007 Roman Schindlauer 00003 * Copyright (C) 2006-2015 Thomas Krennwallner 00004 * Copyright (C) 2009-2016 Peter Schüller 00005 * Copyright (C) 2011-2016 Christoph Redl 00006 * Copyright (C) 2015-2016 Tobias Kaminski 00007 * Copyright (C) 2015-2016 Antonius Weinzierl 00008 * 00009 * This file is part of dlvhex. 00010 * 00011 * dlvhex is free software; you can redistribute it and/or modify it 00012 * under the terms of the GNU Lesser General Public License as 00013 * published by the Free Software Foundation; either version 2.1 of 00014 * the License, or (at your option) any later version. 00015 * 00016 * dlvhex is distributed in the hope that it will be useful, but 00017 * WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with dlvhex; if not, write to the Free Software 00023 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00024 * 02110-1301 USA. 00025 */ 00026 00036 #if !defined(_DLVHEX_ASPSOLVER_H) 00037 #define _DLVHEX_ASPSOLVER_H 00038 00039 #include "dlvhex2/PlatformDefinitions.h" 00040 #include "dlvhex2/ASPSolverManager.h" 00041 #include "dlvhex2/Error.h" 00042 00043 #include <boost/shared_ptr.hpp> 00044 #include <boost/scoped_ptr.hpp> 00045 #include <vector> 00046 00047 DLVHEX_NAMESPACE_BEGIN 00048 00049 namespace ASPSolver 00050 { 00051 00053 struct DLVHEX_EXPORT DLVSoftware: 00054 public ASPSolverManager::SoftwareBase 00055 { 00056 typedef ASPSolverManager::SoftwareConfiguration<DLVSoftware> Configuration; 00057 00059 struct DLVHEX_EXPORT Options: 00060 public ASPSolverManager::GenericOptions 00061 { 00063 Options(); 00065 virtual ~Options(); 00066 00071 std::vector<std::string> arguments; 00072 }; 00073 00075 class DLVHEX_EXPORT Delegate: 00076 public ASPSolverManager::DelegateInterface 00077 { 00078 public: 00079 typedef DLVSoftware::Options Options; 00080 00083 Delegate(const Options& options); 00085 virtual ~Delegate(); 00086 virtual void useASTInput(const OrdinaryASPProgram& program); 00087 virtual void useInputProviderInput(InputProvider& inp, RegistryPtr reg); 00088 virtual ASPSolverManager::ResultsPtr getResults(); 00089 00090 protected: 00091 struct ConcurrentQueueResultsImpl; 00092 typedef boost::shared_ptr<ConcurrentQueueResultsImpl> 00093 ConcurrentQueueResultsImplPtr; 00094 ConcurrentQueueResultsImplPtr results; 00095 }; 00096 }; 00097 00098 #ifdef HAVE_LIBDLV 00099 00100 struct DLVHEX_EXPORT DLVLibSoftware: 00101 public DLVSoftware 00102 { 00103 typedef ASPSolverManager::SoftwareConfiguration<DLVLibSoftware> Configuration; 00104 00105 //typedef DLVSoftware::Options Options; 00106 00108 class DLVHEX_EXPORT Delegate: 00109 public ASPSolverManager::DelegateInterface 00110 { 00111 public: 00112 typedef DLVSoftware::Options Options; 00113 00115 Delegate(const Options& options); 00117 virtual ~Delegate(); 00118 virtual void useASTInput(const OrdinaryASPProgram& program); 00119 virtual void useInputProviderInput(InputProvider& inp, RegistryPtr reg); 00120 virtual ASPSolverManager::ResultsPtr getResults(); 00121 00122 protected: 00123 struct Impl; 00124 boost::scoped_ptr<Impl> pimpl; 00125 }; 00126 }; 00127 #endif 00128 00129 #ifdef HAVE_LIBCLINGO 00130 00131 struct DLVHEX_EXPORT ClingoSoftware: 00132 public ASPSolverManager::SoftwareBase 00133 { 00134 typedef ASPSolverManager::SoftwareConfiguration<ClingoSoftware> Configuration; 00135 00137 struct DLVHEX_EXPORT Options: 00138 public ASPSolverManager::GenericOptions 00139 { 00141 Options(); 00143 virtual ~Options(); 00144 00145 // nothing there yet 00146 }; 00147 00148 // the delegate for ClingoSoftware 00149 class DLVHEX_EXPORT Delegate: 00150 public ASPSolverManager::DelegateInterface 00151 { 00152 public: 00153 typedef ClingoSoftware::Options Options; 00154 00156 Delegate(const Options& options); 00158 virtual ~Delegate(); 00159 virtual void useASTInput(const OrdinaryASPProgram& program); 00160 virtual void useInputProviderInput(InputProvider& inp, RegistryPtr reg); 00161 virtual ASPSolverManager::ResultsPtr getResults(); 00162 00163 protected: 00164 struct Impl; 00165 boost::scoped_ptr<Impl> pimpl; 00166 }; 00167 }; 00168 #endif 00169 00170 } // namespace ASPSolver 00171 00172 00173 DLVHEX_NAMESPACE_END 00174 #endif // _DLVHEX_ASPSOLVER_H 00175 00176 00177 // vim:expandtab:ts=4:sw=4: 00178 // mode: C++ 00179 // End: