Isis 3 Programmer Reference
InterestOperatorFactory.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "InterestOperatorFactory.h"
10#include "InterestOperator.h"
11#include "Plugin.h"
12#include "IException.h"
13#include "FileName.h"
14
15namespace Isis {
39 // Get the algorithm name to create
40 PvlGroup &op = pPvl.findGroup("Operator", Pvl::Traverse);
41 QString operatorName = op["Name"];
42
43 // Open the factory plugin file
44 Plugin p;
45 FileName f("InterestOperator.plugin");
46 if(f.fileExists()) {
47 p.read("InterestOperator.plugin");
48 }
49 else {
50 p.read("$ISISROOT/lib/InterestOperator.plugin");
51 }
52
53 // Get the algorithm specific plugin and return it
54 InterestOperator * (*plugin)(Pvl & pPvl);
55 plugin = (InterestOperator * ( *)(Pvl & pPvl)) p.GetPlugin(operatorName);
56 return (*plugin)(pPvl);
57 }
58} // end namespace isis
File name manipulation and expansion.
Definition FileName.h:100
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition FileName.cpp:449
static InterestOperator * Create(Pvl &pPvl)
Create an InterestOperator object using a PVL specification.
Interest Operator class.
Loads plugins from a shared library.
Definition Plugin.h:55
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16