src/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
0 / 6
0.0%
Branches:
0 / 8
0.0%
Functions:
0 / 4
0.0%

ps/base/Postoffice.h
Line Branch Exec Source
1 #pragma once
2 #include <string>
3
4 class XPostoffice {
5 public:
6 ✗ static XPostoffice* GetInstance() {
7
0/8
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ static XPostoffice instance;
8 ✗ return &instance;
9 }
10
11 bool IsServer() const { return actor_ == ACTOR_SERVER; }
12
13 bool IsClient() const { return actor_ == ACTOR_CLIENT; }
14
15 int ServerID() const { return server_id_; }
16
17 ✗ int ClientID() const { return client_id_; }
18
19 int GlobalID() const { return global_id_; }
20
21 ✗ int NumServers() const { return num_servers_; }
22 ✗ int NumClients() const { return num_clients_; }
23
24 private:
25 XPostoffice();
26 int num_servers_;
27 int num_clients_;
28 int global_id_;
29 int server_id_;
30 int client_id_;
31 enum ActorEnum { ACTOR_SERVER, ACTOR_CLIENT };
32 ActorEnum actor_;
33 };
34