DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RemoteContext.hpp
Go to the documentation of this file.
1/*
2 * DUNE DAQ modification notice:
3 * This file has been modified from the original ATLAS ers source for the DUNE DAQ project.
4 * Fork baseline commit: 8267df82a4f6fe6bf02c4014923eba19eddc4614 (2020-04-14).
5 * Renamed since fork: yes (from ers/RemoteContext.h to include/ers/RemoteContext.hpp).
6 *
7 * Original copyright:
8 * Copyright (C) 2001-2020 CERN for the benefit of the ATLAS collaboration.
9 * Licensed under the Apache License, Version 2.0.
10 */
11
12/*
13 * RemoteContext.h
14 * ers
15 *
16 * Created by Serguei Kolos on 26.11.05.
17 * Copyright 2004 CERN. All rights reserved.
18 *
19 */
20
21#ifndef ERS_REMOTE_CONTEXT_H
22#define ERS_REMOTE_CONTEXT_H
23
28
29#include <ers/Context.hpp>
30
31namespace ers
32{
34 {
35 RemoteProcessContext( const std::string & host_name,
36 int pid,
37 int tid,
38 const std::string & cwd,
39 int uid,
40 const std::string & uname,
41 const std::string & app_name )
42 : m_host_name( host_name ),
43 m_pid( pid ),
44 m_tid( tid ),
45 m_cwd( cwd ),
46 m_uid( uid ),
47 m_uname( uname ),
48 m_app_name( app_name )
49 { ; }
50
51 const std::string m_host_name;
52 const pid_t m_pid;
53 const pid_t m_tid;
54 const std::string m_cwd;
55 const int m_uid;
56 const std::string m_uname;
57 const std::string m_app_name;
58 };
59
60 class RemoteContext : public Context
61 {
62 public:
63
70 RemoteContext( const std::string & package,
71 const std::string & filename,
72 int line_number,
73 const std::string & function_name,
74 const RemoteProcessContext & pc )
75 : m_process( pc ),
76 m_package_name( package ),
80 { ; }
81
83 { ; }
84
85 virtual Context * clone() const
86 { return new RemoteContext( *this ); }
87
88 const char * cwd() const
89 { return m_process.m_cwd.c_str(); }
90
91 const char * file_name() const
92 { return m_file_name.c_str(); }
93
94 const char * function_name() const
95 { return m_function_name.c_str(); }
96
97 const char * host_name() const
98 { return m_process.m_host_name.c_str(); }
99
100 int line_number() const
101 { return m_line_number; }
102
103 const char * package_name() const
104 { return m_package_name.c_str(); }
105
106 pid_t process_id() const
107 { return m_process.m_pid; }
108
109 pid_t thread_id() const
110 { return m_process.m_tid; }
111
112 void * const * stack_symbols() const
113 { return 0; }
114
115 int stack_size() const
116 { return 0; }
117
118 int user_id() const
119 { return m_process.m_uid; }
120
121 const char * user_name() const
122 { return m_process.m_uname.c_str(); }
123
124 const char * application_name() const
125 { return m_process.m_app_name.c_str(); }
126
127 private:
129 const std::string m_package_name;
130 const std::string m_file_name;
131 const std::string m_function_name;
132 const int m_line_number;
133 };
134}
135
136#endif
137
An abstract interface to access an Issue context.
Definition Context.hpp:41
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
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