25 using namespace KKMLL;
33 const KKStr& _fvClassName,
34 const KKStr& _description
36 description
(_description
),
37 fvClassName
(_fvClassName
),
97 factories =
new FactoryMap ();
98 atexit (FactoryFVProducer::FinaleCleanUp);
102 FactoryMap::iterator idx;
104 idx = factories->find (_name);
105 if (idx != factories->end ())
106 factory = idx->second;
120 bool weOwnRunLog =
false;
129 runLog->Level (-1) <<
"FactoryFVProducer::RegisterFactory ***ERROR*** factory==NULL" << endl;
135 runLog->Level (30) <<
"FactoryFVProducer::RegisterFactory Name: " << factory->Name () <<
" Description: " << factory->Description () << endl;
139 factories =
new FactoryMap ();
140 atexit (FactoryFVProducer::FinaleCleanUp);
141 atExitDefined =
true;
144 FactoryMap::iterator idx;
146 idx = factories->find (factory->Name ());
147 if (idx != factories->end ())
149 runLog->Level (-1) <<
"FactoryFVProducer::RegisterFactory ***ERROR*** Factory With Name: " << factory->Name () <<
" already defined." << endl;
153 factories->insert (pair<KKStr,FactoryFVProducerPtr> (factory->Name (), factory));
175 FactoryMap::iterator idx;
177 for (idx = factories->begin (); idx != factories->end (); ++idx)
186 atExitDefined =
false;
FactoryFVProducer(const KKStr &_name, const KKStr &_fvClassName, const KKStr &_description)
FeatureVector(kkint32 _numOfFeatures)
static FactoryFVProducerPtr LookUpFactory(const KKStr &name)
Returns pointer to existing instance of 'FactoryFVProducer' that was previously registered with 'name...
static void RegisterFactory(FactoryFVProducerPtr factory, RunLog *runLog)
This is where you register newly instantiated instances of 'FactoryFVProducer' derived classes...
FeatureVectorList(FileDescPtr _fileDesc, bool _owner)
Will create a new empty list of FeatureVector's.
Container class for FeatureVector derived objects.
KKStr(const KKStr &str)
Copy Constructor.
RunLog()
Creates an instance were logging will go to the console.
virtual FeatureVectorListPtr ManufacturFeatureVectorList(bool owner, RunLog &runLog) const
Manufactures a instance of a derived 'FeatureVectorList' class that is appropriate for containing ins...
virtual FeatureVectorProducerPtr ManufactureInstance(RunLog &runLog)=0
Derived classes will instantiate appropriate instances of 'FeatureVectorProducer'.
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
FactoryFVProducer * FactoryFVProducerPtr
static FeatureVectorProducerPtr ManufactureInstance(const KKStr &name, RunLog &runLog)
Will instantiate a new instance of the appropriate 'FeatureVectorProducer' class given the supplied n...
virtual TrainingConfiguration2Ptr ManufacturTrainingConfiguration() const
Returns a 'TrainingConfiguration2' derived instance.
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
Responsible for creating a FeatureFectorProducer instance.
virtual FeatureVectorPtr ManufacturFeatureVector(kkint32 numOfFeatires, RunLog &runLog)
Manufactures a instance of a derived 'FeatureVector' class that is appropriate for containing instanc...
Represents a Feature Vector of a single example, labeled or unlabeled.
Maintains one instance of a GoalKeeper object that can be used anywhere in the application.
virtual FileDescPtr FileDesc() const =0
virtual ~FactoryFVProducer()
A Factory can near be deleted until the application terminates; the atexit method will perform the de...