Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

StorekNNData Class Reference

#include <SetKNNModule.h>

Inheritance diagram for StorekNNData:

Anp::Base List of all members.

Public Member Functions

 StorekNNData ()
virtual ~StorekNNData ()
bool SetValidity (VldContext &vld)
const VldContextGetValidity ()
bool Add (int i, const std::string &key, float data)
bool Get (int i, const std::string &key, float &data)
bool SetPrefix (std::string in)
bool Clear ()

Private Attributes

VldContext fValidity
std::string fPrefix
std::map< std::string, float > fData

Constructor & Destructor Documentation

StorekNNData::StorekNNData  ) 
 

Definition at line 33 of file SetKNNModule.cxx.

00034 {
00035 }

StorekNNData::~StorekNNData  )  [virtual]
 

Definition at line 38 of file SetKNNModule.cxx.

00039 {
00040 }


Member Function Documentation

bool StorekNNData::Add int  i,
const std::string &  key,
float  data
 

Definition at line 43 of file SetKNNModule.cxx.

References fData, and fPrefix.

00044 {
00045    char temp[3];
00046    sprintf(temp, "%02d", i);
00047    const std::string full_key = fPrefix + "_" + key + "_" + string(temp);
00048    
00049 //   if(true) cout<<"Storing: "<<full_key<<"  "<<data<<endl;
00050 
00051    return fData.insert(map<string, float>::value_type(full_key, data)).second;
00052 }

bool StorekNNData::Clear  ) 
 

Definition at line 92 of file SetKNNModule.cxx.

References fData.

00093 {
00094 //   cout<<"flushing the data!"<<endl;
00095    fData.clear();
00096    return true;
00097 }  

bool StorekNNData::Get int  i,
const std::string &  key,
float &  data
 

Definition at line 75 of file SetKNNModule.cxx.

References fData, and fPrefix.

00076 {
00077    char temp[3];
00078    sprintf(temp, "%02d", i);
00079    const std::string full_key = fPrefix + "_" + key + "_" + string(temp);
00080 
00081    map<string, float>::const_iterator fit = fData.find(full_key);
00082    if(fit != fData.end())
00083    {
00084       data = fit -> second;
00085       return true;
00086    }
00087 
00088    return false;
00089 }

const VldContext & StorekNNData::GetValidity  ) 
 

Definition at line 62 of file SetKNNModule.cxx.

00063 { 
00064    return fValidity;
00065 } 

bool StorekNNData::SetPrefix std::string  in  ) 
 

Definition at line 68 of file SetKNNModule.cxx.

References fPrefix.

00069 {
00070    fPrefix = in;
00071    return true;
00072 } 

bool StorekNNData::SetValidity VldContext vld  ) 
 

Definition at line 55 of file SetKNNModule.cxx.

References fValidity.

00056 {
00057    fValidity = vld;
00058    return true;
00059 }


Member Data Documentation

std::map<std::string, float> StorekNNData::fData [private]
 

Definition at line 34 of file SetKNNModule.h.

Referenced by Add(), Clear(), and Get().

std::string StorekNNData::fPrefix [private]
 

Definition at line 33 of file SetKNNModule.h.

Referenced by Add(), Get(), and SetPrefix().

VldContext StorekNNData::fValidity [private]
 

Definition at line 32 of file SetKNNModule.h.

Referenced by SetValidity().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:20 2010 for loon by  doxygen 1.3.9.1