change log updated
[public/netxms.git] / include / nxclobj.h
CommitLineData
14149881
VK
1/*
2** NetXMS - Network Management System
3** Client Library API
4** Copyright (C) 2003-2014 Victor Kirhenshtein
5**
6** This program is free software; you can redistribute it and/or modify
7** it under the terms of the GNU Lesser General Public License as published by
8** the Free Software Foundation; either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public License
17** along with this program; if not, write to the Free Software
18** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19**
20** File: nxclobj.h
21**
22**/
23
24#ifndef _nxclobj_h_
25#define _nxclobj_h_
26
27#include <geolocation.h>
28
29/**
30 * Generic object class
31 */
32class LIBNXCLIENT_EXPORTABLE AbstractObject : public RefCountObject
33{
34protected:
35 UINT32 m_id;
36 uuid_t m_guid;
37 int m_class;
38 TCHAR m_name[MAX_OBJECT_NAME];
39 int m_status;
40 InetAddress m_primaryIP;
41 TCHAR *m_comments;
42 StringMap m_customAttributes;
43 UINT32 m_submapId;
44 IntegerArray<UINT32> *m_parents;
45 IntegerArray<UINT32> *m_children;
46 GeoLocation m_geoLocation;
47
48public:
49 AbstractObject(NXCPMessage *msg);
50 virtual ~AbstractObject();
51
52 UINT32 getId() { return m_id; }
53 int getObjectClass() { return m_class; }
54 const TCHAR *getName() { return m_name; }
55 const InetAddress& getPrimaryIP() { return m_primaryIP; }
56 const TCHAR *getComments() { return m_comments; }
57 const TCHAR *getCustomAttribute(const TCHAR *name) { return m_customAttributes.get(name); }
58 UINT32 getSubmapId() { return m_submapId; }
59 const GeoLocation& getGeoLocation() { return m_geoLocation; }
60};
61
62/**
63 * Node object
64 */
65class LIBNXCLIENT_EXPORTABLE Node : public AbstractObject
66{
67protected:
68 TCHAR *m_primaryHostname;
69
70public:
71 Node(NXCPMessage *msg);
72 virtual ~Node();
73
74 const TCHAR *getPrimaryHostname() { return m_primaryHostname; }
75};
76
77#endif