GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_object.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21 *****************************************************************************/
22 
24 
25 #include "glc_object.h"
26 
28 // Constructor/Destructor
30 
31 GLC_Object::GLC_Object(const QString& name)
32 : m_Uid(glc::GLC_GenID()) // Object ID
33 , m_Name(name) // Object Name
34 , m_Mutex()
35 {
36 
37 }
38 
39 GLC_Object::GLC_Object(GLC_uint id, const QString& name)
40 : m_Uid(id)
41 , m_Name(name)
42 , m_Mutex()
43 {
44 
45 }
46 
47 GLC_Object::GLC_Object(const GLC_Object& sourceObject)
48 : m_Uid(sourceObject.m_Uid)
49 , m_Name(sourceObject.m_Name)
50 , m_Mutex()
51 {
52 }
53 
55 {
56 
57 }
58 
59 
61 // Set function
63 
65 {
66  QMutexLocker mutexLocker(&m_Mutex);
67  m_Uid= id;
68 }
69 
70 void GLC_Object::setName(const QString& name)
71 {
72  QMutexLocker mutexLocker(&m_Mutex);
73  m_Name= name;
74 }
75 
76 
78 {
79  QMutexLocker mutexLocker(&m_Mutex);
80  m_Uid= object.m_Uid;
81  m_Name= object.m_Name;
82  return *this;
83 }
84 
85 

©2005-2013 Laurent Ribon