22 #include <openbabel/babelconfig.h> 38 typedef const std::map<std::string, std::string>
OpMap ;
41 virtual const char*
TypeID(){
return "ops"; }
45 virtual bool Do(
OBBase* pOb,
const char* OptionText=NULL, OpMap* pOptions=NULL,
OBConversion* pConv=NULL)=0;
48 virtual bool WorksWith(
OBBase* pOb)
const=0;
51 virtual bool ProcessVec(std::vector<OBBase*>& ){
return false; }
60 OBOp* pOp =
dynamic_cast<OBOp*
>(itr->second);
84 OpMap::const_iterator itr;
85 for(itr=pOptions->begin();itr!=pOptions->end();++itr)
87 OBOp* pOp = FindType(itr->first.c_str());
89 if(!pOp->
Do(pOb, itr->second.c_str(), pOptions, pConv))
virtual bool WorksWith(OBBase *pOb) const =0
virtual const char * Description()
Required description of a sub-type.
Definition: plugin.h:66
const std::map< std::string, std::string > OpMap
Definition: op.h:38
Base class for all types of dynamic classes discovered at runtime.
Definition: plugin.h:52
Class to convert from one format to another.
Definition: obconversion.h:59
virtual bool Do(OBBase *pOb, const char *OptionText=NULL, OpMap *pOptions=NULL, OBConversion *pConv=NULL)=0
Required function that does the work. Normally return true, unless object is not to be output...
PluginMapType::const_iterator PluginIterator
Definition: plugin.h:60
virtual bool ProcessVec(std::vector< OBBase *> &)
Do something with an array of objects. Used a a callback routine in OpSort, etc.
Definition: op.h:51
static std::string OpOptions(OBBase *pOb)
Definition: op.h:54
#define MAKE_PLUGIN(BaseClass)
Definition: plugin.h:195
Simplify 'plugin' classes to be discovered and/or loaded at runtime.
static std::string FirstLine(const char *txt)
Utility function to return only the first line of a string.
Definition: plugin.cpp:194
Operations to modify molecules before output.
Definition: op.h:33
virtual const char * TypeID()
Provides the name of this kind of plugin. Use -L "ops" to list from commandline.
Definition: op.h:41
Base Class.
Definition: base.h:239
static PluginIterator End(const char *PluginID)
Definition: plugin.h:119
static PluginIterator Begin(const char *PluginID)
Definition: plugin.h:111
static bool DoOps(OBBase *pOb, OpMap *pOptions, OBConversion *pConv)
Definition: op.h:82
Global namespace for all Open Babel code.
Definition: alias.h:22