Wolframe, 0.0.3

doctypeDetectorBuilder.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_DOCYPE_DETECTOR_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
35 #define _Wolframe_MODULE_DOCYPE_DETECTOR_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
38 #include "module/constructor.hpp"
39 #include <boost/shared_ptr.hpp>
40 
41 namespace _Wolframe {
42 namespace module {
43 
47  :public SimpleObjectConstructor<cmdbind::DoctypeDetectorType>
48 {
49 public:
51  DoctypeDetectorConstructor( const std::string& name_, cmdbind::CreateDoctypeDetector createDoctypeDetector_)
52  :m_name(name_)
53  ,m_createDoctypeDetector(createDoctypeDetector_) {}
54 
57 
60  {
62  }
63 
65  virtual const char* objectClassName() const
66  {
67  return m_name.c_str();
68  }
69 
72  {
74  }
75 
77  const std::string& name() const
78  {
79  return m_name;
80  }
81 
82 private:
83  std::string m_name;
85 };
86 
88 typedef boost::shared_ptr<DoctypeDetectorConstructor> DoctypeDetectorConstructorR;
89 
90 
93  :public SimpleBuilder
94 {
95 public:
97  DoctypeDetectorBuilder( const char* className_, const char* name_, cmdbind::CreateDoctypeDetector createDoctypeDetector_)
98  :SimpleBuilder( className_)
99  ,m_name(name_)
100  ,m_createDoctypeDetector(createDoctypeDetector_)
101  {}
102 
105 
108  {
110  }
113  {
115  }
116 
117  const std::string& name() const
118  {
119  return m_name;
120  }
121 
122 private:
123  std::string m_name;
125 };
126 
127 }}//namespace
128 
129 #endif
130 
Document type and format detector builder.
Definition: doctypeDetectorBuilder.hpp:92
const std::string & name() const
Get the name of the constructor object.
Definition: doctypeDetectorBuilder.hpp:77
Base classes for virtual constructors to build objects loaded from modules.
virtual const char * objectClassName() const
Get the object class name of the module object.
Definition: doctypeDetectorBuilder.hpp:65
virtual ~DoctypeDetectorConstructor()
Destructor.
Definition: doctypeDetectorBuilder.hpp:56
virtual ~DoctypeDetectorBuilder()
Destructor.
Definition: doctypeDetectorBuilder.hpp:104
virtual ObjectConstructorBase * constructor()
Create an object constructor.
Definition: doctypeDetectorBuilder.hpp:112
DoctypeDetectorBuilder(const char *className_, const char *name_, cmdbind::CreateDoctypeDetector createDoctypeDetector_)
Constructor.
Definition: doctypeDetectorBuilder.hpp:97
virtual cmdbind::DoctypeDetectorType * object() const
Construct an object instance.
Definition: doctypeDetectorBuilder.hpp:71
DoctypeDetector *(* CreateDoctypeDetector)()
Constructor function for doctype detector instance.
Definition: doctypeDetector.hpp:77
DoctypeDetectorConstructor(const std::string &name_, cmdbind::CreateDoctypeDetector createDoctypeDetector_)
Constructor.
Definition: doctypeDetectorBuilder.hpp:51
ObjectType
Definition: constructor.hpp:47
const std::string & name() const
Definition: doctypeDetectorBuilder.hpp:117
cmdbind::CreateDoctypeDetector m_createDoctypeDetector
Definition: doctypeDetectorBuilder.hpp:124
boost::shared_ptr< DoctypeDetectorConstructor > DoctypeDetectorConstructorR
Shared doctype detector constructor.
Definition: doctypeDetectorBuilder.hpp:88
Basic interface classes that to build objects and the Wolframe module interface.
virtual ObjectConstructorBase::ObjectType objectType() const
Get the object type of the module object.
Definition: doctypeDetectorBuilder.hpp:107
virtual ObjectConstructorBase::ObjectType objectType() const
Get the object type of the module object.
Definition: doctypeDetectorBuilder.hpp:59
Constructor of a simple (without configuration) object.
Definition: constructor.hpp:116
Base class for builders of objects without configuration.
Definition: moduleInterface.hpp:63
Interface for document type and format recognition.
Constructor base class.
Definition: constructor.hpp:44
std::string m_name
Definition: doctypeDetectorBuilder.hpp:123
Constructor as class.
Definition: doctypeDetector.hpp:82
std::string m_name
Definition: doctypeDetectorBuilder.hpp:83
cmdbind::CreateDoctypeDetector m_createDoctypeDetector
Definition: doctypeDetectorBuilder.hpp:84
Document type and format detector constructor.
Definition: doctypeDetectorBuilder.hpp:46
virtual const char * objectClassName() const
Definition: moduleInterface.hpp:73