# Server::RoutingPolicy

<a id="routingpolicy"></a>

# RoutingPolicy

```cpp
#include <src/symple/src/server/detail.h>

struct RoutingPolicy
```

[Defined in src/symple/src/server/detail.h:84](https://github.com/auscaster/icey/blob/main/src/symple/src/server/detail.h#L84)

Who may message whom: a direct message needs a room the sender and recipient share, and a room broadcast needs the sender to be in that room.

## Public Static Methods

| Return | Name | Description |
|--------|------|-------------|
| `bool` | [`sharesAnyRoom`](#sharesanyroom) `static` |  |
| `bool` | [`canDirectMessage`](#candirectmessage) `static` |  |
| `bool` | [`canDirectMessage`](#candirectmessage-1) `static` |  |
| `bool` | [`canBroadcastToRoom`](#canbroadcasttoroom) `static` |  |

---

<a id="sharesanyroom"></a>

### sharesAnyRoom

`static`

```cpp
static bool sharesAnyRoom(const std::unordered_set< std::string > & a, const std::unordered_set< std::string > & b)
```

[Defined in src/symple/src/server/detail.h:86](https://github.com/auscaster/icey/blob/main/src/symple/src/server/detail.h#L86)

---

<a id="candirectmessage"></a>

### canDirectMessage

`static`

```cpp
static bool canDirectMessage(const ServerPeer & sender, const ServerPeer & recipient)
```

[Defined in src/symple/src/server/detail.h:88](https://github.com/auscaster/icey/blob/main/src/symple/src/server/detail.h#L88)

---

<a id="candirectmessage-1"></a>

### canDirectMessage

`static`

```cpp
static bool canDirectMessage(const ServerPeer & sender, const VirtualPeer & recipient)
```

[Defined in src/symple/src/server/detail.h:90](https://github.com/auscaster/icey/blob/main/src/symple/src/server/detail.h#L90)

---

<a id="canbroadcasttoroom"></a>

### canBroadcastToRoom

`static`

```cpp
static bool canBroadcastToRoom(const ServerPeer & sender, const std::string & room)
```

[Defined in src/symple/src/server/detail.h:92](https://github.com/auscaster/icey/blob/main/src/symple/src/server/detail.h#L92)
