DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RemoteContext.hpp
Go to the documentation of this file.
1/*
2 * RemoteContext.h
3 * ers
4 *
5 * Created by Serguei Kolos on 26.11.05.
6 * Copyright 2004 CERN. All rights reserved.
7 *
8 */
9
10#ifndef ERS_REMOTE_CONTEXT_H
11#define ERS_REMOTE_CONTEXT_H
12
18#include <ers/Context.hpp>
19
20namespace ers
21{
23 {
24 RemoteProcessContext( const std::string & host_name,
25 int pid,
26 int tid,
27 const std::string & cwd,
28 int uid,
29 const std::string & uname,
30 const std::string & app_name )
31 : m_host_name( host_name ),
32 m_pid( pid ),
33 m_tid( tid ),
34 m_cwd( cwd ),
35 m_uid( uid ),
36 m_uname( uname ),
37 m_app_name( app_name )
38 { ; }
39
40 const std::string m_host_name;
41 const pid_t m_pid;
42 const pid_t m_tid;
43 const std::string m_cwd;
44 const int m_uid;
45 const std::string m_uname;
46 const std::string m_app_name;
47 };
48
49 class RemoteContext : public Context
50 {
51 public:
52
59 RemoteContext( const std::string & package,
60 const std::string & filename,
61 int line_number,
62 const std::string & function_name,
63 const RemoteProcessContext & pc )
64 : m_process( pc ),
65 m_package_name( package ),
69 { ; }
70
72 { ; }
73
74 virtual Context * clone() const
75 { return new RemoteContext( *this ); }
76
77 const char * cwd() const
78 { return m_process.m_cwd.c_str(); }
79
80 const char * file_name() const
81 { return m_file_name.c_str(); }
82
83 const char * function_name() const
84 { return m_function_name.c_str(); }
85
86 const char * host_name() const
87 { return m_process.m_host_name.c_str(); }
88
89 int line_number() const
90 { return m_line_number; }
91
92 const char * package_name() const
93 { return m_package_name.c_str(); }
94
95 pid_t process_id() const
96 { return m_process.m_pid; }
97
98 pid_t thread_id() const
99 { return m_process.m_tid; }
100
101 void * const * stack_symbols() const
102 { return 0; }
103
104 int stack_size() const
105 { return 0; }
106
107 int user_id() const
108 { return m_process.m_uid; }
109
110 const char * user_name() const
111 { return m_process.m_uname.c_str(); }
112
113 const char * application_name() const
114 { return m_process.m_app_name.c_str(); }
115
116 private:
118 const std::string m_package_name;
119 const std::string m_file_name;
120 const std::string m_function_name;
121 const int m_line_number;
122 };
123}
124
125#endif
126
An abstract interface to access an Issue context.
Definition Context.hpp:30
const char * application_name() const
const char * package_name() const
virtual Context * clone() const
const char * function_name() const
RemoteContext(const std::string &package, const std::string &filename, int line_number, const std::string &function_name, const RemoteProcessContext &pc)
void *const * stack_symbols() const
const char * cwd() const
const std::string m_package_name
pid_t thread_id() const
const char * user_name() const
const RemoteProcessContext m_process
const std::string m_function_name
const char * host_name() const
const char * file_name() const
pid_t process_id() const
const std::string m_file_name
int line_number() const
const std::string m_app_name
const std::string m_host_name
RemoteProcessContext(const std::string &host_name, int pid, int tid, const std::string &cwd, int uid, const std::string &uname, const std::string &app_name)
const std::string m_uname