UnSerialization Class Reference

The un-serialization (loading) of the weak learners found. More...

#include <Serialization.h>

List of all members.

Public Member Functions

void loadHypotheses (const string &shypFileName, vector< BaseLearner * > &weakHypotheses)
 Load the strong hypothesis file.

Static Public Member Functions

static bool seekSimpleTag (nor_utils::StreamTokenizer &st, const string &tag)
 Move in the stream until it finds the given tag.
static bool seekParamTag (nor_utils::StreamTokenizer &st, const string &tag)
 Move in the stream until it finds the given parameter tag.
static bool seekAndParseParamTag (nor_utils::StreamTokenizer &st, const string &tag, string &tagParam, string &paramValue)
 Move in the stream until it finds the given parameter tag, then it returns its components.
static void parseParamTag (const string &str, string &tag, string &tagParam, string &paramValue)
 Parse the given token that contains a parameter tag.
template<typename T>
static T seekAndParseEnclosedValue (nor_utils::StreamTokenizer &st, const string &tag)
 Move in the stream until it finds the given tag, then it returns the value following the tag.
template<typename T>
static void seekAndParseVectorTag (nor_utils::StreamTokenizer &st, const string &arrayName, vector< T > &vecToFill)
 Move in the stream until it finds the given tag, then parse the vector which follows the tag.


Detailed Description

The un-serialization (loading) of the weak learners found.

See also:
Serialization
Date:
13/11/2005

Definition at line 178 of file Serialization.h.


Member Function Documentation

void loadHypotheses const string &  shypFileName,
vector< BaseLearner * > &  weakHypotheses
 

Load the strong hypothesis file.

Parameters:
shypFileName The name of the serialized strong hypothesis file.
weakHypotheses The vector of weak hypotheses that will be filled with the weak hypotheses stored in the xml file.
Date:
16/11/2005

Definition at line 87 of file Serialization.cpp.

Referenced by Classifier::run().

void parseParamTag const string &  str,
string &  tag,
string &  tagParam,
string &  paramValue
[static]
 

Parse the given token that contains a parameter tag.

This kind of tag, differs from the simple one because it is formatted this way: <tag param="val">. This method returns the tag, the parameter and the value.

Parameters:
str The string containing the token.
tag The tag to be filled.
tagParam The tag parameter to be filled.
paramValue The value of the parameter to be filled.
Date:
16/11/2005

Definition at line 186 of file Serialization.cpp.

static T seekAndParseEnclosedValue nor_utils::StreamTokenizer st,
const string &  tag
[inline, static]
 

Move in the stream until it finds the given tag, then it returns the value following the tag.

Parameters:
st The stream tokenizer on the file stream.
tag The tag which to look for.
Remarks:
The returned value depends on the template parameter.
Date:
16/11/2005

Definition at line 254 of file Serialization.h.

References nor_utils::cmp_nocase(), StreamTokenizer::has_token(), and StreamTokenizer::next_token().

bool seekAndParseParamTag nor_utils::StreamTokenizer st,
const string &  tag,
string &  tagParam,
string &  paramValue
[static]
 

Move in the stream until it finds the given parameter tag, then it returns its components.

This kind of tag, differs from the simple one because it is formatted this way: <tag param="val">. This method returns both param and value.

Parameters:
st The stream tokenizer on the file stream.
tag The tag which to look for.
tagParam The tag parameter to be filled.
paramValue The value of the parameter to be filled.
Returns:
True if the tag has been found, otherwise false.
See also:
seekSimpleTag

seekParamTag

Date:
16/11/2005

Definition at line 245 of file Serialization.cpp.

References nor_utils::cmp_nocase(), and StreamTokenizer::next_token().

static void seekAndParseVectorTag nor_utils::StreamTokenizer st,
const string &  arrayName,
vector< T > &  vecToFill
[inline, static]
 

Move in the stream until it finds the given tag, then parse the vector which follows the tag.

Parameters:
st The stream tokenizer on the file stream.
arrayName The name of the tag that defines the beginning of a vector.
vecToFill The vector that will receive the data.
Remarks:
The type of data which is stored in the vector depends on how the vector itself has been declared, because this method is templetized.
Date:
16/11/2005

Definition at line 281 of file Serialization.h.

References nor_utils::cmp_nocase(), ClassMappings::getIdxFromClassName(), StreamTokenizer::has_token(), and StreamTokenizer::next_token().

Referenced by StumpLearner::load(), and MultiStumpLearner::load().

bool seekParamTag nor_utils::StreamTokenizer st,
const string &  tag
[static]
 

Move in the stream until it finds the given parameter tag.

This kind of tag, differs from the simple one because it is formatted this way: <tag param="val">.

Parameters:
st The stream tokenizer on the file stream.
tag The tag which to look for.
Returns:
True if the tag has been found, otherwise false.
See also:
seekSimpleTag
Date:
16/11/2005

Definition at line 157 of file Serialization.cpp.

References nor_utils::cmp_nocase().

bool seekSimpleTag nor_utils::StreamTokenizer st,
const string &  tag
[static]
 

Move in the stream until it finds the given tag.

For instance if the stream is at the beginning of

<aTag>10<\aTag><anotherTag>15<\anotherTag><thirdTag>1<\thirdTag> 
and tag = thirdTag, the next token returned by st will be 1.
Parameters:
st The stream tokenizer on the file stream.
tag The tag which to look for.
Returns:
True if the tag has been found, otherwise false.
Date:
16/11/2005

Definition at line 145 of file Serialization.cpp.

References nor_utils::cmp_nocase(), StreamTokenizer::has_token(), and StreamTokenizer::next_token().


The documentation for this class was generated from the following files:
Generated on Mon Nov 28 21:43:48 2005 for MultiBoost by  doxygen 1.4.5