Overte C++ Documentation
NodeData.h
1 //
2 // NodeData.h
3 // libraries/networking/src
4 //
5 // Created by Stephen Birarda on 2/19/13.
6 // Copyright 2013 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_NodeData_h
13 #define hifi_NodeData_h
14 
15 #include <QtCore/QMutex>
16 #include <QtCore/QObject>
17 
18 #include "NetworkPeer.h"
19 #include "NLPacket.h"
20 #include "ReceivedMessage.h"
21 
22 class Node;
23 
24 class NodeData : public QObject {
25  Q_OBJECT
26 public:
27  NodeData(const QUuid& nodeID = QUuid(), NetworkPeer::LocalID localID = NetworkPeer::NULL_LOCAL_ID);
28  virtual ~NodeData() = default;
29  virtual int parseData(ReceivedMessage& message) { return 0; }
30 
31  const QUuid& getNodeID() const { return _nodeID; }
32  NetworkPeer::LocalID getNodeLocalID() const { return _nodeLocalID; }
33 
34  QMutex& getMutex() { return _mutex; }
35 
36 private:
37  QMutex _mutex;
38  QUuid _nodeID;
39  NetworkPeer::LocalID _nodeLocalID;
40 };
41 
42 #endif // hifi_NodeData_h