2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseRtLibrary.h
19 * @brief This is the header file for the dynamic linking library class.
21 * This header file contains the declarations of the %Library (DLL) class.
24 #ifndef _FBASE_RT_LIBRARY_H_
25 #define _FBASE_RT_LIBRARY_H_
27 #include <FBaseResult.h>
28 #include <FBaseString.h>
30 namespace Tizen { namespace Base { namespace Runtime
34 * @brief This is the class for shared library.
38 * @final This class is not intended for extension.
40 * The %Library class loads the shared library with the given file path.
41 * It loads the library in current process' memory space, and application can use this library explicitly.
43 class _OSP_EXPORT_ Library
44 : public Tizen::Base::Object
48 * This is the default constructor for this class.
55 * This is the destructor for this class.
59 virtual ~Library(void);
62 * Initializes this instance of %Library with the specified library path. @n
63 * Loads the library in the memory space of the current process.
67 * @return An error code
68 * @param[in] libraryPath The path of the library file
69 * @exception E_SUCCESS The method is successful.
70 * @exception E_LIBRARY_NOT_FOUND The library cannot be found.
71 * @exception E_INVALID_ARG The specified @c libraryPath is an empty string.
72 * @exception E_OUT_OF_MEMORY The memory is insufficient.
73 * @exception E_SYSTEM A system error has occurred.
76 result Construct(const Tizen::Base::String& libraryPath);
79 * Gets the address of the specified symbol from the specified dynamic linking library.
83 * @return The address of the specified symbol
84 * @param[in] symbol The symbol name
85 * @exception E_SUCCESS The method is successful.
86 * @exception E_SYMBOL_NOT_FOUND The symbol cannot be found.
87 * @exception E_INVALID_ARG The specified @c symbol is an empty string.
88 * @exception E_OUT_OF_MEMORY The memory is insufficient.
89 * @exception E_SYSTEM A system error has occurred.
92 void* GetProcAddress(const Tizen::Base::String& symbol) const;
95 Library(const Library& rhs);
96 Library& operator =(const Library& rhs);
99 friend class _LibraryImpl;
100 class _LibraryImpl * __pLibraryImpl;
104 } } } // Tizen::Runtime
107 #endif // _FBASE_RT_LIBRARY_H_