KSquare Utilities
KKMLL::MLClass Class Reference

Represents a "Class" in the Machine Learning Sense. More...

#include <MLClass.h>

Public Member Functions

kkint32 ClassId () const
 
void ClassId (kkint32 _classId)
 
float CountFactor () const
 
void CountFactor (float _countFactor)
 
const KKStrDescription () const
 
void Description (const KKStr &_description)
 
bool IsAnAncestor (MLClassPtr c) const
 
bool Mandatory () const
 
void Mandatory (bool _mandatory)
 
MLClassPtr MLClassForGivenHierarchialLevel (KKB::kkuint16 level) const
 
const KKStrName () const
 
kkuint16 NumHierarchialLevels () const
 
MLClassPtr Parent () const
 
void Parent (MLClassPtr _parent)
 
const KKStrParentName () const
 
bool StoredOnDataBase () const
 
void StoredOnDataBase (bool _storedOnDataBase)
 
bool Summarize () const
 
void Summarize (bool _summarize)
 
KKStr ToString () const
 
bool UnDefined () const
 
void UnDefined (bool _unDefined)
 
const KKStrUpperName () const
 
void WriteXML (const KKStr &varName, std::ostream &o) const
 

Static Public Member Functions

static MLClassListPtr BuildListOfDecendents (MLClassPtr parent)
 
static void ChangeNameOfClass (MLClassPtr mlClass, const KKStr &newName, bool &changeSuccessful)
 Changes the name of an existing class verifying that a duplicate does not get created. More...
 
static MLClassPtr CreateNewMLClass (const KKStr &_name, kkint32 _classId=-1)
 Static method used to create a new instance of a MLClass object. More...
 
static void FinalCleanUp ()
 Call this as the last thing the application does, will delete all existing instances of 'MLClass'. More...
 
static MLClassPtr GetByClassId (kkint32 _classId)
 
static KKStr GetClassNameFromDirName (const KKStr &subDir)
 
static MLClassPtr GetUnKnownClassStatic ()
 
static MLClassListPtr GlobalClassList ()
 
static void ResetAllParentsToAllClasses ()
 

Friends

class KKQueue< MLClass >
 
class MLClassList
 

Detailed Description

Represents a "Class" in the Machine Learning Sense.

Author
Kurt Kramer

Each instance of this class represents a single Class as used in Machine Learning sense. Each instance of 'FeatureVector' class will point to an instance of this class. There can only be one instance of each Class in memory. Specifically the 'name' field will be unique. This is enforced by making the constructor and destructor private. The only way to create a new instance of a 'MLClass' object is to call one of the static methods of 'CreateNewMLClass'. These methods will look for a instance of 'MLClass' that already exists. If one does not they will then create a new one.

Please refer to MLClassList at bottom of file. That class is the object you will most be using when dealing with Images. classes.

UmiClass and PicesClass There is a special relationship between this class and a class called 'UmiClass' and 'PicesClass in the 'UnManagedInterface' and PicesInterface libraries, ".net' Managed libraries'. These managed c++ versions of this class. There is a one-to-one correspondence between the two classes. When ever a instance of 'UmiClass' or 'PicesClass' get created they will automatic- ally call the static method 'MLClass::CreateNewMLClass' to get the unmanaged version of the class.

See also
KKMLL::MLClassList, KKMLL::FeatureVector, UnManagedInterface::UmiClass, MLL::PicesClass

Definition at line 52 of file MLClass.h.

Member Function Documentation

MLClassListPtr MLClass::BuildListOfDecendents ( MLClassPtr  parent)
static

Definition at line 145 of file MLClass.cpp.

References GlobalClassList(), KKMLL::MLClassList::MLClassList(), and KKMLL::MLClassList::PushOnBack().

146 {
147  if (parent == NULL)
148  return NULL;
149 
150  GlobalClassList (); // Make sure that 'existingMLClasses' exists.
151 
152  MLClassListPtr results = new MLClassList ();
153  results->PushOnBack (parent);
154 
155  MLClassPtr startingAncestor = NULL;
156 
157  for (auto existingMLClass: *existingMLClasses)
158  {
159  if (!existingMLClass)
160  continue;
161  startingAncestor = existingMLClass;
162  MLClassPtr ancestor = startingAncestor->Parent ();
163  while (ancestor != NULL)
164  {
165  if (ancestor == parent)
166  {
167  results->PushOnBack (startingAncestor);
168  break;
169  }
170  ancestor = ancestor->Parent ();
171  if (ancestor == startingAncestor)
172  break;
173  }
174  }
175 
176  return results;
177 } /* BuildListOfDecendents */
MLClassPtr Parent() const
Definition: MLClass.h:157
friend class MLClassList
Definition: MLClass.h:119
Represents a "Class" in the Machine Learning Sense.
Definition: MLClass.h:52
virtual void PushOnBack(MLClassPtr mlClass)
Definition: MLClass.cpp:798
static MLClassListPtr GlobalClassList()
Definition: MLClass.cpp:50
Maintains a list of MLClass instances.
Definition: MLClass.h:233
void MLClass::ChangeNameOfClass ( MLClassPtr  mlClass,
const KKStr newName,
bool &  changeSuccessful 
)
static

Changes the name of an existing class verifying that a duplicate does not get created.

Since the class name can not be duplicated and there is a nameIndex structure maintained by each 'MLClassList' instances we need to make sure the name is not already in use by another instance of 'mlClass'. This is done by first trying to update the 'nameIndex' in 'existingMLClasses' (list of all 'inageClass' instances in existence); if this is successful will then change the name in 'mlClass' and update all existing 'MLClassList' instances 'nameIndex' structures.

Parameters
[in,out]mlClassClass having its name changed; upon entry should contain its original name; if no other class already has its name it will be updated to the value in 'newName'.
[in]newNameThe new name that 'mlClass' is to receive.
[out]changeSuccessfulReturns 'true' if name was changed; if set to false then the 'name' field in 'mlClass' will not be changed.

Definition at line 181 of file MLClass.cpp.

References KKB::KKStr::Concat(), KKB::GoalKeeper::EndBlock(), Name(), and KKB::GoalKeeper::StartBlock().

185 {
186  successful = true;
187  KKStr oldName = mlClass->Name();
188 
189  if (!blocker)
190  CreateBlocker ();
191  blocker->StartBlock ();
192 
193  existingMLClasses->ChangeNameOfClass (mlClass, oldName, newName, successful);
194  if (!successful)
195  {
196  cerr << endl
197  << "MLClass::ChangeNameOfClass 'existingMLClasses' failed to vahne name." << endl
198  << " NewName[" << newName << "]" << endl
199  << " OldName[" << mlClass->Name () << "]" << endl
200  << endl;
201  successful = false;
202  }
203  else
204  {
205  // It is okay to change the name; we will also need to inform all
206  // instances of MLClassList that the name changed so they can
207  // update their nameIndex structures.
208  mlClass->Name (newName);
209 
210  map<MLClassListPtr,MLClassListPtr>::iterator idx;
211  for (idx = existingClassLists.begin (); idx != existingClassLists.end (); ++idx)
212  {
213  MLClassListPtr list = idx->first;
214  kkuint32 classInList = list->PtrToIdx (mlClass);
215  if (classInList >= 0)
216  {
217  bool nameChangedInList = false;
218  list->ChangeNameOfClass (mlClass, oldName, newName, nameChangedInList);
219  }
220  }
221  }
222 
223  blocker->EndBlock ();
224 
225  return;
226 } /* ChangeNameOfClass */
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
Definition: GoalKeeper.cpp:214
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
Definition: GoalKeeper.cpp:295
kkint32 PtrToIdx(EntryConstPtr _entry) const
Definition: KKQueue.h:761
Maintains a list of MLClass instances.
Definition: MLClass.h:233
kkint32 KKMLL::MLClass::ClassId ( ) const
inline

From MySQL table Classes, '-1' indicates that not loaded from mysql table.

Definition at line 136 of file MLClass.h.

Referenced by CreateNewMLClass(), and KKMLL::MLClassList::LookUpByClassId().

void KKMLL::MLClass::ClassId ( kkint32  _classId)
inline

Definition at line 137 of file MLClass.h.

Referenced by CreateNewMLClass().

137 {classId = _classId;}
float KKMLL::MLClass::CountFactor ( ) const
inline

Definition at line 139 of file MLClass.h.

139 {return countFactor;}
void KKMLL::MLClass::CountFactor ( float  _countFactor)
inline

Definition at line 140 of file MLClass.h.

Referenced by KKMLL::TrainingClass::TrainingClass(), and KKMLL::XmlElementMLClass::XmlElementMLClass().

140 {countFactor = _countFactor;}
MLClassPtr MLClass::CreateNewMLClass ( const KKStr _name,
kkint32  _classId = -1 
)
static

Static method used to create a new instance of a MLClass object.

Used to get pointer to existing MLClass object that already exists in 'existingMLClasses'. If one does not exist then a new MLClass object with this name will be created.

This is the only method that can actually create a MLClass instance. The idea is that there is only one MLClass object ever created for each class. All MLClassList container objects will point to

Parameters
[in]_nameName of class to be created.
Returns
Pointer to an instance of 'MLClass' that will have the name '_name'.

Definition at line 100 of file MLClass.cpp.

References KKMLL::MLClassList::AddMLClass(), ClassId(), KKB::KKStr::Concat(), KKB::GoalKeeper::EndBlock(), GlobalClassList(), KKMLL::MLClassList::LookUpByName(), KKB::GoalKeeper::StartBlock(), and KKB::KKStr::ToUpper().

Referenced by KKMLL::BinaryClassParms::CreateFromTabDelStr(), KKMLL::ClassProbList::CreateFromXMLStream(), KKMLL::MLClassList::GetMLClassPtr(), KKMLL::MLClassList::GetUnKnownClass(), GetUnKnownClassStatic(), KKMLL::MLClassList::Load(), MLClassForGivenHierarchialLevel(), KKMLL::MLClassIndexList::ParseClassIndexList(), KKMLL::ClassAssignments::ParseToString(), KKMLL::ClassProbList::ReadXML(), KKMLL::FeatureEncoder::ReadXML(), KKMLL::ModelDual::ReconcilePredictions(), KKMLL::XmlElementMLClass::XmlElementMLClass(), and KKMLL::XmlElementMLClassNameList::XmlElementMLClassNameList().

103 {
104  KKStr upperName = _name.ToUpper ();
105 
106  MLClassListPtr globalList = existingMLClasses;
107  if (!globalList)
108  globalList = GlobalClassList ();
109 
110  MLClassPtr mlClass = globalList->LookUpByName (_name);
111  if (mlClass == NULL)
112  {
113  if (!blocker)
114  CreateBlocker ();
115  blocker->StartBlock ();
116 
117  mlClass = globalList->LookUpByName (_name);
118  if (mlClass == NULL)
119  {
120  MLClassPtr temp = new MLClass (_name);
121  temp->ClassId (_classId);
122  existingMLClasses->AddMLClass (temp);
123  mlClass = temp;
124  }
125 
126  blocker->EndBlock ();
127  }
128 
129  if ((mlClass->ClassId () < 0) && (_classId >= 0))
130  ((MLClassPtr)mlClass)->ClassId (_classId);
131 
132  return mlClass;
133 } /* CreateNewMLClass */
Represents a "Class" in the Machine Learning Sense.
Definition: MLClass.h:52
KKStr ToUpper() const
Definition: KKStr.cpp:2517
virtual MLClassPtr LookUpByName(const KKStr &_name) const
Returns a pointer of MLClass object with name (_name); if none in list will then return NULL...
Definition: MLClass.cpp:830
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
Definition: GoalKeeper.cpp:214
kkint32 ClassId() const
Definition: MLClass.h:136
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
Definition: GoalKeeper.cpp:295
static MLClassListPtr GlobalClassList()
Definition: MLClass.cpp:50
Maintains a list of MLClass instances.
Definition: MLClass.h:233
virtual void AddMLClass(MLClassPtr _mlClass)
Definition: MLClass.cpp:756
const KKStr& KKMLL::MLClass::Description ( ) const
inline

Definition at line 142 of file MLClass.h.

142 {return description;}
void KKMLL::MLClass::Description ( const KKStr _description)
inline

Definition at line 143 of file MLClass.h.

References KKB::KKStr::operator=().

Referenced by KKMLL::XmlElementMLClass::XmlElementMLClass().

143 {description = _description;}
void MLClass::FinalCleanUp ( )
static

Call this as the last thing the application does, will delete all existing instances of 'MLClass'.

Call this at very end of program to clean up existingMLClasses.

Definition at line 269 of file MLClass.cpp.

References KKB::GoalKeeper::Destroy(), KKB::GoalKeeper::EndBlock(), KKMLL::FileDesc::FinalCleanUp(), KKMLL::FileDesc::FinalCleanUpRanAlready(), and KKB::GoalKeeper::StartBlock().

270 {
271  if (!needToRunFinalCleanUp)
272  return;
273 
274  blocker->StartBlock ();
275  if (needToRunFinalCleanUp)
276  {
278  {
279  //cerr << endl << "MLClass::FinalCleanUp ***ERROR*** Need to run MLClass::FinalCleanUp before FileDesc::FinalCleanUp" << endl << endl;
281  }
282 
283  if (existingMLClasses)
284  {
285  delete existingMLClasses;
286  existingMLClasses = NULL;
287  }
288 
289  needToRunFinalCleanUp = false;
290  }
291  blocker->EndBlock ();
292 
293  GoalKeeper::Destroy (blocker);
294  blocker = NULL;
295 } /* FinalCleanUp */
static bool FinalCleanUpRanAlready()
Definition: FileDesc.h:88
static void FinalCleanUp()
Clean up function, call just before exiting the application.
Definition: FileDesc.cpp:57
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
Definition: GoalKeeper.cpp:214
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
Definition: GoalKeeper.cpp:295
MLClassPtr MLClass::GetByClassId ( kkint32  _classId)
static

Definition at line 137 of file MLClass.cpp.

References GlobalClassList(), and KKMLL::MLClassList::LookUpByClassId().

138 {
139  return GlobalClassList ()->LookUpByClassId (_classId);
140 } /* GetByClassId */
virtual MLClassPtr LookUpByClassId(kkint32 _classId) const
Definition: MLClass.cpp:843
static MLClassListPtr GlobalClassList()
Definition: MLClass.cpp:50
KKStr MLClass::GetClassNameFromDirName ( const KKStr subDir)
static

Definition at line 372 of file MLClass.cpp.

References KKB::KKStr::Concat(), KKB::KKStr::Len(), KKB::KKStr::LocateLastOccurrence(), KKB::KKStr::operator=(), KKB::KKStr::operator[](), KKB::osGetRootNameOfDirectory(), and KKB::KKStr::SubStrPart().

Referenced by KKMLL::FeatureFileIO::LoadInSubDirectoryTree().

373 {
374  KKStr className = osGetRootNameOfDirectory (subDir);
375  kkint32 x = className.LocateLastOccurrence ('_');
376  if (x > 0)
377  {
378  // Now lets eliminate any sequence number in name
379  // We are assuming that a underscore{"_") character separates the class name from the sequence number.
380  // So if there is an underscore character, and all the characters to the right of it are
381  // numeric characters, then we will remove the underscore and the following numbers.
382 
383  kkuint32 y = x + 1;
384 
385  bool allFollowingCharsAreNumeric = true;
386  while ((y < className.Len ()) && (allFollowingCharsAreNumeric))
387  {
388  char ch = className[y];
389  allFollowingCharsAreNumeric = ((ch >= '0') && (ch <= '9'));
390  y++;
391  }
392 
393  if (allFollowingCharsAreNumeric)
394  {
395  className = className.SubStrPart (0, x - 1);
396  }
397  }
398 
399  return className;
400 } /* GetClassNameFromDirName */
__int32 kkint32
Definition: KKBaseTypes.h:88
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
kkuint32 Len() const
Returns the number of characters in the string.
Definition: KKStr.h:366
kkint32 LocateLastOccurrence(char ch) const
Returns index of last occurrence of &#39;ch&#39; otherwise -1.
Definition: KKStr.cpp:2118
KKStr osGetRootNameOfDirectory(KKStr fullDirName)
KKStr SubStrPart(kkint32 firstChar) const
returns a SubString consisting of all characters starting at index &#39;firstChar&#39; until the end of the s...
Definition: KKStr.cpp:2780
MLClassPtr MLClass::GetUnKnownClassStatic ( )
static

Definition at line 261 of file MLClass.cpp.

References CreateNewMLClass().

Referenced by KKMLL::FeatureFileIO::FeatureDataReSink(), and KKMLL::SizeDistribution::Increment().

262 {
263  return CreateNewMLClass ("UNKNOWN");
264 } /* GetUnKnownClassStatic */
static MLClassPtr CreateNewMLClass(const KKStr &_name, kkint32 _classId=-1)
Static method used to create a new instance of a MLClass object.
Definition: MLClass.cpp:100
MLClassListPtr MLClass::GlobalClassList ( )
static

Definition at line 50 of file MLClass.cpp.

References KKB::GoalKeeper::EndBlock(), KKMLL::MLClassList::MLClassList(), and KKB::GoalKeeper::StartBlock().

Referenced by BuildListOfDecendents(), CreateNewMLClass(), GetByClassId(), and ResetAllParentsToAllClasses().

51 {
52  if (!existingMLClasses)
53  {
54  CreateBlocker ();
55  blocker->StartBlock ();
56  if (!existingMLClasses)
57  {
58  existingMLClasses = new MLClassList ();
59  existingMLClasses->Owner (true);
60  }
61  blocker->EndBlock ();
62  }
63  return existingMLClasses;
64 } /* GlobalClassList */
friend class MLClassList
Definition: MLClass.h:119
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
Definition: GoalKeeper.cpp:214
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
Definition: GoalKeeper.cpp:295
bool MLClass::IsAnAncestor ( MLClassPtr  c) const

Returns true if 'c' is an ancestor

Definition at line 405 of file MLClass.cpp.

References IsAnAncestor().

Referenced by IsAnAncestor().

406 {
407  if (c == this)
408  return true;
409 
410  if (parent == NULL)
411  return false;
412 
413  return parent->IsAnAncestor (c);
414 }
bool IsAnAncestor(MLClassPtr c) const
Definition: MLClass.cpp:405
bool KKMLL::MLClass::Mandatory ( ) const
inline

Definition at line 149 of file MLClass.h.

149 {return mandatory;}
void KKMLL::MLClass::Mandatory ( bool  _mandatory)
inline

Definition at line 150 of file MLClass.h.

Referenced by KKMLL::XmlElementMLClass::XmlElementMLClass().

150 {mandatory = _mandatory;}
MLClassPtr MLClass::MLClassForGivenHierarchialLevel ( KKB::kkuint16  level) const

Definition at line 427 of file MLClass.cpp.

References KKB::KKStr::Concat(), CreateNewMLClass(), and KKB::KKStr::Split().

Referenced by KKMLL::FeatureVectorList::ExtractExamplesForHierarchyLevel(), KKMLL::TrainingConfiguration2::ExtractListOfClassesForAGivenHierarchialLevel(), KKMLL::MLClassList::ExtractListOfClassesForAGivenHierarchialLevel(), and KKMLL::TrainingConfiguration2::GenerateAConfiguraionForAHierarchialLevel().

428 {
429  VectorKKStr levelNames = name.Split ('_');
430  KKStr fullLevelName = "";
431 
432  kkuint16 curLevel = 0;
433  while ((curLevel < level) && (curLevel < levelNames.size ()))
434  {
435  if (curLevel < 1)
436  fullLevelName = levelNames[curLevel];
437  else
438  fullLevelName << "_" << levelNames[curLevel];
439 
440  curLevel++;
441  }
442 
443  return MLClass::CreateNewMLClass (fullLevelName);
444 } /* MLClassForGivenHierarchialLevel*/
VectorKKStr Split(const char *delStr="\n\r\t, ") const
Breaks up the contents of the string into tokens where the characters in &#39;delStr&#39; acts as separates e...
Definition: KKStr.cpp:3480
unsigned __int16 kkuint16
16 bit unsigned integer.
Definition: KKBaseTypes.h:86
static MLClassPtr CreateNewMLClass(const KKStr &_name, kkint32 _classId=-1)
Static method used to create a new instance of a MLClass object.
Definition: MLClass.cpp:100
kkuint16 MLClass::NumHierarchialLevels ( ) const

Definition at line 419 of file MLClass.cpp.

References KKB::KKStr::InstancesOfChar().

420 {
421  return (kkuint16)name.InstancesOfChar ('_') + 1;
422 }
kkint32 InstancesOfChar(char ch) const
Definition: KKStr.cpp:2041
unsigned __int16 kkuint16
16 bit unsigned integer.
Definition: KKBaseTypes.h:86
MLClassPtr KKMLL::MLClass::Parent ( ) const
inline

Definition at line 157 of file MLClass.h.

157 {return parent;}
void KKMLL::MLClass::Parent ( MLClassPtr  _parent)
inline

Definition at line 158 of file MLClass.h.

Referenced by ResetAllParentsToAllClasses(), and KKMLL::XmlElementMLClass::XmlElementMLClass().

158 {parent = _parent;}
const KKStr & MLClass::ParentName ( ) const

Definition at line 354 of file MLClass.cpp.

References KKB::KKStr::Concat(), KKB::KKStr::EmptyStr(), and Name().

355 {
356  if (parent)
357  return parent->Name ();
358  return KKStr::EmptyStr ();
359 }
void MLClass::ResetAllParentsToAllClasses ( )
static

Definition at line 229 of file MLClass.cpp.

References KKB::GoalKeeper::EndBlock(), GlobalClassList(), KKMLL::MLClassList::LookUpByName(), Parent(), and KKB::GoalKeeper::StartBlock().

230 {
231  CreateBlocker ();
232  blocker->StartBlock ();
233 
235 
236  MLClassPtr allClasses = globalClassList->LookUpByName ("AllClasses");
237 
239  for (idx = globalClassList->begin (); idx != globalClassList->end (); ++idx)
240  {
241  MLClassPtr ic = *idx;
242  if (ic == allClasses)
243  ic->Parent (NULL);
244  else
245  ic->Parent (allClasses);
246  }
247  blocker->EndBlock ();
248 } /* ResetAllParentsToNull */
MLClassPtr Parent() const
Definition: MLClass.h:157
std::vector< MLClass * >::iterator iterator
Definition: KKQueue.h:88
Represents a "Class" in the Machine Learning Sense.
Definition: MLClass.h:52
virtual MLClassPtr LookUpByName(const KKStr &_name) const
Returns a pointer of MLClass object with name (_name); if none in list will then return NULL...
Definition: MLClass.cpp:830
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
Definition: GoalKeeper.cpp:214
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
Definition: GoalKeeper.cpp:295
static MLClassListPtr GlobalClassList()
Definition: MLClass.cpp:50
Maintains a list of MLClass instances.
Definition: MLClass.h:233
MLClassList globalClassList
bool KKMLL::MLClass::StoredOnDataBase ( ) const
inline

Definition at line 167 of file MLClass.h.

167 {return storedOnDataBase;}
void KKMLL::MLClass::StoredOnDataBase ( bool  _storedOnDataBase)
inline

Definition at line 169 of file MLClass.h.

Referenced by KKMLL::XmlElementMLClass::XmlElementMLClass().

169 {storedOnDataBase = _storedOnDataBase;}
bool KKMLL::MLClass::Summarize ( ) const
inline

Indicates that Classification report should produce a summary column for the family of classes decedent from this class. Example classes that would set this field true are 'Protist', 'Phyto', 'Crustacean', etc....

Definition at line 171 of file MLClass.h.

void KKMLL::MLClass::Summarize ( bool  _summarize)
inline

Definition at line 177 of file MLClass.h.

Referenced by KKMLL::XmlElementMLClass::XmlElementMLClass().

177 {summarize = _summarize;}
KKStr MLClass::ToString ( ) const

Returns a KKStr representing this instance.

This string will later be written to a file.

Definition at line 364 of file MLClass.cpp.

References KKB::KKStr::Concat(), and KKB::KKStr::KKStr().

365 {
366  KKStr str (name);
367  return str;
368 }
bool KKMLL::MLClass::UnDefined ( ) const
inline

Definition at line 183 of file MLClass.h.

Referenced by KKMLL::FeatureFileIO::FeatureDataReSink(), and KKMLL::MLClassList::Load().

183 {return unDefined;}
void KKMLL::MLClass::UnDefined ( bool  _unDefined)
inline

Definition at line 184 of file MLClass.h.

184 {unDefined = _unDefined;}
void MLClass::WriteXML ( const KKStr varName,
std::ostream &  o 
) const

Definition at line 448 of file MLClass.cpp.

References KKB::XmlTag::AddAtribute(), KKB::KKStr::Empty(), Name(), KKB::XmlTag::tagEmpty, KKB::XmlTag::WriteXML(), and KKB::XmlTag::XmlTag().

Referenced by KKMLL::ModelParamDual::WriteXML(), KKMLL::MLClassList::WriteXML(), and KKMLL::XmlElementMLClass::WriteXML().

451 {
452  XmlTag startTag ("MLClass", XmlTag::TagTypes::tagEmpty);
453  if (!varName.Empty())
454  startTag.AddAtribute ("VarName", varName);
455 
456  startTag.AddAtribute ("Name", name);
457  if (parent != NULL)
458  startTag.AddAtribute ("Parent", parent->Name ());
459 
460  if (classId >= 0)
461  startTag.AddAtribute ("ClassId", classId);
462 
463  if (countFactor != 0.0f)
464  startTag.AddAtribute ("CountFactor", countFactor);
465 
466  if (description.Empty ())
467  startTag.AddAtribute ("Description", description);
468 
469  startTag.AddAtribute ("Mandatory", mandatory);
470  startTag.AddAtribute ("StoredOnDataBase", storedOnDataBase);
471  startTag.AddAtribute ("Summarize", summarize);
472  startTag.WriteXML (o);
473  o << endl;
474 } /* WriteXML */
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
bool Empty() const
Definition: KKStr.h:241

Friends And Related Function Documentation

friend class KKQueue< MLClass >
friend

Definition at line 118 of file MLClass.h.

friend class MLClassList
friend

Definition at line 119 of file MLClass.h.


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