|
latest version v1.9 - last update 10 Apr 2010 |
|
parent class for the functors which deal with the ASCII file format to store feature vectors. More...
#include <ltiLncFeatureFile.h>


Classes | |
| class | header |
| header of a lnc feature file More... | |
| class | parameters |
| lncFeatureFile parameters class More... | |
| struct | patternId |
| The ID of a class is determined with three attributes:. More... | |
Public Member Functions | |
| virtual | ~lncFeatureFile () |
| bool | checkConsistency () |
| lncFeatureFile & | copy (const lncFeatureFile &other) |
| void | setHeader (const header &other) |
| header & | getHeader () |
| const header & | getHeader () const |
| const parameters & | getParameters () const |
Protected Member Functions | |
| lncFeatureFile () | |
| lncFeatureFile (const lncFeatureFile &other) | |
| bool | initialize (const bool deleteFile=false) |
| bool | loadNext (dvector &theVct, patternId &id) |
| bool | saveNext (const dvector &theVct, const patternId &id) |
| bool | isReadyToRead () const |
| int | getNumberOfPatterns () const |
| int | getNumberOfInputUnits () const |
| bool | loadCncFile () |
| bool | writeCncFile (const std::string &filename) |
| bool | writeToCncFile (const std::string &name) |
| bool | loadPattern (std::istream &source, dvector &theVct, patternId &id) |
| bool | savePattern (std::ostream &dest, const dvector &theVct, const patternId &id) const |
Protected Attributes | |
| header | theHeader |
| bool | mayCheckConsistence |
| bool | initialized |
| std::ifstream | input |
| std::ofstream | output |
| std::map< std::string, int > | nameToIdMap |
| std::set< int > | usedObjects |
parent class for the functors which deal with the ASCII file format to store feature vectors.
This is an abstract class an cannot be instantiated.
| virtual lti::lncFeatureFile::~lncFeatureFile | ( | ) | [virtual] |
destructor
| lti::lncFeatureFile::lncFeatureFile | ( | ) | [protected] |
default constructor
| lti::lncFeatureFile::lncFeatureFile | ( | const lncFeatureFile & | other | ) | [inline, protected] |
copy constructor
References copy().
| bool lti::lncFeatureFile::checkConsistency | ( | ) |
check the consistency of the file
| lncFeatureFile& lti::lncFeatureFile::copy | ( | const lncFeatureFile & | other | ) |
| const header& lti::lncFeatureFile::getHeader | ( | ) | const [inline] |
| header& lti::lncFeatureFile::getHeader | ( | ) | [inline] |
| int lti::lncFeatureFile::getNumberOfInputUnits | ( | ) | const [inline, protected] |
shortcut to the the dimension of the vectors on the file
| int lti::lncFeatureFile::getNumberOfPatterns | ( | ) | const [inline, protected] |
shortcut to the the number of patterns of the file
References lti::lncFeatureFile::header::numberOfPatterns, and theHeader.
| const parameters& lti::lncFeatureFile::getParameters | ( | ) | const |
| bool lti::lncFeatureFile::initialize | ( | const bool | deleteFile = false |
) | [protected] |
use the parameter values to start a reading/writing session
| bool lti::lncFeatureFile::isReadyToRead | ( | ) | const [inline, protected] |
check if the input stream is ready to be readed
References input.
| bool lti::lncFeatureFile::loadCncFile | ( | ) | [protected] |
read the cnc file
load next vector in the feature file
| bool lti::lncFeatureFile::loadPattern | ( | std::istream & | source, | |
| dvector & | theVct, | |||
| patternId & | id | |||
| ) | [protected] |
read from the given stream a pattern (class name, data and class id)
| bool lti::lncFeatureFile::savePattern | ( | std::ostream & | dest, | |
| const dvector & | theVct, | |||
| const patternId & | id | |||
| ) | const [protected] |
write in the given stream a pattern (class name, data and class id)
| void lti::lncFeatureFile::setHeader | ( | const header & | other | ) | [inline] |
| bool lti::lncFeatureFile::writeCncFile | ( | const std::string & | filename | ) | [protected] |
write the whole name-id map to the given cnc file (the contents of the file will be destroyed if the file already exists)
Reimplemented in lti::saveLnc.
| bool lti::lncFeatureFile::writeToCncFile | ( | const std::string & | name | ) | [protected] |
append a class name to the cnc-file (class-name-file)
bool lti::lncFeatureFile::initialized [protected] |
the first time the file is readed
std::ifstream lti::lncFeatureFile::input [protected] |
the input stream when reading a file
Referenced by isReadyToRead().
bool lti::lncFeatureFile::mayCheckConsistence [protected] |
specify if the file already existed
std::map<std::string,int> lti::lncFeatureFile::nameToIdMap [protected] |
the table with the correspondence between class name and id
std::ofstream lti::lncFeatureFile::output [protected] |
the output stream when writing a file
header lti::lncFeatureFile::theHeader [protected] |
the header of the file actually being used
Referenced by getHeader(), getNumberOfPatterns(), and setHeader().
std::set<int> lti::lncFeatureFile::usedObjects [protected] |
a set with the ids actually being used