definitions.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012, 2013 Instituto de Sistemas e Robotica, Instituto Superior Tecnico
00003  *
00004  * This file is part of SocRob Multicast.
00005  *
00006  * SocRob Multicast is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * SocRob Multicast is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with SocRob Multicast.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #ifndef _SOCROB_MULTICAST_DEFINITIONS_H_
00021 #define _SOCROB_MULTICAST_DEFINITIONS_H_
00022 
00023 #include <cstddef>
00024 #include <stdint.h>
00025 
00026 #include <string>
00027 #include <map>
00028 #include <vector>
00029 
00030 #include <boost/function.hpp>
00031 
00032 
00033 
00034 // Uses the loopback interface. Use this only when testing offline!
00035 //#define SOCROB_MULTICAST_USE_LOOPBACK_INTERFACE
00036 
00037 
00038 
00039 // Sends long round packages at exact times, the worst case scenario.
00040 //#define SOCROB_MULTICAST_LONG_SYNC_WORST
00041 
00042 
00043 
00044 namespace socrob
00045 {
00046   namespace multicast
00047   {
00049     const std::size_t MAX_MESSAGE_SIZE = 65536;
00050     
00051     
00053     typedef uint8_t id_type;
00054     
00056     typedef uint32_t qid_type;
00057     
00058     
00060     typedef enum {NOT_RUNNING, INSERT, RUNNING, REMOVE} agent_state_type;
00061     
00062     
00064     typedef boost::function<void (id_type) > id_function_type;
00065     
00067     inline void empty_id_function (id_type) {}
00068     
00069     
00071     typedef boost::function<void (std::vector<uint8_t>&) > buffer_function_type;
00072     
00074     inline void empty_buffer_function (std::vector<uint8_t> &) {}
00075     
00076     
00078     typedef boost::function<void (id_type, std::vector<uint8_t>&) > id_buffer_function_type;
00079     
00081     inline void empty_id_buffer_function (id_type, std::vector<uint8_t> const&) {}
00082     
00083     
00085     typedef boost::function<void (std::vector<uint8_t>&, id_type, std::vector<uint8_t>&) > handler_function_type;
00086     
00088     inline void empty_handler_function (std::vector<uint8_t>&, id_type, std::vector<uint8_t> const&) {}
00089     
00090     
00092     typedef boost::function<void (std::map<id_type, std::vector<uint8_t> >&) > short_callback_type;
00093     
00095     inline void empty_short_callback (std::map<id_type, std::vector<uint8_t> >&) {}
00096   }
00097 }
00098 
00099 #endif


socrob_multicast
Author(s): Joao Reis/jreis@isr.ist.utl.pt
autogenerated on Mon Jan 6 2014 11:47:49