dlvhex  2.5.0
TestPlugin Class Reference
Inheritance diagram for TestPlugin:
Collaboration diagram for TestPlugin:

Data Structures

struct  CtxData
class  ProductionRequirementsAtom
class  SumNonZeroAtom
class  TestGen2Atom
class  TestIsEmpty
class  TestNumberOfBalls
class  TestNumberOfBallsGE
class  TestNumberOfBallsSE
class  TestSetUnionAtom

Public Member Functions

 TestPlugin ()
virtual void processOptions (std::list< const char * > &pluginOptions, ProgramCtx &ctx)
 Processes options for this plugin.
virtual std::vector
< PluginAtomPtr
createAtoms (ProgramCtx &ctx) const
 Publish external computation sources to dlvhex.
virtual void setupProgramCtx (ProgramCtx &ctx)
 Altering the ProgramCtx permits plugins to do many things, e.g., * installing model and finish callbacks * removing default model (and final) hooks * setting maxint * changing and configuring the solver backend to be used See internal plugins for example usage.

Detailed Description

Definition at line 2317 of file TestPlugin.cpp.


Constructor & Destructor Documentation

TestPlugin::TestPlugin ( ) [inline]

Definition at line 2334 of file TestPlugin.cpp.


Member Function Documentation

virtual std::vector<PluginAtomPtr> TestPlugin::createAtoms ( ProgramCtx ctx) const [inline, virtual]

Publish external computation sources to dlvhex.

This is the central location where the user's atoms are made public. dlvhex will call this function for all found plugins, which write their atoms in the provided map. This map associates strings with pointers to PluginAtom objects. The strings denote the name of the atom as it should be used in the program.

Override this method to publish your atoms.

Example:

   std::vector<PluginAtomPtr>
   createAtoms(ProgramCtx& ctx) const
   {
    std::vector<PluginAtomPtr> ret;
      PluginAtomPtr newatom1(new MyAtom1);
      PluginAtomPtr newatom2(new MyAtom2);
      ret["newatom1"] = newatom1;
      ret["newatom2"] = newatom2;
      return ret;
   }

Here, we assume to have defined atoms MyAtom1 and MyAtom2 derived from PluginAtom. These atom can now be used in a HEX-program with the predicate &newatom1[]() and &newatom2[]().

Reimplemented from PluginInterface.

Definition at line 2833 of file TestPlugin.cpp.

virtual void TestPlugin::processOptions ( std::list< const char * > &  pluginOptions,
ProgramCtx ctx 
) [inline, virtual]

Processes options for this plugin.

If you override this method, remove all options your plugin recognizes from pluginOptions. (Do not free the pointers, the const char* directly come from argv.) You can store configuration of your plugin using PluginData and ProgramCtx::getPluginData (see there for more information.)

Reimplemented from PluginInterface.

Definition at line 2340 of file TestPlugin.cpp.

References ProgramCtx::getPluginData(), TestPlugin::CtxData::testRepetition, and WARNING().

virtual void TestPlugin::setupProgramCtx ( ProgramCtx ) [inline, virtual]

Altering the ProgramCtx permits plugins to do many things, e.g., * installing model and finish callbacks * removing default model (and final) hooks * setting maxint * changing and configuring the solver backend to be used See internal plugins for example usage.

Reimplemented from PluginInterface.

Definition at line 2900 of file TestPlugin.cpp.

References ProgramCtx::finalCallbacks, ProgramCtx::getPluginData(), and TestPlugin::CtxData::testRepetition.


The documentation for this class was generated from the following file: