/usr/include/OpenCTL/Module.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 | /*
* Copyright (c) 2007 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 _OPENCTL_MODULE_H_
#define _OPENCTL_MODULE_H_
#include <list>
#include <vector>
#include <GTLCore/Macros.h>
#include <GTLCore/String.h>
#include <OpenCTL/Export.h>
namespace GTLCore {
class CompilationMessages;
class Function;
class ModuleData;
class Type;
class Parameter;
class TypesManager;
}
namespace OpenCTL {
/**
* A Module represents a CTL program or module.
* @ingroup OpenCTL
*/
class OPENCTL_EXPORT Module {
GTL_NO_COPY(Module);
public:
Module();
~Module();
/**
* @return the name of the module (usually the name of the file without the .ctl
* extension, and without the path)
*/
GTLCore::String name() const;
/**
* @return the namespace used for this module
*/
GTLCore::String nameSpace() const;
/**
* Set the code source of the module.
*/
void setSource(const GTLCore::String& name, const GTLCore::String& source);
/**
* Load the module from the given file name.
*/
void loadFromFile(const GTLCore::String& fileName);
/**
* @param name the name of the function
* @return the functions with the given name
*/
std::list<const GTLCore::Function*> functions(const GTLCore::String& name) const;
/**
* @return the function corresponding to the list of types given in argument
*/
const GTLCore::Function* function(const GTLCore::String& name, std::vector<GTLCore::Parameter>& arguments) const;
/**
* 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.
*/
GTLCore::CompilationMessages compilationMessages() const;
/**
* @return the list of functions available in this module.
*/
std::list<GTLCore::Function*> functions();
/**
* @return a pointer to the internal Data of this module (the class Module::Data
* is not part of the public API and therefoare there is no reason
* to use this function).
*/
const GTLCore::ModuleData* data() const;
/**
* @return the type manager with the types defines and use by this module (this
* includes type that are defined by imported modules)
*/
const GTLCore::TypesManager* typesManager() const;
public:
/**
* @return the assembly source code, mostly useful for testing purpose
*/
GTLCore::String asmSourceCode() const;
private:
struct Private;
Private* const d;
};
}
#endif
|