INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

flexiport.h

00001 /*
00002  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
00003  *               http://gearbox.sf.net/
00004  * Copyright (c) 2008 Geoffrey Biggs
00005  *
00006  * flexiport flexible hardware data communications library.
00007  *
00008  * This distribution is licensed to you under the terms described in the LICENSE file included in
00009  * this distribution.
00010  *
00011  * This work is a product of the National Institute of Advanced Industrial Science and Technology,
00012  * Japan. Registration number: H20PRO-881
00013  *
00014  * This file is part of flexiport.
00015  *
00016  * flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
00017  * Lesser General Public License as published by the Free Software Foundation, either version 3 of
00018  * the License, or (at your option) any later version.
00019  *
00020  * flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
00021  * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  * Lesser General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License along with flexiport.
00025  * If not, see <http://www.gnu.org/licenses/>.
00026  */
00027 
00028 #ifndef __FLEXIPORT_H
00029 #define __FLEXIPORT_H
00030 
00031 #include <map>
00032 #include <string>
00033 
00034 #if defined (WIN32)
00035         #if defined (FLEXIPORT_STATIC)
00036                 #define FLEXIPORT_EXPORT
00037         #elif defined (FLEXIPORT_EXPORTS)
00038                 #define FLEXIPORT_EXPORT    __declspec (dllexport)
00039         #else
00040                 #define FLEXIPORT_EXPORT    __declspec (dllimport)
00041         #endif
00042 #else
00043         #define FLEXIPORT_EXPORT
00044 #endif
00045 
00050 namespace flexiport
00051 {
00052 
00054 class FLEXIPORT_EXPORT PortException : public std::exception
00055 {
00056         public:
00057                 PortException (const char *errorStr)
00058                         : _errorStr (errorStr)  {};
00059                 PortException (const std::string &errorStr)
00060                         : _errorStr (errorStr)  {};
00061                 ~PortException () throw () {};
00062 
00063                 virtual const char* what () const throw ()
00064                 {
00065                         return _errorStr.c_str ();
00066                 }
00067 
00068         private:
00069                 std::string _errorStr;
00070 };
00071 
00072 // Forward declaration of the Port class
00073 class Port;
00074 
00088 FLEXIPORT_EXPORT Port* CreatePort (std::map<std::string, std::string> options);
00089 
00098 FLEXIPORT_EXPORT Port* CreatePort (std::string options);
00099 
00100 } // namespace flexiport
00101 
00104 #endif // __FLEXIPORT_H
 

Generated for GearBox by  doxygen 1.4.5