Muster SDK  8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MProcess.h
Go to the documentation of this file.
1 /*****************************************************************************
2  **
3  ** Header file for Muster API process object
4  **
5  ** Name : MError.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 MPROCESS_H
19 #define MPROCESS_H
20 
21 #ifdef WIN32
22 
23 // Disable STL Export warning, member is private, we don't need direct access from the DLL client
24 #if defined(_WIN32)
25 #pragma warning(disable: 4251)
26 #endif // _WIN32
27 
28 // Windows definitions
29 #ifdef MCLIENTLIB_EXPORTS
30 #define MCLIENTLIB_API __declspec(dllexport)
31 #else
32 #define MCLIENTLIB_API __declspec(dllimport)
33 #endif
34 #else
35 
36 #ifndef MCLIENTLIB_EXPORTS
37 #ifdef LINUX
38 #define MCLIENTLIB_API
39 #else
40 #define MCLIENTLIB_API
41 #endif
42 #else
43 #define MCLIENTLIB_API
44 #endif
45 #endif
46 
47 #include <string>
48 #include <map>
49 #include <vector>
50 
51 #ifdef WIN32
52  typedef unsigned long MPid ;
53 #else
54  typedef pid_t MPid;
55 #endif
56 
57 namespace MClientLib {
58 
62  typedef struct {
63  std::string procName;
67 
72  public:
73  MEnvironment();
74  MEnvironment(bool _fromRunningEnvironment);
75  void setValue(const std::string& key, const std::string& value);
76  void unsetValue(const std::string& key);
77  std::string getValue(const std::string& key);
78  bool hasValue(const std::string& key);
79  void clearValues();
80  void purgeEnvironment(const char* username);
81  std::map<std::string, std::string> map;
82  private:
83  static MEnvironment createFromRunningEnvironment();
84  std::string resolveEnvironmentString(const std::string& str) ;
85  };
86 
87  typedef std::vector <MProcessSnapshot*> processesSnapshot;
88 
89 
90 }
91 
92 #endif