summaryrefslogtreecommitdiff
path: root/i/simulotron/src/gs/gs_message.hh
blob: 45ed43d16b64a42c02a41bca7379df5f95612199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef gs_message_hh
#define gs_message_hh
/* gs_message.hh - D�claration de la classe des grosses string */
/* Simulotron - Programme de simulation de robot {{{
 *
 * Copyright (C) 2005 Nicolas Haller
 *
 * Robot APB Team/Efrei 2005.
 *        Web: http://assos.efrei.fr/robot/
 *      Email: robot AT efrei DOT fr
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * }}} */

#include <string>

class GSTransmitter;

class GSMessage
{
    private:
	/// grosse string
	std::string gs_;
	std::string::iterator igs_;
    public:
	/// Constructeur sans argument
	GSMessage (void);
	/// Constructeur/r�cup�rateur
	GSMessage (GSTransmitter & gst);
	/// R�cup�ration de la string en entier
	const std::string & getGS (void) const;
	/// R�cup�ration de donn�es de la gs
	void readGS (void * data, size_t size);
	/// R�cup�re des donn�es sous forme d'une string
	void getString (std::string & str, size_t size);
	/// Ecriture � la fin de la gs
	void appendGS (const void * data, size_t size);
	/// Ecriture au d�but de la gs
	void insertFrontGS (const void * data, size_t);
	/// Remise � z�ro de l'it�rateur de lecture
	void setIteratorBegin(void);
	/// Efface la GS
	void clear(void);
	/// Efface tout ce qu'il y a avant l'iterateur
	void delBeforeIt(void);
};

#endif //gs_message_hh