summaryrefslogtreecommitdiffstats
path: root/Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp')
-rw-r--r--Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp b/Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp
new file mode 100644
index 0000000..44e57b8
--- /dev/null
+++ b/Bachelor/Verteilte Systeme/Praktikum3/IPBook_impl.cpp
@@ -0,0 +1,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();
+}