gloox  1.0.28
pubsubitem.h
1 /*
2  Copyright (c) 2005-2023 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef PUBSUBITEM_H__
15 #define PUBSUBITEM_H__
16 
17 #include "gloox.h"
18 
19 #include <string>
20 
21 namespace gloox
22 {
23 
24  class Tag;
25 
26  namespace PubSub
27  {
28 
37  class GLOOX_API Item
38  {
39  public:
43  Item();
44 
49  Item( const Tag* tag );
50 
55  Item( const Item& item );
56 
60  ~Item();
61 
66  const Tag* payload() const { return m_payload; }
67 
72  void setPayload( Tag* tag );
73 
78  const std::string& id() const { return m_id; }
79 
84  void setID( const std::string& id ) { m_id = id; }
85 
90  Tag* tag() const;
91 
92  private:
93  Tag* m_payload;
94  std::string m_id;
95 
96  };
97 
98  }
99 
100 }
101 
102 #endif // PUBSUBITEM_H__
Abstracts a PubSub Item (XEP-0060).
Definition: pubsubitem.h:38
void setID(const std::string &id)
Definition: pubsubitem.h:84
const std::string & id() const
Definition: pubsubitem.h:78
const Tag * payload() const
Definition: pubsubitem.h:66
This is an abstraction of an XML element.
Definition: tag.h:47
The namespace for the gloox library.
Definition: adhoc.cpp:28