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
1 /*
2  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3  * http://gearbox.sf.net/
4  * Copyright (c) 2008 Geoffrey Biggs
5  *
6  * flexiport flexible hardware data communications library.
7  *
8  * This distribution is licensed to you under the terms described in the LICENSE file included in
9  * this distribution.
10  *
11  * This work is a product of the National Institute of Advanced Industrial Science and Technology,
12  * Japan. Registration number: H20PRO-881
13  *
14  * This file is part of flexiport.
15  *
16  * flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
17  * Lesser General Public License as published by the Free Software Foundation, either version 3 of
18  * the License, or (at your option) any later version.
19  *
20  * flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
21  * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public License along with flexiport.
25  * If not, see <http://www.gnu.org/licenses/>.
26  */
27 
28 #ifndef __FLEXIPORT_H
29 #define __FLEXIPORT_H
30 
31 #include <map>
32 #include <string>
33 
34 #if defined (WIN32)
35  #if defined (FLEXIPORT_STATIC)
36  #define FLEXIPORT_EXPORT
37  #elif defined (FLEXIPORT_EXPORTS)
38  #define FLEXIPORT_EXPORT __declspec (dllexport)
39  #else
40  #define FLEXIPORT_EXPORT __declspec (dllimport)
41  #endif
42 #else
43  #define FLEXIPORT_EXPORT
44 #endif
45 
50 namespace flexiport
51 {
52 
54 class FLEXIPORT_EXPORT PortException : public std::exception
55 {
56  public:
57  PortException (const char *errorStr)
58  : _errorStr (errorStr) {};
59  PortException (const std::string &errorStr)
60  : _errorStr (errorStr) {};
61  ~PortException () throw () {};
62 
63  virtual const char* what () const throw ()
64  {
65  return _errorStr.c_str ();
66  }
67 
68  private:
69  std::string _errorStr;
70 };
71 
72 // Forward declaration of the Port class
73 class Port;
74 
88 FLEXIPORT_EXPORT Port* CreatePort (std::map<std::string, std::string> options);
89 
98 FLEXIPORT_EXPORT Port* CreatePort (std::string options);
99 
100 } // namespace flexiport
101 
104 #endif // __FLEXIPORT_H
FlexiPort data communications library.
Base Port class.
Definition: port.h:79
Exception thrown by the Port class and its derivatives.
Definition: flexiport.h:54
 

Generated for GearBox by  doxygen 1.4.5