libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
moNetManager.h
Go to the documentation of this file.
1
/*******************************************************************************
2
3
moNetManager.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
29
30
*******************************************************************************/
31
32
#ifndef __MO_NETMANAGER_H__
33
#define __MO_NETMANAGER_H__
34
35
#include "
moTypes.h
"
36
#include "
moText.h
"
37
#include "
moConfig.h
"
38
#include "
moLock.h
"
39
#include "
moResourceManager.h
"
40
41
43
47
typedef
void
*
moBoostIOService
;
48
typedef
void
*
moBoostAddress
;
49
50
typedef
void
*
moBoostResolver
;
51
typedef
void
*
moBoostQuery
;
52
typedef
void
*
moBoostSocket
;
53
typedef
void
*
moBoostAcceptor
;
54
55
typedef
void
*
moBoostSystemErrorCode
;
56
57
typedef
void
*
moBoostHandleFunctionsPtr
;
58
59
typedef
moText
moAddress
;
60
typedef
moText
moPort
;
61
62
63
enum
moNetObjectType
{
64
65
MO_NET_CONNECTION
,
66
MO_NET_SESSION
,
67
MO_NET_SERVER
68
69
};
70
71
class
LIBMOLDEO_API
moNetObject
:
public
moAbstract
{
72
73
public
:
74
moNetObject
();
75
virtual
~
moNetObject
();
76
77
};
78
79
80
82
85
class
LIBMOLDEO_API
moNetConnection
:
public
moAbstract
{
86
87
public
:
88
moNetConnection
(
moBoostIOService
pIOS );
89
virtual
~
moNetConnection
();
90
91
bool
Start();
92
bool
Stop();
93
94
moBoostSocket
Socket();
95
96
97
98
void
HandleRead(
long
bytesbuf );
99
101
void
HandleWrite();
102
103
private
:
104
moBoostSocket
m_Socket;
105
106
moBoostResolver
m_Resolver;
107
108
};
109
110
moDeclareExportedDynamicArray
(
moNetConnection
*, moNetConnections );
111
112
class
LIBMOLDEO_API
moNetConnectionManager
:
public
moAbstract
{
113
114
public
:
115
moNetConnectionManager
();
116
virtual
~
moNetConnectionManager
();
117
118
void
Start(
moNetConnection
* p_new_connection );
119
void
Stop(
moNetConnection
* p_connection );
120
void
StopAll();
121
122
private
:
123
124
moNetConnections m_Connections;
125
126
moBoostHandleFunctionsPtr
m_pHandleFunctions;
127
128
};
129
130
class
LIBMOLDEO_API
moNetServer
:
public
moAbstract
{
131
132
public
:
133
moNetServer
(
moAddress
p_address,
moPort
p_port,
moText
p_directory );
134
virtual
~
moNetServer
();
135
136
void
Run();
137
void
Stop();
138
139
140
void
HandleAccept();
141
142
private
:
143
144
145
146
void
HandleStop();
147
148
moBoostAcceptor
m_pAcceptor;
149
moBoostIOService
m_pIOService;
150
151
moNetConnectionManager
m_ConnectionManager;
152
153
moNetConnection
* m_pNewConnection;
154
155
moBoostHandleFunctionsPtr
m_pHandleFunctions;
156
157
158
};
159
160
161
162
moDeclareExportedDynamicArray
(
moNetObject
*, moNetObjects );
163
164
class
LIBMOLDEO_API
moNetManager
:
public
moResource
165
{
166
public
:
167
168
moNetManager
();
169
virtual
~
moNetManager
();
170
171
virtual
MOboolean
Init
();
172
virtual
MOboolean
Finish
();
173
174
protected
:
175
moNetObjects
m_NetObjects
;
176
177
};
178
179
#endif
180
moAddress
moText moAddress
Definition:
moNetManager.h:59
moResource
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
Definition:
moResourceManager.h:152
MO_NET_CONNECTION
Definition:
moNetManager.h:65
MOboolean
#define MOboolean
Definition:
moTypes.h:385
moNetConnectionManager
Definition:
moNetManager.h:112
moNetServer
Definition:
moNetManager.h:130
moNetObjectType
moNetObjectType
Definition:
moNetManager.h:63
moTypes.h
moAbstract
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition:
moAbstract.h:191
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
moResource::Init
virtual MOboolean Init()
Definition:
moResourceManager.cpp:64
moConfig.h
moText0
clase de para manejar textos
Definition:
moText.h:75
moBoostAddress
void * moBoostAddress
Definition:
moNetManager.h:48
MO_NET_SESSION
Definition:
moNetManager.h:66
moBoostHandleFunctionsPtr
void * moBoostHandleFunctionsPtr
Definition:
moNetManager.h:57
moBoostQuery
void * moBoostQuery
Definition:
moNetManager.h:51
moResourceManager.h
moPort
moText moPort
Definition:
moNetManager.h:60
moLock.h
moBoostSocket
void * moBoostSocket
Definition:
moNetManager.h:52
moBoostSystemErrorCode
void * moBoostSystemErrorCode
Definition:
moNetManager.h:55
moText.h
moNetManager::m_NetObjects
moNetObjects m_NetObjects
Definition:
moNetManager.h:175
moResource::Finish
virtual MOboolean Finish()
Definition:
moResourceManager.cpp:83
moBoostIOService
void * moBoostIOService
Boost.Asio specific classes type definitions.
Definition:
moNetManager.h:47
moNetObject
Definition:
moNetManager.h:71
moNetConnection
clase para crear y mantener una conección basada en el protocolo tcp
Definition:
moNetManager.h:85
moBoostAcceptor
void * moBoostAcceptor
Definition:
moNetManager.h:53
moBoostResolver
void * moBoostResolver
Definition:
moNetManager.h:50
moNetManager
Definition:
moNetManager.h:164
moDeclareExportedDynamicArray
moDeclareExportedDynamicArray(moNetConnection *, moNetConnections)
MO_NET_SERVER
Definition:
moNetManager.h:67
libmoldeo
moNetManager.h
Generated on Wed May 17 2017 14:09:18 for libmoldeo (Moldeo 1.0 Core) by
1.8.8