CACAO
hpi.hpp
Go to the documentation of this file.
1 /* src/native/vm/openjdk/hpi.hpp - HotSpot HPI interface functions
2 
3  Copyright (C) 2008
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 
26 #ifndef _HPI_HPP
27 #define _HPI_HPP
28 
29 #include "config.h"
30 
31 /* HPI headers *****************************************************************
32 
33  We include hpi_md.h before hpi.h as the latter includes the former.
34 
35  These includes define:
36 
37  #define _JAVASOFT_HPI_MD_H_
38  #define _JAVASOFT_HPI_H_
39 
40 *******************************************************************************/
41 
42 // Include our JNI header before the HPI headers, because the HPI
43 // headers include jni.h and we want to override the typedefs in
44 // jni.h.
45 #include "native/jni.hpp"
46 
47 #include INCLUDE_HPI_MD_H
48 #include INCLUDE_HPI_H
49 
50 /**
51  * Host Porting Interface (HPI).
52  */
53 class HPI {
54 private:
55  GetInterfaceFunc _get_interface;
56  HPI_FileInterface* _file;
57  HPI_SocketInterface* _socket;
58  HPI_LibraryInterface* _library;
59  HPI_SystemInterface* _system;
60 
61 public:
62  HPI();
63 
64  inline HPI_FileInterface& get_file () const { return *_file; }
65  inline HPI_SocketInterface& get_socket () const { return *_socket; }
66  inline HPI_LibraryInterface& get_library() const { return *_library; }
67  inline HPI_SystemInterface& get_system () const { return *_system; }
68 
69  void initialize(); // REMOVEME
71 };
72 
73 #endif // _HPI_HPP
74 
75 
76 /*
77  * These are local overrides for various environment variables in Emacs.
78  * Please do not remove this and leave it at the end of the file, where
79  * Emacs will automagically detect them.
80  * ---------------------------------------------------------------------
81  * Local variables:
82  * mode: c++
83  * indent-tabs-mode: t
84  * c-basic-offset: 4
85  * tab-width: 4
86  * End:
87  * vim:noexpandtab:sw=4:ts=4:
88  */
HPI_SystemInterface * _system
Definition: hpi.hpp:59
HPI()
Initialize the Host Porting Interface (HPI).
Definition: hpi.cpp:63
HPI_FileInterface & get_file() const
Definition: hpi.hpp:64
HPI_SocketInterface & get_socket() const
Definition: hpi.hpp:65
HPI_SystemInterface & get_system() const
Definition: hpi.hpp:67
HPI_LibraryInterface * _library
Definition: hpi.hpp:58
void initialize()
Definition: hpi.cpp:67
Host Porting Interface (HPI).
Definition: hpi.hpp:53
HPI_FileInterface * _file
Definition: hpi.hpp:56
GetInterfaceFunc _get_interface
Definition: hpi.hpp:55
HPI_LibraryInterface & get_library() const
Definition: hpi.hpp:66
HPI_SocketInterface * _socket
Definition: hpi.hpp:57
int initialize_socket_library()
Initialize the Host Porting Interface (HPI) socket library.
Definition: hpi.cpp:141