Isis 3 Programmer Reference
InterestOperatorFactory.cpp
Go to the documentation of this file.
1 
25 #include "InterestOperator.h"
26 #include "Plugin.h"
27 #include "IException.h"
28 #include "FileName.h"
29 
30 namespace Isis {
54  // Get the algorithm name to create
55  PvlGroup &op = pPvl.findGroup("Operator", Pvl::Traverse);
56  QString operatorName = op["Name"];
57 
58  // Open the factory plugin file
59  Plugin p;
60  FileName f("InterestOperator.plugin");
61  if(f.fileExists()) {
62  p.read("InterestOperator.plugin");
63  }
64  else {
65  p.read("$ISISROOT/lib/InterestOperator.plugin");
66  }
67 
68  // Get the algorithm specific plugin and return it
69  InterestOperator * (*plugin)(Pvl & pPvl);
70  plugin = (InterestOperator * ( *)(Pvl & pPvl)) p.GetPlugin(operatorName);
71  return (*plugin)(pPvl);
72  }
73 } // end namespace isis
static InterestOperator * Create(Pvl &pPvl)
Create an InterestOperator object using a PVL specification.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
File name manipulation and expansion.
Definition: FileName.h:116
Interest Operator class.
Search child objects.
Definition: PvlObject.h:170
Loads plugins from a shared library.
Definition: Plugin.h:71
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
Container for cube-like labels.
Definition: Pvl.h:135
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QFunctionPointer GetPlugin(const QString &group)
This method returns a void pointer to a C function (i.e., the plugin) It does this by looking in itse...
Definition: Plugin.cpp:55
void read(const QString &file)
Loads PVL information from a stream.
Definition: Pvl.cpp:76
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:465