fcml
1.3.0
Toggle main menu visibility
Loading...
Searching...
No Matches
fcml_dialect.hpp
Go to the documentation of this file.
1
/*
2
* FCML - Free Code Manipulation Library.
3
* Copyright (C) 2010-2020 Slawomir Wojtasiak
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
26
27
#ifndef FCML_DIALECT_HPP_
28
#define FCML_DIALECT_HPP_
29
30
#include "
fcml_common.hpp
"
31
32
#include "
fcml_dialect.h
"
33
34
namespace
fcml {
35
41
class
Dialect
:
public
NonCopyable {
42
protected
:
43
48
Dialect
() {
49
_dialect = NULL;
50
}
51
56
virtual
~Dialect
() {
57
if
(_dialect) {
58
::fcml_fn_dialect_free
(_dialect);
59
_dialect = NULL;
60
}
61
}
62
63
protected
:
64
65
friend
class
DialectAware
;
66
73
fcml_st_dialect
*
getDialect
()
const
{
74
return
_dialect;
75
}
76
83
void
setDialect
(
fcml_st_dialect
*dialect) {
84
this->_dialect = dialect;
85
}
86
87
private
:
88
90
fcml_st_dialect
*_dialect;
91
92
};
93
98
class
DialectAware
{
99
public
:
100
105
DialectAware
() {
106
}
107
112
virtual
~DialectAware
() {
113
}
114
122
fcml_st_dialect
*
extractDialect
(
const
Dialect
&dialect)
const
{
123
return
dialect.
getDialect
();
124
}
125
};
126
127
}
128
129
#endif
/* FCML_DIALECT_HPP_ */
fcml::DialectAware
Inherit from this class in order to get access to the native FCML dialect structure.
Definition
fcml_dialect.hpp:98
fcml::DialectAware::~DialectAware
virtual ~DialectAware()
Virtual destructor.
Definition
fcml_dialect.hpp:112
fcml::DialectAware::extractDialect
fcml_st_dialect * extractDialect(const Dialect &dialect) const
Extracts the native FCML dialect from the dialect object.
Definition
fcml_dialect.hpp:122
fcml::DialectAware::DialectAware
DialectAware()
Default constructor.
Definition
fcml_dialect.hpp:105
fcml::Dialect
An abstract dialect.
Definition
fcml_dialect.hpp:41
fcml::Dialect::Dialect
Dialect()
Default constructor.
Definition
fcml_dialect.hpp:48
fcml::Dialect::getDialect
fcml_st_dialect * getDialect() const
Gets the wrapped FCML dialect.
Definition
fcml_dialect.hpp:73
fcml::Dialect::setDialect
void setDialect(fcml_st_dialect *dialect)
Sets a new dialect for the wrapper.
Definition
fcml_dialect.hpp:83
fcml::Dialect::~Dialect
virtual ~Dialect()
Virtual destructor.
Definition
fcml_dialect.hpp:56
fcml_common.hpp
C++ wrappers common classes.
fcml_dialect.h
Structures and functions related to dialects.
fcml_st_dialect
struct fcml_st_dialect fcml_st_dialect
Assembler dialect.
Definition
fcml_dialect.h:36
fcml_fn_dialect_free
LIB_EXPORT void LIB_CALL fcml_fn_dialect_free(fcml_st_dialect *dialect)
Frees dialect instance.
include
fcml_dialect.hpp
Generated by
1.17.0