summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/proto/proto.hh
diff options
context:
space:
mode:
authorhaller2005-04-07 20:27:53 +0000
committerhaller2005-04-07 20:27:53 +0000
commita957915d1fc7d5c465e43647bdce04ca8d9e992b (patch)
treee18dcaee0430e4ab4c3a7acb67e964f5c77b349d /2005/i/robert/src/proto/proto.hh
parente280e5728defeb5c0d362da5a905fdf429c21f8d (diff)
Modifications des commentaires
Ajout de la possibilité d'envoie des packets non fiables ajout des static_cast
Diffstat (limited to '2005/i/robert/src/proto/proto.hh')
-rw-r--r--2005/i/robert/src/proto/proto.hh14
1 files changed, 8 insertions, 6 deletions
diff --git a/2005/i/robert/src/proto/proto.hh b/2005/i/robert/src/proto/proto.hh
index 701c725..49c88e9 100644
--- a/2005/i/robert/src/proto/proto.hh
+++ b/2005/i/robert/src/proto/proto.hh
@@ -37,7 +37,7 @@ class Proto : public NonCopyable
/// Packet.
struct Frame
{
- uint8_t command;
+ char command;
std::vector<uint8_t> args;
bool operator==(const Frame& frame);
};
@@ -70,12 +70,15 @@ class Proto : public NonCopyable
/// le faire.
bool sync (void);
/// Envois un packet.
- void send (const Frame &frame);
+ void send (const Frame &frame, bool fiable = true);
/// Envois un packet. COMMAND est la commande à envoyer, FORMAT, donne le
/// format et le nombre de paramètres ('b' : 8 bits, 'w' : 16 bits, 'd' :
/// 32 bits, majuscule pour signé).
void send (uint8_t command, const char *format = 0, int a0 = 0, int a1 = 0,
- int a2 = 0, int a3 = 0);
+ int a2 = 0, int a3 = 0, bool fiable = true);
+ /// permet d'envoyer un packet robert
+ void Proto::send_pas_fiable (uint8_t command, const char *format, int a0,
+ int a1, int a2, int a3);
//@{
/// Teste si le packet correspond au format et décode les valeurs. Utilise
/// le même format que send.
@@ -105,10 +108,9 @@ class Proto : public NonCopyable
void newArgFrame(Proto::Frame & frame, char format, int arg);
/// Renvoie la taille necessaire du vecteur args pour un format donné
static int argsFrameSize(const char *format);
- /// Renvoie la taille necessaire du vecteur args pour 1 argument
-// static int argSize(char format);
/// Décode un argument
- static void decodeArg(const Frame & frame, const char *format, int &a0, int &a1, int &a2, int &a3);
+ static void decodeArg(const Frame & frame, const char *format, int &a0,
+ int &a1, int &a2, int &a3);
};
#endif // proto_hh