libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
moBasePlugin.h
Ir a la documentación de este archivo.
1
/*******************************************************************************
2
3
moBasePlugin.h
4
5
****************************************************************************
6
* *
7
* This source is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This code is distributed in the hope that it will be useful, but *
13
* WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15
* General Public License for more details. *
16
* *
17
* A copy of the GNU General Public License is available on the World *
18
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19
* obtain it by writing to the Free Software Foundation, *
20
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
* *
22
****************************************************************************
23
24
Copyright(C) 2006 Fabricio Costa
25
26
Authors:
27
Fabricio Costa
28
Andrés Colubri
29
30
*******************************************************************************/
31
32
#ifndef __MO_BASE_PLUGIN_H__
33
#define __MO_BASE_PLUGIN_H__
34
35
#include "
moText.h
"
36
37
#if defined(_WIN32)
38
#include <windows.h>
39
typedef
HINSTANCE
MOpluginHandle
;
40
#define MO_PLG_API __declspec(dllexport)
41
#define MO_PLG_ENTRY __stdcall
42
#else
43
#include <dlfcn.h>
44
typedef
void
*
MOpluginHandle
;
45
#define MO_PLG_API
46
#define MO_PLG_ENTRY
47
#ifdef MO_MACOSX
48
#define moPluginExtension moText(".dylib")
49
#endif
50
#ifdef MO_LINUX
51
#define moPluginExtension moText(".so")
52
#endif
53
#endif
54
55
inline
MOpluginHandle
moLoadPlugin
(
moText
fn)
56
{
57
#if defined(_WIN32)
58
return
LoadLibraryA(fn);
59
#else
60
return
dlopen(fn, RTLD_LAZY);
61
#endif
62
}
63
64
inline
void
moUnloadPlugin
(
MOpluginHandle
&handle)
65
{
66
#if defined(_WIN32)
67
FreeLibrary(handle);
68
handle = NULL;
69
#else
70
dlclose(handle);
71
handle = NULL;
72
#endif
73
}
74
76
79
class
LIBMOLDEO_API
moPluginDefinition
{
80
81
public
:
82
83
moPluginDefinition
() {
84
m_Name =
moText
(
""
);
85
m_FullPath =
moText
(
""
);
86
m_MoldeoObjectType =
MO_OBJECT_UNDEFINED
;
87
}
88
89
moPluginDefinition
(
const
moPluginDefinition
&src ) {
90
*
this
= src;
91
}
92
94
99
moPluginDefinition
(
const
moText
& p_name,
const
moText
& p_fullpath,
moMoldeoObjectType
p_type ) {
100
m_Name = p_name;
101
m_FullPath = p_fullpath;
102
m_MoldeoObjectType = p_type;
103
}
104
105
virtual
~moPluginDefinition
() {}
106
107
moPluginDefinition
&operator = (
const
moPluginDefinition
&src) {
108
m_Name = src.
m_Name
;
109
m_FullPath = src.
m_FullPath
;
110
m_MoldeoObjectType = src.
m_MoldeoObjectType
;
111
return
*
this
;
112
}
113
115
moText
GetName
() {
116
return
m_Name;
117
}
118
120
moText
GetFullPath
() {
121
return
m_FullPath;
122
}
123
125
moMoldeoObjectType
GetType
() {
126
return
m_MoldeoObjectType;
127
}
128
129
protected
:
130
131
moText
m_Name
;
132
moText
m_FullPath
;
133
moMoldeoObjectType
m_MoldeoObjectType
;
134
135
136
};
137
138
moDeclareExportedDynamicArray
(
moPluginDefinition
, moPluginDefinitions );
139
140
#endif
moPluginDefinition::GetFullPath
moText GetFullPath()
Devuelve la ruta y nombre completos del archivo del plugin.
Definition:
moBasePlugin.h:120
moMoldeoObjectType
moMoldeoObjectType
Tipos de objetos en Moldeo.
Definition:
moTypes.h:525
moPluginDefinition::GetType
moMoldeoObjectType GetType()
Devuelve el tipo de objeto que crea el plugin.
Definition:
moBasePlugin.h:125
moPluginDefinition::GetName
moText GetName()
Devuelve el nombre del plugin.
Definition:
moBasePlugin.h:115
moPluginDefinition::m_Name
moText m_Name
Definition:
moBasePlugin.h:131
moPluginDefinition::m_FullPath
moText m_FullPath
Definition:
moBasePlugin.h:132
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
moDeclareExportedDynamicArray
moDeclareExportedDynamicArray(moPluginDefinition, moPluginDefinitions)
moText0
clase de para manejar textos
Definition:
moText.h:75
moPluginDefinition
Definición de un plugin.
Definition:
moBasePlugin.h:79
moPluginDefinition::~moPluginDefinition
virtual ~moPluginDefinition()
Definition:
moBasePlugin.h:105
moUnloadPlugin
void moUnloadPlugin(MOpluginHandle &handle)
Definition:
moBasePlugin.h:64
moText
moText0 moText
Definition:
moText.h:291
moPluginDefinition::moPluginDefinition
moPluginDefinition()
Definition:
moBasePlugin.h:83
moText.h
MOpluginHandle
void * MOpluginHandle
Definition:
moBasePlugin.h:44
MO_OBJECT_UNDEFINED
Definition:
moTypes.h:526
moPluginDefinition::moPluginDefinition
moPluginDefinition(const moText &p_name, const moText &p_fullpath, moMoldeoObjectType p_type)
constructor
Definition:
moBasePlugin.h:99
moPluginDefinition::m_MoldeoObjectType
moMoldeoObjectType m_MoldeoObjectType
Definition:
moBasePlugin.h:133
moPluginDefinition::moPluginDefinition
moPluginDefinition(const moPluginDefinition &src)
Definition:
moBasePlugin.h:89
moLoadPlugin
MOpluginHandle moLoadPlugin(moText fn)
Definition:
moBasePlugin.h:55
libmoldeo
moBasePlugin.h
Generado el Martes, 10 de Septiembre de 2019 21:28:23 para libmoldeo (Moldeo 1.0 Core) por
1.8.13