xrootd
XrdMonSndDummyXrootd.hh
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* */
3 /* XrdMonSndDummyXrootd.hh */
4 /* */
5 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* All Rights Reserved */
7 /* Produced by Jacek Becla for Stanford University under contract */
8 /* DE-AC02-76SF00515 with the Department of Energy */
9 /*****************************************************************************/
10 
11 // $Id$
12 
13 #ifndef XRDMONSNDDUMMYXROOTD_HH
14 #define XRDMONSNDDUMMYXROOTD_HH
15 
16 #include <vector>
17 #include <string>
18 #include "XrdMon/XrdMonTypes.hh"
22 using std::vector;
23 using std::string;
24 
26 public:
31 
34 
35  int initialize(const char* pathFile);
40  void closeFiles(vector<kXR_int32>& closedFiles);
41 
42 private:
43  int readPaths(const char* pathFile);
44  void createUser();
45  void createProcess();
46  void createFile();
47  string generateUserName(kXR_int16 uid);
48  string generateHostName();
49 
50  struct User {
51  struct HostAndPid {
52  string name;
54  vector<kXR_int16> myFiles; // offsets in _paths vector
55  HostAndPid(string n, kXR_int16 id)
56  : name(n), pid(id) {};
57  };
58 
60  vector<HostAndPid> myProcesses;
61  User(kXR_int16 id) : uid(id) {}
62  };
63 
64  vector<User> _users;
65 
69 
73  bool _newFile;
74 
75  struct PathData {
76  string path;
78  PathData(const char* s, kXR_int16 id) : path(s), fd(id) {}
79  };
80 
81  // input data to pick from, loaded from ascii file
82  // Yes, this might be a lot of memory
83  vector<PathData> _paths;
84 
86  vector<kXR_unt32> _noTracesPerDict;
87 
88  vector<bool> _openFiles; // true: open, false: close
89 };
90 
91 #endif /* XRDMONSNDDUMMYXROOTD_HH */