Wolframe, 0.0.3

ddlcompilerBuilder.hpp
Go to the documentation of this file.
1 /************************************************************************
2 Copyright (C) 2011 - 2014 Project Wolframe.
3 All rights reserved.
4 
5 This file is part of Project Wolframe.
6 
7 Commercial Usage
8 Licensees holding valid Project Wolframe Commercial licenses may
9 use this file in accordance with the Project Wolframe
10 Commercial License Agreement provided with the Software or,
11 alternatively, in accordance with the terms contained
12 in a written agreement between the licensee and Project Wolframe.
13 
14 GNU General Public License Usage
15 Alternatively, you can redistribute this file and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19 
20 Wolframe is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
27 
28 If you have questions regarding the use of this file, please contact
29 Project Wolframe.
30 
31 ************************************************************************/
34 #ifndef _Wolframe_MODULE_DDL_COMPILER_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
35 #define _Wolframe_MODULE_DDL_COMPILER_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
38 #include "module/constructor.hpp"
39 #include <boost/shared_ptr.hpp>
40 
41 namespace _Wolframe {
42 namespace module {
43 
46 class DDLCompilerConstructor :public SimpleObjectConstructor< langbind::DDLCompiler >
47 {
48 public:
49  DDLCompilerConstructor( const char* classname_, const char* name_, langbind::CreateDDLCompilerFunc createFunc_ )
50  : m_classname(classname_)
51  , m_name(name_)
52  , m_createFunc(createFunc_) {}
53 
55 
57  {
58  return DDL_COMPILER_OBJECT;
59  }
60  virtual const char* objectClassName() const
61  {
62  return m_classname.c_str();
63  }
64  virtual const char* programFileType() const
65  {
66  return m_name.c_str();
67  }
68  virtual langbind::DDLCompiler* object() const
69  {
70  return m_createFunc();
71  }
72  const std::string& name() const
73  {
74  return m_name;
75  }
76 
77 private:
78  std::string m_classname;
79  std::string m_name;
81 };
82 
83 typedef boost::shared_ptr<DDLCompilerConstructor> DDLCompilerConstructorR;
84 
85 
86 
90 {
91 public:
92  DDLCompilerBuilder( const char* classname_, const char* name_, langbind::CreateDDLCompilerFunc createFunc_)
93  :SimpleBuilder( classname_)
94  ,m_name( name_)
95  ,m_createFunc(createFunc_){}
96 
97  virtual ~DDLCompilerBuilder(){}
98 
100  {
102  }
104  {
106  }
107  const char* name() const
108  {
109  return m_name;
110  }
111 
112 private:
113  const char* m_name;
115 };
116 
117 }}//namespace
118 
119 #endif
120 
Base classes for virtual constructors to build objects loaded from modules.
langbind::CreateDDLCompilerFunc m_createFunc
Definition: ddlcompilerBuilder.hpp:80
virtual ObjectConstructorBase::ObjectType objectType() const
Definition: ddlcompilerBuilder.hpp:99
virtual const char * objectClassName() const
Definition: ddlcompilerBuilder.hpp:60
Constructor of a DDL compiler for defining data forms.
Definition: ddlcompilerBuilder.hpp:46
ObjectType
Definition: constructor.hpp:47
DDLCompilerConstructor(const char *classname_, const char *name_, langbind::CreateDDLCompilerFunc createFunc_)
Definition: ddlcompilerBuilder.hpp:49
virtual const char * programFileType() const
Definition: ddlcompilerBuilder.hpp:64
const char * m_className
Definition: moduleInterface.hpp:78
virtual langbind::DDLCompiler * object() const
Definition: ddlcompilerBuilder.hpp:68
const char * m_name
Definition: ddlcompilerBuilder.hpp:113
std::string m_name
Definition: ddlcompilerBuilder.hpp:79
Basic interface classes that to build objects and the Wolframe module interface.
Interface for DDL compilers.
Definition: ddlCompilerInterface.hpp:48
virtual ObjectConstructorBase * constructor()
Definition: ddlcompilerBuilder.hpp:103
Constructor of a simple (without configuration) object.
Definition: constructor.hpp:116
langbind::CreateDDLCompilerFunc m_createFunc
Definition: ddlcompilerBuilder.hpp:114
Defines the compiler interface for definition languages (DDL) used for specifying forms...
std::string m_classname
Definition: ddlcompilerBuilder.hpp:78
Base class for builders of objects without configuration.
Definition: moduleInterface.hpp:63
DDLCompiler *(* CreateDDLCompilerFunc)()
Describes the creation of a DDL compiler object.
Definition: ddlCompilerInterface.hpp:77
boost::shared_ptr< DDLCompilerConstructor > DDLCompilerConstructorR
Definition: ddlcompilerBuilder.hpp:83
const std::string & name() const
Definition: ddlcompilerBuilder.hpp:72
const char * name() const
Definition: ddlcompilerBuilder.hpp:107
DDLCompilerBuilder(const char *classname_, const char *name_, langbind::CreateDDLCompilerFunc createFunc_)
Definition: ddlcompilerBuilder.hpp:92
Constructor base class.
Definition: constructor.hpp:44
virtual ~DDLCompilerBuilder()
Definition: ddlcompilerBuilder.hpp:97
virtual ObjectConstructorBase::ObjectType objectType() const
The type of the object. Filter, DDL compiler, authentication etc.
Definition: ddlcompilerBuilder.hpp:56
Builder of a DDL compiler constructor for defining data forms.
Definition: ddlcompilerBuilder.hpp:89
virtual ~DDLCompilerConstructor()
Definition: ddlcompilerBuilder.hpp:54