summaryrefslogtreecommitdiffstats
path: root/Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp
blob: 44e57b8d0e17c494ae3aff6e680433e68c8bc5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <CORBA.h>
#include "IPBook_impl.h"

void IPBook_impl::addEntry( const char* name, const char* number)
{
    string nam = name;
    string num = number;

    _numbers[nam] = num;
}

char* IPBook_impl::searchEntry( const char* name )
{
    map <string, string, less<string> >::iterator r;
    r = _numbers.find(name);
    if (r != _numbers.end()) {
        return CORBA::string_dup( (*r).second.c_str());
    }
    else {
        return CORBA::string_dup( "NOT FOUND");
    }
}

CORBA::Long IPBook_impl::count()
{
	
	return _numbers.size();
}