summaryrefslogtreecommitdiff
path: root/yhttpd-0.7.0/src/maps/nmap.tmpl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:41 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:41 +0200
commit9cd3ccffd5372dfde3af478e3f832f18db4be3f1 (patch)
tree631c295a4a4a16b57502b847626763a279bf6df7 /yhttpd-0.7.0/src/maps/nmap.tmpl
parent13aaf70af703748fe096e0664c305cd202637ad2 (diff)
tagging tags
Diffstat (limited to 'yhttpd-0.7.0/src/maps/nmap.tmpl')
-rw-r--r--yhttpd-0.7.0/src/maps/nmap.tmpl31
1 files changed, 31 insertions, 0 deletions
diff --git a/yhttpd-0.7.0/src/maps/nmap.tmpl b/yhttpd-0.7.0/src/maps/nmap.tmpl
new file mode 100644
index 0000000..6fdea2f
--- /dev/null
+++ b/yhttpd-0.7.0/src/maps/nmap.tmpl
@@ -0,0 +1,31 @@
+#ifndef NMAP_CPP
+#define NMAP_CPP
+
+#include "nmap.h"
+
+template <class obj_type, class key_type>
+nmap<obj_type, key_type>::nmap( double moc ) : smap<obj_type, key_type>::smap(moc)
+{
+}
+
+template <class obj_type, class key_type>
+nmap<obj_type, key_type>::~nmap()
+{
+}
+
+template <class obj_type, class key_type>
+obj_type nmap<obj_type, key_type>::get_elem ( const key_type &k ) {
+ // Create new object;
+ obj_type ret_val;
+
+ smap<obj_type, key_type>::lock_mutex();
+ int i_current_pos = find_pos( k );
+ if( smap<obj_type, key_type>::is_active( i_current_pos ) )
+ ret_val = smap<obj_type, key_type>::array[ i_current_pos ].element;
+ // else
+ // ret_val = new obj_type();
+ smap<obj_type, key_type>::unlock_mutex();
+ return ret_val;
+}
+
+#endif