2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FBaseRtLibrary.h
20 * @brief This is the header file for the dynamic linking library class.
22 * This header file contains the declarations of the %Library (DLL) class.
25 #ifndef _FBASE_RT_LIBRARY_H_
26 #define _FBASE_RT_LIBRARY_H_
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
31 namespace Tizen { namespace Base { namespace Runtime
35 * @brief This is the class for shared library.
39 * @final This class is not intended for extension.
41 * The %Library class loads the shared library with the given file path.
42 * It loads the library in current process' memory space, and application can use this library explicitly.
44 class _OSP_EXPORT_ Library
45 : public Tizen::Base::Object
49 * This is the default constructor for this class.
56 * This is the destructor for this class.
60 virtual ~Library(void);
63 * Initializes this instance of %Library with the specified library path. @n
64 * Loads the library in the memory space of the current process.
68 * @return An error code
69 * @param[in] libraryPath The path of the library file
70 * @exception E_SUCCESS The method is successful.
71 * @exception E_LIBRARY_NOT_FOUND The library cannot be found.
72 * @exception E_INVALID_ARG The specified @c libraryPath is an empty string.
73 * @exception E_OUT_OF_MEMORY The memory is insufficient.
74 * @exception E_SYSTEM A system error has occurred.
77 result Construct(const Tizen::Base::String& libraryPath);
80 * Gets the address of the specified symbol from the specified dynamic linking library.
84 * @return The address of the specified symbol
85 * @param[in] symbol The symbol name
86 * @exception E_SUCCESS The method is successful.
87 * @exception E_SYMBOL_NOT_FOUND The symbol cannot be found.
88 * @exception E_INVALID_ARG The specified @c symbol is an empty string.
89 * @exception E_OUT_OF_MEMORY The memory is insufficient.
90 * @exception E_SYSTEM A system error has occurred.
93 void* GetProcAddress(const Tizen::Base::String& symbol) const;
96 Library(const Library& rhs);
97 Library& operator =(const Library& rhs);
100 friend class _LibraryImpl;
101 class _LibraryImpl * __pLibraryImpl;
105 } } } // Tizen::Runtime
108 #endif // _FBASE_RT_LIBRARY_H_