#include <DDSClientId.h>
Public Member Functions | |
| DDSClientId (DDS::EClientType type=DDS::kUnknownClientType, string clientname="") | |
| virtual | ~DDSClientId () |
| DDS::EClientType | GetClientType () const |
| string | GetClientName () const |
| string | GetUserName () const |
| string | GetRealName () const |
| string | GetHostName () const |
| const VldTimeStamp & | GetStartTime () const |
| int | GetChildPid () const |
| std::ostream & | Print (std::ostream &ms) const |
| void | Print (Option_t *option="") const |
Protected Member Functions | |
| void | Connected (int childpid) |
Private Attributes | |
| DDS::EClientType | fClientType |
| string | fClientName |
| string | fUserName |
| string | fRealName |
| string | fHostName |
| VldTimeStamp | fStartTime |
| int | fChildPid |
Friends | |
| class | DDSParentServer |
|
||||||||||||
|
Definition at line 28 of file DDSClientId.cxx. References fClientName, fHostName, fRealName, fUserName, gSystem(), and MSG. 00028 : 00029 fClientType(clienttype), fClientName(clientname), 00030 fUserName(""), fRealName(""), fHostName(""),fStartTime(0), 00031 fChildPid(0) { 00032 // Default constructor 00033 00034 if ( fClientName.size() > 30 ) { 00035 fClientName.resize(30); 00036 MSG("DDS",Msg::kWarning) << "Client name exceeds 30 character limit." 00037 << "\nTruncated to " 00038 << fClientName.c_str() << endl; 00039 } 00040 00041 // Fill identifying user information using system functions 00042 UserGroup_t* usergrp = gSystem->GetUserInfo(gSystem->GetUid()); 00043 if ( usergrp ) { 00044 fUserName = usergrp -> fUser; // username 00045 fRealName = usergrp -> fRealName; // user's full name 00046 } 00047 else { 00048 MSG("DDS",Msg::kWarning) 00049 << "Failed to identify user info for client w/uid " 00050 << gSystem->GetUid() << "." << endl; 00051 } 00052 if ( usergrp ) delete usergrp; usergrp = 0; // has ownership 00053 00054 // This system's host name and ip address 00055 fHostName = gSystem->HostName(); 00056 00057 }
|
|
|
Definition at line 60 of file DDSClientId.cxx. 00060 {
00061 // Destructor.
00062
00063 }
|
|
|
Definition at line 66 of file DDSClientId.cxx. References fChildPid, and fStartTime. 00066 {
00067 // Purpose: Invoked by DDSParentServer when client connection with
00068 // child established. Also sets start time of connection
00069 // to Now.
00070 // Protected method accessible only by DDSParentServer friend.
00071
00072 fChildPid = childpid;
00073 fStartTime = VldTimeStamp(); // set to current time
00074
00075 }
|
|
|
Definition at line 46 of file DDSClientId.h. 00046 { return fChildPid; }
|
|
|
Definition at line 41 of file DDSClientId.h. 00041 { return fClientName; }
|
|
|
Definition at line 40 of file DDSClientId.h. 00040 { return fClientType; }
|
|
|
Definition at line 44 of file DDSClientId.h. 00044 { return fHostName; }
|
|
|
Definition at line 43 of file DDSClientId.h. 00043 { return fRealName; }
|
|
|
Definition at line 45 of file DDSClientId.h. 00045 { return fStartTime; }
|
|
|
Definition at line 42 of file DDSClientId.h. 00042 { return fUserName; }
|
|
|
Definition at line 105 of file DDSClientId.cxx. References Print(). 00105 {
00106 // Purpose: Print method in TObject::Print format
00107
00108 Print(std::cout);
00109
00110 }
|
|
|
Definition at line 78 of file DDSClientId.cxx. References VldTimeStamp::AsString(), DDS::AsString(), fChildPid, fClientName, fClientType, fHostName, fRealName, fStartTime, fUserName, and VldTimeStamp::GetSec(). Referenced by Print(). 00078 {
00079 // Purpose: Print DDSClientId status on std::ostream.
00080
00081 VldTimeStamp currentTime;
00082 if ( fStartTime.GetSec() == 0 ) currentTime = VldTimeStamp(0);
00083
00084 os << fUserName.c_str()
00085 << " \"" << fRealName.c_str() << "\" "
00086 << fHostName.c_str() << " Type: "
00087 << DDS::AsString(fClientType);
00088
00089 if ( !fClientName.empty() ) os << "/" << fClientName.c_str();
00090
00091 if ( fChildPid ) {
00092 os << "\n CS pid " << fChildPid << " Start: "
00093 << fStartTime.AsString("s") << " UpTime(sec): "
00094 << (currentTime-fStartTime).GetSec() << "." << endl;
00095 }
00096 else
00097 os << endl;
00098
00099
00100 return os;
00101
00102 }
|
|
|
Definition at line 30 of file DDSClientId.h. |
|
|
Definition at line 64 of file DDSClientId.h. Referenced by Connected(), and Print(). |
|
|
Definition at line 59 of file DDSClientId.h. Referenced by DDSClientId(), and Print(). |
|
|
Definition at line 58 of file DDSClientId.h. Referenced by Print(). |
|
|
Definition at line 62 of file DDSClientId.h. Referenced by DDSClientId(), and Print(). |
|
|
Definition at line 61 of file DDSClientId.h. Referenced by DDSClientId(), and Print(). |
|
|
Definition at line 63 of file DDSClientId.h. Referenced by Connected(), and Print(). |
|
|
Definition at line 60 of file DDSClientId.h. Referenced by DDSClientId(), and Print(). |
1.3.9.1