MCPcopy Create free account
hub / github.com/3rdparty/libprocess / UPID

Class UPID

include/process/pid.hpp:39–216  ·  view source on GitHub ↗

* An "untyped" `PID`, used to encapsulate the process ID for * lower-layer abstractions (eg, when receiving incoming requests) * in the dispatching mechanism. * * @see process::PID */

Source from the content-addressed store, hash-verified

37 * @see process::PID
38 */
39struct UPID
40{
41 UPID() = default;
42
43 UPID(const UPID& that) = default;
44
45 UPID(UPID&& that) = default;
46
47 UPID(const char* id_, const net::IP& ip_, uint16_t port_)
48 : id(id_), address(ip_, port_) { resolve(); }
49
50 UPID(const char* id_, const network::inet::Address& address_)
51 : id(id_), address(address_) { resolve(); }
52
53 UPID(const std::string& id_, const net::IP& ip_, uint16_t port_)
54 : id(id_), address(ip_, port_) { resolve(); }
55
56 UPID(const std::string& id_, const network::inet::Address& address_)
57 : id(id_), address(address_) { resolve(); }
58
59 /*implicit*/ UPID(const char* s);
60
61 /*implicit*/ UPID(const std::string& s);
62
63 /*implicit*/ UPID(const ProcessBase& process);
64
65 UPID& operator=(const UPID& that) = default;
66
67 UPID& operator=(UPID&& that) = default;
68
69 operator std::string() const;
70
71 operator bool() const
72 {
73 return id != "" && !address.ip.isAny() && address.port != 0;
74 }
75
76 bool operator!() const // NOLINT(whitespace/operators)
77 {
78 return id == "" && address.ip.isAny() && address.port == 0;
79 }
80
81 bool operator<(const UPID& that) const
82 {
83 if (address == that.address) {
84 return id < that.id;
85 } else {
86 return address < that.address;
87 }
88 }
89
90 bool operator==(const UPID& that) const
91 {
92 return (id == that.id && address == that.address);
93 }
94
95 bool operator!=(const UPID& that) const
96 {

Callers 12

timerMethod · 0.85
parseFunction · 0.85
handleMethod · 0.85
spawnMethod · 0.85
terminateMethod · 0.85
spawnFunction · 0.85
postFunction · 0.85
runMethod · 0.85
TEST_FFunction · 0.85
mainFunction · 0.85
TimerMethod · 0.85
consumeMethod · 0.85

Calls

no outgoing calls

Tested by 3

runMethod · 0.68
TEST_FFunction · 0.68
mainFunction · 0.68