Ejemplo n.º 1
0
        public RegistrationManager()
        {
            nodes = new Dictionary <string, NodeRef>();
            //thread_pool

            publishers        = new Registrations(Registrations.TOPIC_PUBLICATIONS);
            subscribers       = new Registrations(Registrations.TOPIC_SUBSCRIPTIONS);
            services          = new Registrations(Registrations.SERVICE);
            param_subscribers = new Registrations(Registrations.PARAM_SUBSCRIPTIONS);
        }
Ejemplo n.º 2
0
 public void _notify(Registrations r, Func <String, String, List <String>, List <String> > task, String key, List <String> value, List <String> node_apis)
 {
     foreach (String node_api in node_apis)
     {
         // if (node_api != null && node_uris.Count > 0)
         //{
         task(node_api, key, value);
         //}
     }
 }
Ejemplo n.º 3
0
            public ROSMasterHandler()
            {
                reg_manager = new RegistrationManager();

                publishers        = reg_manager.publishers;
                subscribers       = reg_manager.subscribers;
                services          = reg_manager.services;
                param_subscribers = reg_manager.param_subscribers;

                topic_types  = new Dictionary <String, String>();
                param_server = new rosmaster.ParamDictionary(reg_manager);
            }
Ejemplo n.º 4
0
            public ROSMasterHandler()
            {
                reg_manager = new RegistrationManager();

                 publishers = reg_manager.publishers;
                 subscribers =  reg_manager.subscribers;
                 services = reg_manager.services;
                 param_subscribers = reg_manager.param_subscribers;

                 topic_types = new Dictionary<String, String>();
                 param_server = new rosmaster.ParamDictionary(reg_manager);

            }
Ejemplo n.º 5
0
        public void _register(Registrations r, String key, String caller_id, String caller_api, String service_api = null)
        {
            bool    changed  = false;
            NodeRef node_ref = _register_node_api(caller_id, caller_api, ref changed);

            node_ref.add(r.type, key);

            if (changed)
            {
                publishers.unregister_all(caller_id);
                subscribers.unregister_all(caller_id);
                services.unregister_all(caller_id);
                param_subscribers.unregister_all(caller_id);
            }
            r.register(key, caller_id, caller_api, service_api);
        }
Ejemplo n.º 6
0
        public ReturnStruct _unregister(Registrations r, String key, String caller_id, String caller_api, String service_api = null)
        {
            ReturnStruct ret;

            if (nodes.ContainsKey(caller_id))
            {
                NodeRef node_ref = nodes[caller_id];
                ret = r.unregister(key, caller_id, caller_api, service_api);
                if (ret.statusCode == 1)
                {
                    node_ref.remove(r.type, key);
                }
                if (node_ref.is_empty())
                {
                    nodes.Remove(caller_id);
                }
            }
            else
            {
                ret = new ReturnStruct(0, String.Format("[{0}] is not a registered node", caller_id), new XmlRpc_Wrapper.XmlRpcValue(1));
            }
            return(ret); // new ReturnStruct(code, msg, new XmlRpc_Wrapper.XmlRpcValue(ret));
        }
Ejemplo n.º 7
0
 public void _notify(Registrations r, Func< String, String, List<String>, List<String>> task, String key, List<String> value, List<String> node_apis) 
 {
     foreach (String node_api in node_apis)
     {
        // if (node_api != null && node_uris.Count > 0)
         //{
         task(node_api, key, value);
         //}
     }
 }
Ejemplo n.º 8
0
 public ReturnStruct _unregister(Registrations r, String key, String caller_id, String caller_api, String service_api = null)
 {
     ReturnStruct ret;
     if (nodes.ContainsKey(caller_id))
     {
         NodeRef node_ref = nodes[caller_id];
         ret = r.unregister(key, caller_id, caller_api, service_api);
         if (ret.statusCode == 1)
         {
             node_ref.remove(r.type, key);
         }
         if (node_ref.is_empty())
         {
             nodes.Remove(caller_id);
         }
     }
     else
     {
         ret = new ReturnStruct(0, String.Format("[{0}] is not a registered node",caller_id), new XmlRpc_Wrapper.XmlRpcValue(1));
     }
     return ret; // new ReturnStruct(code, msg, new XmlRpc_Wrapper.XmlRpcValue(ret));
 }
Ejemplo n.º 9
0
        public void _register(Registrations r, String key, String caller_id, String caller_api, String service_api = null)
        {
            bool changed = false;
            NodeRef node_ref = _register_node_api(caller_id, caller_api, ref changed);
            node_ref.add(r.type,key);

            if (changed)
            {
                publishers.unregister_all(caller_id);
                subscribers.unregister_all(caller_id);
                services.unregister_all(caller_id);
                param_subscribers.unregister_all(caller_id);
            }
            r.register(key, caller_id, caller_api, service_api);
        }
Ejemplo n.º 10
0
        public RegistrationManager()
        {
            nodes = new Dictionary<string, NodeRef>();
            //thread_pool

            publishers = new Registrations(Registrations.TOPIC_PUBLICATIONS);
            subscribers = new Registrations(Registrations.TOPIC_SUBSCRIPTIONS);
            services = new Registrations(Registrations.SERVICE);
            param_subscribers = new Registrations(Registrations.PARAM_SUBSCRIPTIONS);
        }