blob: 251c64734c45ee86313efccc399d9d5d14a42dcd [file] [log] [blame]
#include<iostream>
#include<algorithm>
#include "nlsr_npl.hpp"
using namespace std;
Npl::Npl(){
}
Npl::~Npl(){
}
static bool
nameCompare(string& s1, string& s2){
return s1==s2;
}
int
Npl::insertIntoNpl(string& name){
std::list<string >::iterator it = std::find_if( nameList.begin(),
nameList.end(),
bind(&nameCompare, _1 , name));
if( it != nameList.end() ){
return -1;
}
nameList.push_back(name);
return 0;
}
void
Npl::printNpl(){
int i=1;
for( std::list<string>::iterator it=nameList.begin(); it != nameList.end(); it++){
cout<<"Name "<<i<<" : "<<(*it)<<endl;
i++;
}
}