Move system-server under server/system.
[platform/framework/native/appfw.git] / inc / FBaseRtLibrary.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file                FBaseRtLibrary.h
19  * @brief               This is the header file for the dynamic linking library class.
20  *
21  * This header file contains the declarations of the %Library (DLL) class.
22  */
23
24 #ifndef _FBASE_RT_LIBRARY_H_
25 #define _FBASE_RT_LIBRARY_H_
26
27 #include <FBaseResult.h>
28 #include <FBaseString.h>
29
30 namespace Tizen { namespace Base { namespace Runtime
31 {
32 /**
33  * @class Library
34  * @brief This is the class for shared library.
35  *
36  * @since 2.0
37  *
38  * @final This class is not intended for extension.
39  *
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.
42  */
43 class _OSP_EXPORT_ Library
44         : public Tizen::Base::Object
45 {
46 public:
47         /**
48          *      This is the default constructor for this class.
49          *
50          *  @since 2.0
51          */
52         Library(void);
53
54         /**
55          *      This is the destructor for this class.
56          *
57          *  @since 2.0
58          */
59         virtual ~Library(void);
60
61         /**
62          * Initializes this instance of %Library with the specified library path. @n
63          * Loads the library in the memory space of the current process.
64          *
65          * @since 2.0
66          *
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.
74          *
75          */
76         result Construct(const Tizen::Base::String& libraryPath);
77
78         /**
79          * Gets the address of the specified symbol from the specified dynamic linking library.
80          *
81          * @since 2.0
82          *
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.
90          *
91          */
92         void* GetProcAddress(const Tizen::Base::String& symbol) const;
93
94 private:
95         Library(const Library& rhs);
96         Library& operator =(const Library& rhs);
97
98 private:
99         friend class _LibraryImpl;
100         class _LibraryImpl * __pLibraryImpl;
101 }; // Library
102
103
104 } } } // Tizen::Runtime
105
106
107 #endif // _FBASE_RT_LIBRARY_H_