00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef INCLUDED_MB_CONNECTION_H
00023 #define INCLUDED_MB_CONNECTION_H
00024
00025 #include <mb_endpoint.h>
00026 #include <list>
00027
00028
00029
00030
00031 struct mb_connection {
00032 mb_endpoint d_ep[2];
00033
00034 mb_connection(const mb_endpoint &ep0, const mb_endpoint &ep1){
00035 d_ep[0] = ep0;
00036 d_ep[1] = ep1;
00037 }
00038 };
00039
00040 typedef std::list<mb_connection>::iterator mb_conn_iter;
00041 typedef std::list<mb_connection>::const_iterator mb_conn_const_iter;
00042
00043
00044
00045
00046 class mb_conn_table {
00047 std::list<mb_connection> d_connections;
00048
00049 public:
00050 bool
00051 lookup_conn_by_name(const std::string &component_name,
00052 const std::string &port_name,
00053 mb_conn_iter *it, int *which_ep);
00054
00055 bool
00056 lookup_conn_by_port(const mb_port *port,
00057 mb_conn_iter *it, int *which_ep);
00058
00059 void
00060 create_conn(const mb_endpoint &ep0, const mb_endpoint &ep1);
00061
00062
00063 void
00064 disconnect(const std::string &comp_name1, const std::string &port_name1,
00065 const std::string &comp_name2, const std::string &port_name2);
00066
00067 void
00068 disconnect_component(const std::string component_name);
00069
00070 void
00071 disconnect_all();
00072
00073 int
00074 nconnections() const;
00075
00076 };
00077
00078 #endif