DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
User.hpp File Reference
#include <unistd.h>
#include <sys/types.h>
#include <string>
Include dependency graph for User.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OksSystem::User
 User. More...
 

Namespaces

namespace  OksSystem
 

Functions

std::ostream & operator<< (std::ostream &stream, const OksSystem::User &user) throw ()
 
bool operator== (const OksSystem::User &a, const OksSystem::User &b) throw ()
 
bool operator!= (const OksSystem::User &a, const OksSystem::User &b) throw ()
 

Function Documentation

◆ operator!=()

bool operator!= ( const OksSystem::User & a,
const OksSystem::User & b )
throw ( )

Inequality operator

Parameters
afirst user to compare
bsecond user to compare
Returns
true if they are not equal

Definition at line 271 of file User.cpp.

271 {
272 return a.identity() != b.identity();
273} //
uid_t identity() const
user-id
Definition User.cpp:96

◆ operator<<()

std::ostream & operator<< ( std::ostream & stream,
const OksSystem::User & user )
throw ( )

Output operator, writes username followed by uid between parenthesis

Parameters
streamthe stream to write into
userthe user object to write
Returns
parameter stream

Definition at line 248 of file User.cpp.

248 {
249 unsigned int i = (unsigned int) user.identity();
250 const std::string name = user.name_safe();
251 stream << name << '(' << i << ')';
252 return stream;
253} // operator<<
const std::string & name_safe() const
username - no exception
Definition User.cpp:204

◆ operator==()

bool operator== ( const OksSystem::User & a,
const OksSystem::User & b )
throw ( )

Equality operator

Parameters
afirst user to compare
bsecond user to compare
Returns
true if they are equal

Definition at line 261 of file User.cpp.

261 {
262 return a.identity() == b.identity();
263} //