Go to the documentation of this file.
5 #ifndef CNOID_BASE_CONNECTION_SET_H
6 #define CNOID_BASE_CONNECTION_SET_H
15 std::vector<Connection> connections;
20 : connections(org.connections) { }
22 : connections(std::move(org.connections)) { }
23 void clear() { connections.clear(); }
26 bool empty()
const {
return connections.empty(); }
30 auto index = connections.size();
31 connections.push_back(connection);
35 for(
auto& connection : another.connections){
36 connections.push_back(connection);
40 for(
auto& connection : connections){
45 for(
auto& connection : connections){
50 connections[index].block();
53 connections[index].unblock();
56 for(
auto& connection : connections){
57 connection.disconnect();
66 : pConnections(&connections) {
70 org.pConnections =
nullptr;
void block()
Definition: ConnectionSet.h:39
ConnectionSet & operator=(const ConnectionSet &org)
Definition: ConnectionSet.h:90
ScopedConnectionSet()
Definition: ConnectionSet.h:99
Definition: ConnectionSet.h:62
ScopedBlock(ScopedBlock &&org)
Definition: ConnectionSet.h:69
ConnectionSet(const ConnectionSet &org)
Definition: ConnectionSet.h:88
Definition: ConnectionSet.h:84
ConnectionSetBase(ConnectionSetBase &&org)
Definition: ConnectionSet.h:21
void disconnect()
Definition: ConnectionSet.h:55
ConnectionSet()
Definition: ConnectionSet.h:87
bool empty() const
Definition: ConnectionSet.h:26
void block(int index)
Definition: ConnectionSet.h:49
ScopedBlock(ConnectionSetBase &connections)
Definition: ConnectionSet.h:65
ConnectionSetBase()
Definition: ConnectionSet.h:18
ScopedBlock scopedBlock()
Definition: ConnectionSet.h:80
Definition: AbstractSceneLoader.h:11
ConnectionSetBase(const ConnectionSetBase &org)
Definition: ConnectionSet.h:19
ScopedConnectionSet(ScopedConnectionSet &&org)
Definition: ConnectionSet.h:100
Definition: ConnectionSet.h:13
~ScopedBlock()
Definition: ConnectionSet.h:74
Definition: ConnectionSet.h:96
void unblock(int index)
Definition: ConnectionSet.h:52
void unblock()
Definition: ConnectionSet.h:44
~ScopedConnectionSet()
Definition: ConnectionSet.h:101
ScopedBlock & operator=(const ScopedBlock &)=delete
int add(const Connection &connection)
Definition: ConnectionSet.h:29
Connection & operator[](int index)
Definition: ConnectionSet.h:28
ConnectionSet(ConnectionSet &&org)
Definition: ConnectionSet.h:89
int numConnections() const
Definition: ConnectionSet.h:27
void add(const ConnectionSetBase &another)
Definition: ConnectionSet.h:34
void clear()
Definition: ConnectionSet.h:23
ScopedConnectionSet & operator=(const ScopedConnectionSet &)=delete