Flexiport 2.0.0

flexiport.h

Go to the documentation of this file.
00001 /* Flexiport
00002  *
00003  * Header file for the factory functions.
00004  *
00005  * Copyright 2008-2011 Geoffrey Biggs geoffrey.biggs@aist.go.jp
00006  *     RT-Synthesis Research Group
00007  *     Intelligent Systems Research Institute,
00008  *     National Institute of Advanced Industrial Science and Technology (AIST),
00009  *     Japan
00010  *     All rights reserved.
00011  *
00012  * This file is part of Flexiport.
00013  *
00014  * Flexiport is free software; you can redistribute it and/or modify it
00015  * under the terms of the GNU Lesser General Public License as published
00016  * by the Free Software Foundation; either version 2.1 of the License,
00017  * or (at your option) any later version.
00018  *
00019  * Flexiport is distributed in the hope that it will be useful, but
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * 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
00025  * License along with Flexiport. If not, see
00026  * <http://www.gnu.org/licenses/>.
00027  */
00028 
00029 #ifndef __FLEXIPORT_H
00030 #define __FLEXIPORT_H
00031 
00032 #include <map>
00033 #include <string>
00034 
00035 #if defined (WIN32)
00036     #if defined (FLEXIPORT_STATIC)
00037         #define FLEXIPORT_EXPORT
00038     #elif defined (flexiport_EXPORTS)
00039         #define FLEXIPORT_EXPORT    __declspec (dllexport)
00040     #else
00041         #define FLEXIPORT_EXPORT    __declspec (dllimport)
00042     #endif
00043 #else
00044     #define FLEXIPORT_EXPORT
00045 #endif
00046 
00051 namespace flexiport
00052 {
00053 
00055 class FLEXIPORT_EXPORT PortException : public std::exception
00056 {
00057     public:
00058         PortException (const char *errorStr)
00059             : _errorStr (errorStr)    {};
00060         PortException (const std::string &errorStr)
00061             : _errorStr (errorStr)    {};
00062         ~PortException () throw () {};
00063 
00064         virtual const char* what () const throw ()
00065         {
00066             return _errorStr.c_str ();
00067         }
00068 
00069     private:
00070         std::string _errorStr;
00071 };
00072 
00073 // Forward declaration of the Port class
00074 class Port;
00075 
00094 FLEXIPORT_EXPORT Port* CreatePort (std::map<std::string, std::string> options);
00095 
00106 FLEXIPORT_EXPORT Port* CreatePort (std::string options);
00107 
00108 } // namespace flexiport
00109 
00112 #endif // __FLEXIPORT_H
00113 
 All Classes Namespaces Files Functions Variables Defines