RDB 2
library.hpp
Go to the documentation of this file.
1 /*
2  *******************************************************************************
3  *
4  * Copyright 2023 RIEGL Laser Measurement Systems
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  *
20  *******************************************************************************
21  */
22 /*!
23  *******************************************************************************
24  *
25  * \file library.hpp
26  * \author RIEGL LMS GmbH, Austria
27  * \brief RDB library management tools
28  * \version 2020-04-08/AW: Initial version
29  *
30  * NOTE: Unless otherwise specified, the functions defined herein are only
31  * available in "run-time linking" mode (i.e. when the RDB_RUNTIME_LINKING
32  * option/macro is defined). In this mode, the library is not automatically
33  * loaded on application startup and must be manually loaded by calling the
34  * function riegl::rdb::library::load(). To use this mode on Linux, you must
35  * link the library "libdl" to your application.
36  *
37  *******************************************************************************
38  */
39 
40 #ifndef RIEGL_RDB_LIBRARY_HPP
41 #define RIEGL_RDB_LIBRARY_HPP
42 
43 //---< INCLUDES >---------------------------------------------------------------
44 
45 #include <string>
46 #include "riegl/rdb.hpp"
47 
48 //---< FUNCTIONS >--------------------------------------------------------------
49 
50 namespace riegl {
51 namespace rdb {
52 namespace library {
53 #ifdef RDB_RUNTIME_LINKING
54 
55 //______________________________________________________________________________
56 /*!
57  * \brief Load library and resolve functions
58  *
59  * Call this function before using any of the other library functions.
60  * If no filename is given, then the default library filename is used.
61  * If the library is already loaded, this function does nothing. To load
62  * a different library, unload the current library first.
63  *
64  * Throws an exception if the library was not loaded successfully.
65  */
66 void load(const std::string &filename = "");
67 
68 //______________________________________________________________________________
69 /*!
70  * \brief Free library
71  *
72  * Optionally call this function to free the library. Subsequent
73  * calls to other library functions will crash the application.
74  * If the library is not loaded, this function does nothing.
75  *
76  * Throws an exception if the library was not freed successfully.
77  */
78 void free();
79 
80 #endif // RDB_RUNTIME_LINKING
81 }}} // namespace riegl::rdb::library
82 
83 #endif // RIEGL_RDB_LIBRARY_HPP
riegl::rdb::library::load
void load(const std::string &filename="")
Load library and resolve functions.
riegl
RIEGL Laser Measurement Systems GmbH, Austria.
Definition: context.hpp:48
riegl::rdb::library::free
void free()
Free library.
rdb.hpp
Main RDB library include file.