diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:48 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:48 +0200 |
| commit | bf5fc4cc4a15e8e57db58c2e065e0f5adbd8e800 (patch) | |
| tree | 855a98aec6d09361074c9725e08063553044ecfb /src/name.cpp | |
| parent | d9c4a95345bd758e45196b29368bd2ff0f2790e3 (diff) | |
tagging ychat-0.7.9.3ychat-0.7.9.3
Diffstat (limited to 'src/name.cpp')
| -rwxr-xr-x | src/name.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/name.cpp b/src/name.cpp index 646b4d9..79167f5 100755 --- a/src/name.cpp +++ b/src/name.cpp @@ -1,5 +1,3 @@ -// class name implementation. - #ifndef NAME_CPP #define NAME_CPP @@ -10,42 +8,42 @@ using namespace std; name::name() { - pthread_mutex_init( &mut_s_name, NULL); + pthread_mutex_init( &mut_s_name, NULL); } + name::name( string s_name ) { - pthread_mutex_init( &mut_s_name, NULL); - set_name( s_name ); + pthread_mutex_init( &mut_s_name, NULL); + set_name( s_name ); } name::~name() { - pthread_mutex_destroy( &mut_s_name ); + pthread_mutex_destroy( &mut_s_name ); } string -name::get_name() +name::get_name() { - string s_ret; - pthread_mutex_lock ( &mut_s_name ); - s_ret = s_name; - pthread_mutex_unlock( &mut_s_name ); - return s_ret; + string s_ret; + pthread_mutex_lock ( &mut_s_name ); + s_ret = s_name; + pthread_mutex_unlock( &mut_s_name ); + return s_ret; } string -name::get_lowercase_name() +name::get_lowercase_name() { - return tool::to_lower( get_name() ); + return tool::to_lower( get_name() ); } void name::set_name( string s_name ) { - pthread_mutex_lock ( &mut_s_name ); - this->s_name = s_name; - pthread_mutex_unlock( &mut_s_name ); + pthread_mutex_lock ( &mut_s_name ); + this->s_name = s_name; + pthread_mutex_unlock( &mut_s_name ); } - #endif |
