File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Original file line number Diff line number Diff line change @@ -60,6 +60,19 @@ class dispatcher {
60
60
detail::tags::nonvoid_result const &,
61
61
detail::tags::nonzero_arg const &);
62
62
63
+ // ! \brief removes a functor with given name from callable functors.
64
+ void remove (std::string const &name) {
65
+ funcs_.erase (name);
66
+ }
67
+
68
+ // ! \brief returns a list name of all functors binded
69
+ std::vector<std::string> names () {
70
+ std::vector<std::string> names;
71
+ for (auto it = funcs_.begin (); it != funcs_.end (); ++it)
72
+ names.push_back (it->first );
73
+ return names;
74
+ }
75
+
63
76
// ! @}
64
77
65
78
// ! \brief Processes a message that contains a call according to
Original file line number Diff line number Diff line change @@ -93,6 +93,24 @@ class server {
93
93
disp_->bind (name, func);
94
94
}
95
95
96
+ // ! \brief Unbinds a functor binded to a name.
97
+ // !
98
+ // ! This function removes already binded function from RPC Ccallable functions
99
+ // !
100
+ // ! \param name The name of the functor.
101
+ void unbind (std::string const &name) {
102
+ disp_->remove (name);
103
+ }
104
+
105
+ // ! \brief Returns all binded names
106
+ // !
107
+ // ! This function returns a list of all names which functors are binded to
108
+ // !
109
+ // ! \param name The name of the functor.
110
+ std::vector<std::string> names () {
111
+ return disp_->names ();
112
+ }
113
+
96
114
// ! \brief Sets the exception behavior in handlers. By default,
97
115
// ! handlers throwing will crash the server. If suppressing is on,
98
116
// ! the server will try to gather textual data and return it to
You can’t perform that action at this time.
0 commit comments