// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************

#ifndef __USERINFO_H_
#define __USERINFO_H_

#include <map>
#include <string>
#include <vector>
#include "tup/Tars.h"
using namespace std;


namespace Test
{
    struct FriendInfo : public tars::TarsStructBase
    {
    public:
        static string className()
        {
            return "Test.FriendInfo";
        }
        static string MD5()
        {
            return "0ff2fc9fe39c884ba8445aa27b369e0c";
        }
        FriendInfo()
        :uin(0),nick("")
        {
        }
        void resetDefautlt()
        {
            uin = 0;
            nick = "";
        }
        template<typename WriterT>
        void writeTo(tars::TarsOutputStream<WriterT>& _os) const
        {
            _os.write(uin, 1);
            _os.write(nick, 2);
            if (birthday.size() > 0)
            {
                _os.write(birthday, 3);
            }
        }
        template<typename ReaderT>
        void readFrom(tars::TarsInputStream<ReaderT>& _is)
        {
            resetDefautlt();
            _is.read(uin, 1, true);
            _is.read(nick, 2, true);
            _is.read(birthday, 3, false);
        }
        ostream& display(ostream& _os, int _level=0) const
        {
            tars::TarsDisplayer _ds(_os, _level);
            _ds.display(uin,"uin");
            _ds.display(nick,"nick");
            _ds.display(birthday,"birthday");
            return _os;
        }
        ostream& displaySimple(ostream& _os, int _level=0) const
        {
            tars::TarsDisplayer _ds(_os, _level);
            _ds.displaySimple(uin, true);
            _ds.displaySimple(nick, true);
            _ds.displaySimple(birthday, false);
            return _os;
        }
    public:
        tars::Int32 uin;
        std::string nick;
        vector<tars::Char> birthday;
    };
    inline bool operator==(const FriendInfo&l, const FriendInfo&r)
    {
        return l.uin == r.uin && l.nick == r.nick && l.birthday == r.birthday;
    }
    inline bool operator!=(const FriendInfo&l, const FriendInfo&r)
    {
        return !(l == r);
    }

    struct UserInfo : public tars::TarsStructBase
    {
    public:
        static string className()
        {
            return "Test.UserInfo";
        }
        static string MD5()
        {
            return "12ec3745dc4fc00ebfd8907b23628a11";
        }
        UserInfo()
        :qq(0),nick(""),city("gd")
        {
        }
        void resetDefautlt()
        {
            qq = 0;
            nick = "";
            city = "gd";
        }
        template<typename WriterT>
        void writeTo(tars::TarsOutputStream<WriterT>& _os) const
        {
            _os.write(qq, 1);
            _os.write(nick, 2);
            _os.write(birthday, 3);
            if (city != "gd")
            {
                _os.write(city, 4);
            }
            _os.write(friends, 5);
        }
        template<typename ReaderT>
        void readFrom(tars::TarsInputStream<ReaderT>& _is)
        {
            resetDefautlt();
            _is.read(qq, 1, true);
            _is.read(nick, 2, true);
            _is.read(birthday, 3, true);
            _is.read(city, 4, false);
            _is.read(friends, 5, true);
        }
        ostream& display(ostream& _os, int _level=0) const
        {
            tars::TarsDisplayer _ds(_os, _level);
            _ds.display(qq,"qq");
            _ds.display(nick,"nick");
            _ds.display(birthday,"birthday");
            _ds.display(city,"city");
            _ds.display(friends,"friends");
            return _os;
        }
        ostream& displaySimple(ostream& _os, int _level=0) const
        {
            tars::TarsDisplayer _ds(_os, _level);
            _ds.displaySimple(qq, true);
            _ds.displaySimple(nick, true);
            _ds.displaySimple(birthday, true);
            _ds.displaySimple(city, true);
            _ds.displaySimple(friends, false);
            return _os;
        }
    public:
        tars::Int32 qq;
        std::string nick;
        vector<tars::Char> birthday;
        std::string city;
        map<tars::Short, Test::FriendInfo> friends;
    };
    inline bool operator==(const UserInfo&l, const UserInfo&r)
    {
        return l.qq == r.qq && l.nick == r.nick && l.birthday == r.birthday && l.city == r.city && l.friends == r.friends;
    }
    inline bool operator!=(const UserInfo&l, const UserInfo&r)
    {
        return !(l == r);
    }


}



#endif
