/usr/include/GTLFragment/Library.h is in opengtl-dev 0.9.16-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /*
* Copyright (c) 2008 Cyrille Berger <cberger@cberger.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* either version 2, or (at your option) any later version of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _GTLFRAGMENT_LIBRARY_H_
#define _GTLFRAGMENT_LIBRARY_H_
#include <GTLCore/String.h>
#include <GTLFragment/Export.h>
#include <map>
namespace GTLCore {
class CompilationMessage;
class CompilationMessages;
class ModuleData;
class Function;
class Value;
}
namespace OpenShiva {
class Library;
class Kernel;
class KernelPrivate;
}
namespace OpenRijn {
class Library;
class Sketch;
}
namespace GTLFragment {
class Source;
class Metadata;
/**
* @ingroup GTLFragment
*
* Represent a Fragment Library, it is also the base class for kernels and sketches.
*/
class GTLFRAGMENT_EXPORT Library {
public:
enum Type {
FRAGMENT_LIBRARY,
SHIVA_KERNEL,
SHIVA_LIBRARY,
RIJN_SKETCH,
RIJN_LIBRARY
};
private:
friend class OpenRijn::Library;
friend class OpenRijn::Sketch;
friend class OpenShiva::Library;
friend class OpenShiva::Kernel;
friend class OpenShiva::KernelPrivate;
friend struct KernelPrivate;
friend class LibrariesManager;
Library( Type _mode, int _channelsNb );
~Library();
GTL_NO_COPY(Library);
public:
/**
* @return the name of the kernel
*/
GTLCore::String name() const;
/**
* Set the code source of the module.
*/
void setSource(const GTLCore::String& source);
void setSource(const Source& source);
Source source() const;
/**
* Load the module from the given file name.
*/
void loadFromFile(const GTLCore::String& fileName);
/**
* Start the compilation of the module.
*/
void compile();
/**
* @return true if the module was successfully compiled.
*/
bool isCompiled() const;
/**
* @return a string with the content of the compilation error.
*/
const GTLCore::CompilationMessages& compilationMessages() const;
/**
* @return the assembly source code, it's mostly usefull for testing purpose
*/
GTLCore::String asmSourceCode() const;
/**
* @return a pointer to the internal Data of this module (the class Module::Data
* is not part of the public API and therefore there is no reason
* to use this function).
*/
const GTLCore::ModuleData* data() const;
/**
* @return the list of functions available in this module.
*/
std::list<GTLCore::Function*> functions();
/**
* @return the metadata for this kernel.
*/
const Metadata* metadata() const;
private:
void cleanup();
private:
struct Private;
Private* const d;
};
}
#endif
|