glc_object.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 *****************************************************************************/
00022 
00024 
00025 #include "glc_object.h"
00026 
00028 // Constructor/Destructor
00030 
00031 GLC_Object::GLC_Object(const QString& name)
00032 : m_Uid(glc::GLC_GenID())       // Object ID
00033 , m_Name(name)                  // Object Name
00034 , m_Mutex()
00035 {
00036 
00037 }
00038 
00039 GLC_Object::GLC_Object(GLC_uint id, const QString& name)
00040 : m_Uid(id)
00041 , m_Name(name)
00042 , m_Mutex()
00043 {
00044 
00045 }
00046 
00047 GLC_Object::GLC_Object(const GLC_Object& sourceObject)
00048 : m_Uid(sourceObject.m_Uid)
00049 , m_Name(sourceObject.m_Name)
00050 , m_Mutex()
00051 {
00052 }
00053 
00054 GLC_Object::~GLC_Object()
00055 {
00056 
00057 }
00058 
00059 
00061 // Set function
00063 
00064 void GLC_Object::setId(const GLC_uint id)
00065 {
00066         QMutexLocker mutexLocker(&m_Mutex);
00067         m_Uid= id;
00068 }
00069 
00070 void GLC_Object::setName(const QString& name)
00071 {
00072         QMutexLocker mutexLocker(&m_Mutex);
00073         m_Name= name;
00074 }
00075 
00076 
00077 GLC_Object& GLC_Object::operator=(const GLC_Object& object)
00078 {
00079         QMutexLocker mutexLocker(&m_Mutex);
00080         m_Uid= object.m_Uid;
00081         m_Name= object.m_Name;
00082         return *this;
00083 }
00084 
00085 

SourceForge.net Logo

©2005-2011 Laurent Ribon