35 static const char* typeString[] =
38 "ON_NOTIFY_DISCONNECT",
39 "ON_UNSUBSCRIBE_INTERFACES",
43 return typeString[type];
65 static const char* typeString[] =
67 "ON_PUBLISH_INTERFACES",
68 "ON_CONNECT_NEXTPORT",
69 "ON_SUBSCRIBE_INTERFACES",
77 return typeString[type];
104 Guard guard(m_mutex);
105 for (
int i(0), len(m_listeners.size()); i < len; ++i)
107 if (m_listeners[i].second)
109 delete m_listeners[i].first;
118 Guard guard(m_mutex);
119 m_listeners.push_back(
Entry(listener, autoclean));
125 Guard guard(m_mutex);
126 std::vector<Entry>::iterator it(m_listeners.begin());
128 for (; it != m_listeners.end(); ++it)
130 if ((*it).first == listener)
136 m_listeners.erase(it);
145 RTC::ConnectorProfile& profile)
147 Guard guard(m_mutex);
148 for (
int i(0), len(m_listeners.size()); i < len; ++i)
150 m_listeners[i].first->operator()(portname, profile);
169 Guard guard(m_mutex);
170 for (
int i(0), len(m_listeners.size()); i < len; ++i)
172 if (m_listeners[i].second)
174 delete m_listeners[i].first;
183 Guard guard(m_mutex);
184 m_listeners.push_back(
Entry(listener, autoclean));
191 Guard guard(m_mutex);
192 std::vector<Entry>::iterator it(m_listeners.begin());
193 for (; it != m_listeners.end(); ++it)
195 if ((*it).first == listener)
201 m_listeners.erase(it);
210 RTC::ConnectorProfile& profile,
213 Guard guard(m_mutex);
214 for (
int i(0), len(m_listeners.size()); i < len; ++i)
216 m_listeners[i].first->operator()(portname, profile,
ret);
PortConnectListenerType
The types of ConnectorDataListener.
PortConnectRetListener class.
static const char * toString(PortConnectRetListenerType type)
Convert PortConnectRetListenerType into string.
void notify(const char *portname, RTC::ConnectorProfile &profile)
Notify listeners.
void removeListener(PortConnectRetListener *listener)
Remove the listener.
std::pair< PortConnectRetListener *, bool > Entry
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
void removeListener(PortConnectListener *listener)
Remove the listener.
PortConnectListener class.
virtual ~PortConnectListenerHolder()
Destructor.
static const char * toString(PortConnectListenerType type)
Convert PortConnectListenerType into the string.
PortConnectListenerHolder()
Constructor.
virtual ~PortConnectRetListener()
Destructor.
PortConnectRetListenerType
The types of PortConnectRetListenerType.
virtual ~PortConnectRetListenerHolder()
Destructor.
PortConnectRetListenerHolder()
Constructor.
void addListener(PortConnectListener *listener, bool autoclean)
Add the listener.
std::pair< PortConnectListener *, bool > Entry
void notify(const char *portname, RTC::ConnectorProfile &profile, ReturnCode_t ret)
Notify listeners.
port's internal action listener classes
virtual ~PortConnectListener()
Destructor.
void addListener(PortConnectRetListener *listener, bool autoclean)
Add the listener.