MChunkUsage.h
1 /*****************************************************************************
2 **
3 ** Header file for Muster API Chunk usage query object
4 **
5 ** Name : MChunkUsage.h
6 ** Author : Leonardo Bernardini
7 ** Version : Alpha 9.0 Wed May 17th 2017
8 **
9 ** Copyright 2000-2019, 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 MCHUNKUSAGE_H
19 #define MCHUNKUSAGE_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 #if defined(_WIN32)
42 #pragma warning(disable: 4251)
43 #endif // _WIN32
44 
45 #include <string>
46 #include <vector>
47 #include <set>
48 
49 namespace MClientLib {
50 
60  class MCLIENTLIB_API MChunkUsage {
61  public:
62  MChunkUsage();
63  ~MChunkUsage();
65  long getId();
66  std::string getCpuUsage();
67  std::string getRamUsage();
68  std::string getNicsUsage();
69  std::string getDisksUsage();
71  time_t getSamplingTime();
72  int getReferenceFrame();
74  void setId(long _id );
75  void setCpuUsage(std::string _cpuUsage );
76  void setRamUsage(std::string _ramUsage );
77  void setNicsUsage(std::string _nicsUsage );
78  void setDisksUsage(std::string _disksUsage );
79  void setSamplingTime(time_t _samplingTime );
80  void setReferenceFrame(int _referenceFrame );
83  std::string Marshall();
84  bool Unmarshall(const std::vector<std::string>& items);
85  static std::string Marshall(std::vector<MChunkUsage>& list);
86  static bool Unmarshall(const std::string& items, std::vector<MChunkUsage>& out);
89  private:
90  std::string cpuUsage;
91  std::string ramUsage;
92  std::string nicsUsage;
93  std::string disksUsage;
94 
95  time_t samplingTime;
96  int referenceFrame;
97 
98  long id;
99  };
100 
103 }
104 
105 #endif
106 
Class holding a chunk usage sample over time.
Definition: MChunkUsage.h:60