• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/RosterPayload.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <vector>
00010 #include <boost/optional.hpp>
00011 #include <boost/shared_ptr.hpp>
00012 
00013 #include <Swiften/Base/API.h>
00014 #include <Swiften/Elements/RosterItemPayload.h>
00015 #include <Swiften/Elements/Payload.h>
00016 
00017 
00018 namespace Swift {
00019   class SWIFTEN_API RosterPayload : public Payload {
00020     public:
00021       typedef boost::shared_ptr<RosterPayload> ref;
00022       typedef std::vector<RosterItemPayload> RosterItemPayloads;
00023 
00024     public:
00025       RosterPayload() {}
00026 
00027       boost::optional<RosterItemPayload> getItem(const JID& jid) const;
00028 
00029       void addItem(const RosterItemPayload& item) {
00030         items_.push_back(item);
00031       }
00032 
00033       const RosterItemPayloads& getItems() const {
00034         return items_;
00035       }
00036 
00037       const boost::optional<std::string>& getVersion() const {
00038         return version_;
00039       }
00040 
00041       void setVersion(const std::string& version) {
00042         version_ = version;
00043       }
00044 
00045     private:
00046       RosterItemPayloads items_;
00047       boost::optional<std::string> version_;
00048   };
00049 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1