From ae4e87df37ed8904de92c7cf2f3a11128cda2a21 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:41 +0200 Subject: tagging ychat-0.7.4.1 --- src/maps/nmap.tmpl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/maps/nmap.tmpl (limited to 'src/maps/nmap.tmpl') diff --git a/src/maps/nmap.tmpl b/src/maps/nmap.tmpl new file mode 100644 index 0000000..6fdea2f --- /dev/null +++ b/src/maps/nmap.tmpl @@ -0,0 +1,31 @@ +#ifndef NMAP_CPP +#define NMAP_CPP + +#include "nmap.h" + +template +nmap::nmap( double moc ) : smap::smap(moc) +{ +} + +template +nmap::~nmap() +{ +} + +template +obj_type nmap::get_elem ( const key_type &k ) { + // Create new object; + obj_type ret_val; + + smap::lock_mutex(); + int i_current_pos = find_pos( k ); + if( smap::is_active( i_current_pos ) ) + ret_val = smap::array[ i_current_pos ].element; + // else + // ret_val = new obj_type(); + smap::unlock_mutex(); + return ret_val; +} + +#endif -- cgit v1.2.3