TrueReality  v0.1.1912
MessageSystemEvent.cpp
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 
23 
24 #include <trUtil/RefStr.h>
25 
26 namespace trCore
27 {
28  const trUtil::RefStr MessageSystemEvent::MESSAGE_TYPE("trCore::MessageSystemEvent");
29 
31  MessageSystemEvent::MessageSystemEvent(const trBase::UniqueId* fromActorID, const trBase::UniqueId* aboutActorID, const trCore::SystemEvents &systemEvent)
32  : BaseClass(fromActorID, aboutActorID)
33  {
34  mSystemEvent = &systemEvent;
35  }
36 
39  {
40  }
41 
43  const std::string& MessageSystemEvent::GetMessageType() const
44  {
45  return MESSAGE_TYPE;
46  }
47 
50  {
51  return *mSystemEvent;
52  }
53 }
54 
virtual const std::string & GetMessageType() const override
Returns the Message type.
Enum that specifies type of a system event.
Definition: SystemEvents.h:35
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
MessageSystemEvent(const trBase::UniqueId *fromActorID, const trBase::UniqueId *aboutActorID, const trCore::SystemEvents &systemEvent)
Holds the class/message type name for efficient comparisons.
virtual const trCore::SystemEvents & GetSysEventType() const
Gets system event type.
const trCore::SystemEvents * mSystemEvent
osg::Referenced BaseClass
Definition: SmrtClass.h:42
static const trUtil::RefStr MESSAGE_TYPE
Adds an easy and swappable access to the base class.