~vcs-imports/wengophone/trunk

« back to all changes in this revision

Viewing changes to libs/util/shlibloader/include/shlibloader/ISharedLibLoader.h

  • Committer: tanguy_k
  • Date: 2006-11-15 14:12:35 UTC
  • Revision ID: vcs-imports@canonical.com-20061115141235-6efc6e38eaa40ca0
* (compilation fix) OWBuild: rename portaudio to PORTAUDIO
* Libutil has only one include path now -> faster compilation
* Remove old directories
* (compilation fix) phapi: ph_msession_stopped() was a macro inside phmedia.h, now it is a standard function. Don't know why but it was not compiling under Windows using CMake

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * WengoPhone, a voice over Internet phone
3
 
 * Copyright (C) 2004-2006  Wengo
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 */
19
 
 
20
 
#ifndef OWISHAREDLIBLOADER_H
21
 
#define OWISHAREDLIBLOADER_H
22
 
 
23
 
#include <util/Interface.h>
24
 
 
25
 
#include <string>
26
 
 
27
 
/**
28
 
 * @see SharedLibLoader
29
 
 * @author Tanguy Krotoff
30
 
 */
31
 
class ISharedLibLoader : Interface {
32
 
public:
33
 
 
34
 
        virtual ~ISharedLibLoader() { }
35
 
 
36
 
        /**
37
 
         * Loads the library.
38
 
         *
39
 
         * @return true if the library was loaded successfully; false otherwise
40
 
         */
41
 
        virtual bool load() = 0;
42
 
 
43
 
        /**
44
 
         * Unloads the library.
45
 
         *
46
 
         * @return true if the library could be unloaded; false otherwise
47
 
         */
48
 
        virtual bool unload() = 0;
49
 
 
50
 
        /**
51
 
         * Gets the address of the exported symbol of the shared library.
52
 
         *
53
 
         * Example:
54
 
         * <pre>
55
 
         * typedef int (*AvgFunction)(int, int);
56
 
         * AvgFunction avg = (AvgFunction) library->resolve("avg");
57
 
         * if (avg) {
58
 
         *      return avg(5, 8);
59
 
         * } else {
60
 
         *      return -1;
61
 
         * }
62
 
         * </pre>
63
 
         *
64
 
         * @param symbol exported symbol
65
 
         * @return address of the exported symbol
66
 
         */
67
 
        virtual void * resolve(const std::string & symbol) = 0;
68
 
 
69
 
protected:
70
 
 
71
 
        std::string _fileName;
72
 
};
73
 
 
74
 
#endif  //OWISHAREDLIBLOADER_H