MLog.h
1 /*****************************************************************************
2  **
3  ** Header file for Muster API Log object lib
4  **
5  ** Name : MLog.h
6  ** Author : Leonardo Bernardini
7 ** Version : Alpha 9.0 Wed May 17th 2017
8  **
9  ** Copyright 2000-2017, Virtual Vertex
10  ** All Rights Reserved.
11  **
12  ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13  ** The contents of this file may not be disclosed to third parties, copied
14  ** or duplicated in any form, in whole or in part, without the prior written
15  ** permission of the author.
16  **
17  *****************************************************************************/
18 #ifndef MLOG_H
19 #define MLOG_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MCLIENTLIB_EXPORTS
24 #define MCLIENTLIB_API __declspec(dllexport)
25 #else
26 #define MCLIENTLIB_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MCLIENTLIB_EXPORTS
31 #ifdef LINUX
32 #define MCLIENTLIB_API
33 #else
34 #define MCLIENTLIB_API
35 #endif
36 #else
37 #define MCLIENTLIB_API
38 #endif
39 #endif
40 
41 // Disable STL Export warning, member is private, we don't need direct access from the DLL client
42 #if defined(_WIN32)
43 #pragma warning(disable: 4251)
44 #endif // _WIN32
45 
46 #include <string>
47 #include <vector>
48 
49 namespace MClientLib {
50 
61  class MCLIENTLIB_API MLog {
62  public:
63 
67  enum kLogsSource {
68  kLogSourceSystem = 0x01,
69  kLogSourceUser = 0x02,
70  kLogSourceInstanceWithSuccess = 0x04,
71  kLogSourceInstanceWithFailure = 0x08
72  };
73 
74  public:
75  MLog();
76  virtual ~MLog();
77 
78  virtual std::string getDescription();
79  virtual std::string getSourceIp();
80  virtual std::string getSourceHost();
81  virtual std::string getUser();
82  virtual long long int getTime();
83  virtual int getType();
84  virtual long getEventID();
85  virtual long getChunkID();
86  virtual long getJobID();
87  virtual long getInstanceID();
88  virtual long getHistoryChunkID();
89 
90  virtual void setDescription(const std::string& _description);
91  virtual void setSourceIp(const std::string& _sourceIp);
92  virtual void setSourceHost(const std::string& _sourceHost);
93  virtual void setUser(const std::string& _user);
94  virtual void setTime(long long int _time);
95  virtual void setType(int _type);
96  virtual void setEventID(long _eventId);
97  virtual void setChunkID(long _chunkId);
98  virtual void setJobID(long _jobId);
99  virtual void setInstanceID(long _instanceId);
100  virtual void setHistoryChunkID(long _chunkId);
102  virtual bool Unmarshall(const std::vector<std::string>& items);
103  virtual std::string Marshall();
104  void castedRelease();
107  private:
108  int type;
109  long long int time;
110  std::string description;
111  std::string sourceIp;
112  std::string sourceHost;
113  std::string user;
114  long eventID;
115  long chunkID;
116  long jobID;
117  long instanceID;
118  long historyChunkID;
119  };
120 
123 }
124 #endif
Class holding a log entry data.
Definition: MLog.h:61