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
62
63
64
/* 
 * File:   TeamMessage.h
 * Author: thomas
 *
 * Created on 7. April 2009, 09:45
 */

#ifndef _TEAMMESSAGE_H
#define _TEAMMESSAGE_H

#include <map>

#include "Tools/DataStructures/Printable.h"
#include "Tools/DataStructures/Serializer.h"

#include "Representations/Modeling/TeamMessageData.h"


class TeamMessage : public naoth::Printable
{
public:
    // container holding the last incomeing message of the teammates
    std::map<unsigned int, TeamMessageData> data;

    unsigned int dropNoSplMessage = 0;
    unsigned int dropNotOurTeam = 0;
    unsigned int dropNotParseable = 0; // NOTE: currently not used; if key fails it is not parseable!
    unsigned int dropKeyFail = 0;
    unsigned int dropMonotonic = 0;

    TeamMessage() {}

    virtual ~TeamMessage() {}

    virtual void print(std::ostream& stream) const
    {
        for(auto const &it : data) {
            const TeamMessageData& d = it.second;
            d.print(stream);
            stream << "------------------------" << std::endl;
        }
        stream << "active team-members: " << data.size() << "\n"
               << "========================\n"
               << "dropNoSplMessage = " << dropNoSplMessage << "\n"
               << "dropNotOurTeam = "   << dropNotOurTeam   << "\n"
               << "dropNotParseable = " << dropNotParseable << "\n"
               << "dropKeyFail = "      << dropKeyFail      << "\n"
               << "dropMonotonic = "    << dropMonotonic    << "\n"
               << std::endl;

    }
};

namespace naoth {
template<>
class Serializer<TeamMessage>
{
public:
    static void serialize(const TeamMessage& representation, std::ostream& stream);<--- Function 'serialize' argument 1 names different: declaration 'representation' definition 'r'.
    static void deserialize(std::istream& stream, TeamMessage& representation);<--- Function 'deserialize' argument 2 names different: declaration 'representation' definition 'r'.
};
}

#endif  /* _TEAMMESSAGE_H */