Muster SDK  8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MLog.h
Go to the documentation of this file.
1 /*****************************************************************************
2  **
3  ** Header file for Muster API Log object lib
4  **
5  ** Name : MLog.h
6  ** Author : Leonardo Bernardini
7  ** Version : 1.0, Sat Mar 2nd 2013
8  **
9  ** Copyright 2000-2014, 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 
51 
56  public:
57 
61  enum kLogsSource {
62  kLogSourceSystem = 0x01,
63  kLogSourceUser = 0x02,
64  kLogSourceInstanceWithSuccess = 0x04,
65  kLogSourceInstanceWithFailure = 0x08
66  };
67 
68  public:
69  MLog();
70  virtual ~MLog();
71 
72  virtual std::string getDescription();
73  virtual std::string getSourceIp();
74  virtual std::string getSourceHost();
75  virtual std::string getUser();
76  virtual long long int getTime();
77  virtual int getType();
78  virtual long getEventID();
79  virtual long getChunkID();
80  virtual long getJobID();
81  virtual long getInstanceID();
82 
83  virtual void setDescription(const std::string& _description);
84  virtual void setSourceIp(const std::string& _sourceIp);
85  virtual void setSourceHost(const std::string& _sourceHost);
86  virtual void setUser(const std::string& _user);
87  virtual void setTime(long long int _time);
88  virtual void setType(int _type);
89  virtual void setEventID(long _eventId);
90  virtual void setChunkID(long _chunkId);
91  virtual void setJobID(long _jobId);
92  virtual void setInstanceID(long _instanceId);
93 
94  virtual bool Unmarshall(std::vector<std::string>& items);
95  virtual std::string Marshall();
96  private:
97  int type;
98  long long int time;
99  std::string description;
100  std::string sourceIp;
101  std::string sourceHost;
102  std::string user;
103  long eventID;
104  long chunkID;
105  long jobID;
106  long instanceID;
107  } ;
108 }
109 #endif