Wolframe, 0.0.3

programLibrary.hpp
Go to the documentation of this file.
1 /************************************************************************
2 
3  Copyright (C) 2011 - 2014 Project Wolframe.
4  All rights reserved.
5 
6  This file is part of Project Wolframe.
7 
8  Commercial Usage
9  Licensees holding valid Project Wolframe Commercial licenses may
10  use this file in accordance with the Project Wolframe
11  Commercial License Agreement provided with the Software or,
12  alternatively, in accordance with the terms contained
13  in a written agreement between the licensee and Project Wolframe.
14 
15  GNU General Public License Usage
16  Alternatively, you can redistribute this file and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Wolframe is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
28 
29  If you have questions regarding the use of this file, please contact
30  Project Wolframe.
31 
32 ************************************************************************/
35 
36 #ifndef _PRGBIND_PROGRAM_LIBRARY_HPP_INCLUDED
37 #define _PRGBIND_PROGRAM_LIBRARY_HPP_INCLUDED
38 #include "filter/filter.hpp"
39 #include "database/database.hpp"
46 #include "types/form.hpp"
48 #include "types/customDataType.hpp"
49 #include "prgbind/program.hpp"
50 #include <string>
51 #include <vector>
52 
53 
54 namespace _Wolframe {
55 namespace prgbind {
56 
60 {
61 public:
65  ProgramLibrary( const ProgramLibrary& o);
66 
68  virtual ~ProgramLibrary();
69 
71  virtual void defineAuthorizationFunction( const std::string& name, const langbind::AuthorizationFunctionR& f);
73  virtual void defineAuditFunction( const std::string& name, const langbind::AuditFunctionR& f);
75  virtual void defineCppFormFunction( const std::string& name, const serialize::CppFormFunction& f);
77  virtual void defineFormFunction( const std::string& name, const langbind::FormFunctionR& f);
81  virtual void definePrivateForm( const types::FormDescriptionR& f);
83  virtual void defineForm( const std::string& name, const types::FormDescriptionR& f);
85  virtual void defineNormalizeFunction( const std::string& name, const types::NormalizeFunctionR& f) const;
87  virtual void defineNormalizeFunctionType( const std::string& name, const types::NormalizeFunctionType& ftype);
89  virtual void defineCustomDataType( const std::string& name, const types::CustomDataTypeR& t);
91  virtual void defineFormDDL( const langbind::DDLCompilerR& c);
93  virtual void defineFilterType( const std::string& name, const langbind::FilterTypeR& f);
95  virtual void defineProgramType( const ProgramR& prg);
96 
98  virtual const types::NormalizeFunctionMap* formtypemap() const;
100  virtual const types::CustomDataType* getCustomDataType( const std::string& name) const;
102  virtual const types::NormalizeFunctionType* getNormalizeFunctionType( const std::string& name) const;
103 
105  virtual const types::FormDescription* getFormDescription( const std::string& name) const;
107  virtual std::vector<std::string> getFormNames() const;
108 
110  virtual const langbind::AuthorizationFunction* getAuthorizationFunction( const std::string& name) const;
112  virtual const langbind::AuditFunction* getAuditFunction( const std::string& name) const;
114  virtual const langbind::FormFunction* getFormFunction( const std::string& name) const;
116  virtual const types::NormalizeFunction* getNormalizeFunction( const std::string& name) const;
118  virtual const langbind::FilterType* getFilterType( const std::string& name) const;
119 
121  virtual void loadPrograms( db::Database* transactionDB, const std::vector<std::string>& filenames);
122 
123 private:
124  class Impl;
125  Impl* m_impl;
126 };
127 
128 }} //namespace
129 #endif
130 
virtual void defineProgramType(const ProgramR &prg)
Define a program type.
virtual const types::NormalizeFunction * getNormalizeFunction(const std::string &name) const
Get a normalizer function by name.
Class of basic normalization functions instantiated by arguments.
Definition: normalizeFunction.hpp:81
virtual void defineCppFormFunction(const std::string &name, const serialize::CppFormFunction &f)
Define a C++ form function.
virtual void defineCustomDataType(const std::string &name, const types::CustomDataTypeR &t)
Define a custom data type.
boost::shared_ptr< AuditFunction > AuditFunctionR
shared ownership reference on an auditing function
Definition: auditFunction.hpp:53
Interface to form functions written in C++.
virtual const types::NormalizeFunctionType * getNormalizeFunctionType(const std::string &name) const
Get a normalization function type defined by name.
boost::shared_ptr< DDLCompiler > DDLCompilerR
Reference to a DDL compiler.
Definition: ddlCompilerInterface.hpp:74
Interface of the authorization function.
Normalize function definition.
virtual void defineNormalizeFunction(const std::string &name, const types::NormalizeFunctionR &f) const
Define a normalization function.
Custom data type interface for variant.
Definition of language runtime environment.
virtual void defineForm(const std::string &name, const types::FormDescriptionR &f)
Define a form.
virtual const types::NormalizeFunctionMap * formtypemap() const
Get the map for DDLs to map types to normalizer call sequences.
boost::shared_ptr< Program > ProgramR
Definition: program.hpp:81
virtual const types::FormDescription * getFormDescription(const std::string &name) const
Get a form description.
Interface of a an authorization function.
Definition: authorizationFunction.hpp:51
virtual void defineFormFunction(const std::string &name, const langbind::FormFunctionR &f)
Define an ordinary form function.
Impl * m_impl
Definition: programLibrary.hpp:124
virtual void definePrivateForm(const types::FormDescriptionR &f)
Define a form structure that is referenced as unexpanded indirection.
boost::shared_ptr< CustomDataType > CustomDataTypeR
Definition: customDataType.hpp:202
virtual const langbind::AuditFunction * getAuditFunction(const std::string &name) const
Get an audit function by name.
boost::shared_ptr< RuntimeEnvironment > RuntimeEnvironmentR
Shared ownership reference to a runtime environment.
Definition: runtimeEnvironment.hpp:65
Defines the unified form data structure as defined by a DDL (data definition language). A form data structure represents the document unit of a wolframe request or answer.
ProgramLibrary()
Default constructor.
Structure defining a type of a filter (used as virtual constructor to create filter instances) ...
Definition: filter.hpp:111
Basic normalization function for atomic values (variant type)
Definition: normalizeFunction.hpp:52
Interface for programs loaded by the processor provider.
boost::shared_ptr< FilterType > FilterTypeR
Definition: filter.hpp:133
virtual void defineAuthorizationFunction(const std::string &name, const langbind::AuthorizationFunctionR &f)
Define an authorization function.
virtual void defineFilterType(const std::string &name, const langbind::FilterTypeR &f)
Define a filter type.
Interface for executing functions with structure input/output in the language bindings.
virtual void defineRuntimeEnvironment(const langbind::RuntimeEnvironmentR &env)
Define a runtime environment.
Defines the compiler interface for definition languages (DDL) used for specifying forms...
virtual void defineFormDDL(const langbind::DDLCompilerR &c)
Define a data definition language.
virtual void loadPrograms(db::Database *transactionDB, const std::vector< std::string > &filenames)
Load all programs passed in 'filenames'.
boost::shared_ptr< FormFunction > FormFunctionR
Shared form function interface.
Definition: formFunction.hpp:90
Custom Data Type Definition.
Definition: customDataType.hpp:105
virtual const langbind::FormFunction * getFormFunction(const std::string &name) const
Get a form function by name.
virtual std::vector< std::string > getFormNames() const
Get the list of all forms defined.
boost::shared_ptr< FormDescription > FormDescriptionR
Definition: form.hpp:125
Form function interface.
Definition: formFunction.hpp:78
boost::shared_ptr< AuthorizationFunction > AuthorizationFunctionR
shared ownership reference of an authorization function
Definition: authorizationFunction.hpp:77
Description of a form structure.
Definition: form.hpp:56
Interface of a an auditing function as special form function.
Definition: auditFunction.hpp:44
virtual const types::CustomDataType * getCustomDataType(const std::string &name) const
Get a custom data type defined by name.
Wolframe base database class.
Class representing the program library with all programs loaded.
Definition: programLibrary.hpp:59
virtual void defineNormalizeFunctionType(const std::string &name, const types::NormalizeFunctionType &ftype)
Define a normalization function type.
Map of basic normalization functions for atomic values (variant type)
Definition: normalizeFunction.hpp:114
virtual ~ProgramLibrary()
Destructor.
virtual const langbind::FilterType * getFilterType(const std::string &name) const
Get a filter type by name.
Base class for database interface. All databases should provide this interface.
Definition: database.hpp:50
boost::shared_ptr< NormalizeFunction > NormalizeFunctionR
Shared ownership reference to normalization function for atomic values (variant type) ...
Definition: normalizeFunction.hpp:62
virtual void defineAuditFunction(const std::string &name, const langbind::AuditFunctionR &f)
Define an audit function.
virtual const langbind::AuthorizationFunction * getAuthorizationFunction(const std::string &name) const
Get an authorization function by name.
Interface for filter class.
Interface of auditing functions.
Function of language bindings implemented in C++ with a form as argument and as result. The forms are defined by a serialization description.
Definition: cppFormFunction.hpp:111