TrueReality  v0.1.1912
trBase/Base.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include <trBase/Export.h>
25 
26 #include <trBase/SmrtClass.h>
27 #include <trBase/UniqueId.h>
28 #include <trUtil/RefStr.h>
29 
30 namespace trBase
31 {
32 
37  {
38  public:
39 
41 
42  const static trUtil::RefStr CLASS_TYPE;
43 
51  Base(const std::string& name = CLASS_TYPE);
52 
60  virtual const std::string& GetType() const override = 0;
61 
69  virtual void SetName(const std::string& name);
70 
78  virtual const std::string& GetName();
79 
87  virtual const std::string& GetName() const;
88 
97  virtual void SetUUID(const trBase::UniqueId& id);
98 
102  virtual const trBase::UniqueId& GetUUID(void);
103 
104  protected:
105 
115  ~Base();
116 
117  private:
118 
121 
122  };
123 
124 }
125 
#define TR_BASE_EXPORT
Definition: trBase/Export.h:34
trUtil::RefStr mName
Definition: trBase/Base.h:119
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one...
Definition: UniqueId.h:42
A string wrapper that will make sure that all of the strings with the same value will point to the sa...
Definition: RefStr.h:50
This class is part of the internal garbage collection system.
Definition: SmrtClass.h:38
This is a Base class that carries the Class name and Unique ID of all the derived classes...
Definition: trBase/Base.h:36
static const trUtil::RefStr CLASS_TYPE
Adds an easy and swappable access to the base class.
Definition: trBase/Base.h:42
trBase::UniqueId mId
Definition: trBase/Base.h:120